Thursday, April 24, 2008

Temporarily Share Internet Connection on Ubunty Gutsy (Linux)

On host machine:

(this machine has wireless internet connection over wlan0 and wants to share it over eth0)

sudo ifconfig eth0 192.168.10.1 netmask 255.255.255.0
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo su
echo 1 > /proc/sys/net/ipv4/ip_forward

On client machine:
(this machine wants to connect to host over eth0)

sudo ifconfig eth0 192.168.10.2
sudo route add default gw 192.168.10.1 eth0

Source: http://wiki.steenbe.nl/?p=29#more-29

No comments:

Pyjamas