Background
I was with my geekfriends at a ski resort and I managed to get an Internet connection using a cellphone. Of course I wanted to share it with my friends. As geeks we brought a switch and a couple of ethernetcables.
Solution
Using this script on a Ubuntu 9.10 I managed to share my connection:
sudo ifconfig eth0 10.8.16.1 sudo sysctl -w net.ipv4.ip_forward=1 sudo sysctl -w net.ipv4.conf.default.forwarding=1 sudo sysctl -w net.ipv4.conf.all.forwarding=1 sudo iptables -P FORWARD ACCEPT sudo iptables --table nat -A POSTROUTING -o ppp0 -j MASQUERADE
Conmnect everymachine with the switch and the clients just needed to use a 10.0.0.0/8 network adress and add 10.8.16.1 as default gateway and it works!
Leave a Reply
You must be logged in to post a comment.