by lmm · 11y ago · 0 comments
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Ta-da, basic internet connection sharing is working. (If you want automatic network configuration for the devices that are connecting to your machine, you'll need to install and configure a dhcp server e.g. dhcpd)Edit: oh, no, that won't work, your network device is no longer eth0 because the distros have been messing around with it again. Sorry, I can't help, I moved to FreeBSD years ago to get away from this crap.
Sometimes using those two lines would work alone, sometimes they would only work in conjunction with more lines with different flags.. This is why I said reliable and shamanic
I run ubuntu 1404 server, slack on my notebook, debian on my home box.. Those two lines all do something different on each at different times of day under different moons, or alike when they all fail to do anything at all
I chalked it up to some kind of collision with how nm or wicd, machine respective, were trying to run their show