The case is when your laptop has internet connection from Wi-Fi, while other PC or device only has ethernet port, and you want to connect the ethernet-only device to internet through the wifi-connected laptop.
Actually it’s quite easy – compared to 5-10 years ago when we have to fiddle with iptables and masquerading. Here’s what we have to do on the laptop:
1. Click on the Network Manager Applet (on top right of the screen), then select “Edit Connections”.
2. On the “Wired” tab, select the “Wired Connection 1” or whatever it might be, then click on “Edit” button on its right side.
3. Move to “IPv4 Settings”, change the “Method” drop-down into “Shared to other computers”.
Then on the other device, just plug the ethernet cable, then it will do the rest automatically, absolute hassle-free.
In case it doesn’t work like that, do this first on the laptop:
$ sudo ifconfig eth0 192.168.0.1 netmask 255.255.255.0
then on the device:
$ sudo ifconfig eth0 192.168.0.2 netmask 255.255.255.0
Then set the gateway, pointing to the laptop’s address:
$ sudo route add default gw 192.168.0.1