First connect the cables - and be aware that NetworkManager might start playing tricks when it detects link on the wired interfaces.
On the host with internet access find a free IP range and configure the network interface:
ifconfig eth0 10.0.0.1 upEnable IP forwarding:
sysctl net.ipv4.ip_forward=1But masquerade it:
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -j MASQUERADE
On the other host configure the network interface:
ifconfig eth0 10.0.0.2 upSet default gateway:
route add default gw 10.0.0.1Configure DNS with settings from the other host:
echo "nameserver 192.168.2.1" > /etc/resolv.conf
THAT was dirty!
I always forget the masquerading part and have difficulties finding it - now I know where to find it ;-)