Sharing internet connection in home network?
This is an instant 2-command process.
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward
Will immediately begin forwarding IP's (routing). Editing /etc/sysctl.conf you can turn it on permanently.
Since your internal IP's are probably not valid on the internet you will need to do IP masquerading too. This is accomplished with IPTABLES.
Code:
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
This will mask all your internal IP's with your external (valid) IP where eth0 is the name of your ethernet card. Of course all PC's need to be on the same subnet. Also, installing dnsmasq is stupid when you have that functionality built into iptables. There is NO NEED to reboot when doing any of this. Have fun.


Enviar novo comentário