Welcome to It-Slav.Net blog
Peter Andersson
peter@it-slav.net

I've already got a female to worry about. Her name is the Enterprise.
-- Kirk, "The Corbomite Maneuver", stardate 1514.0
12
Feb

 

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.





Book reviews
FreePBX 2.5
Powerful Telephony Solutions






Asterisk 1.6
Build a feature rich telephony system with Asterisk






Learning NAGIOS 3.0





Cacti 0.8 Network Monitoring,
Monitor your network with ease!