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 192.168.1.34
> route add default gw 192.168.1.35

finally, DNS is also configured.

Aucun commentaire:

Enregistrer un commentaire