mardi 12 octobre 2010

Sharing my Wifi connection

Sometimes, I need an Internet access on my "old" computer at home using my private Wifi network. I don't have any Wifi device on my computer and I need to move my computer close to the ADSL Router . So, I use some iptables commands on my laptop, to provide an Internet access to my "old" computer.

> iptables --table nat --append POSTROUTING --out-interface wlan -j MASQUERADE
> iptables --append FORWARD --in-interface eth0 -j ACCEPT
> echo 1 > /proc/sys/net/ipv4/ip_forward  

This require that my "old" computer have access (same network domain), to my laptop and set its gateway to its eth0 ip adress.

> ifconfig eth0 inet
> route add default gw

finally, DNS is also configured.

Aucun commentaire:

Enregistrer un commentaire