Skip to navigation

Using your linux machine as a router

The wireless card of my old old old Toshiba laptop (urmel) seems not to be getting along with the 128bit WEP key. Since I use it only very rarely, I’ve now set my everyday laptop (audrey) up to act as a router for urmel, using these instructions:

Audrey is connected to the router via WLAN (ath0), getting the IP via DHCP.

On audrey:

sudo -s
ifconfig eth0
iptables -t nat -A POSTROUTING -o ath0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
aptitude install dnsmasq ipmasq
/etc/init.d/dnsmasq restart
dpkg-reconfigure ipmasq # accepted all the defaults 

Uncomment the line net.ipv4.ip_forward = 1 in /etc/sysctl.conf

On urmel:

sudo ifconfig eth0

Add gateway

Both connections use the same subnet mask (


After a reboot, I wasn’t able to go online or even connect to the router on either machine. On audrey, pinging google gave “host not found”, and pinging the router gave ping: sendmsg: Operation not permitted.

This was solved by running

sudo dpkg-reconfigure ipmasq

once more.

I don’t know whether this problem will persist, and if it does, how to solve it permanently.

Comments are closed.