I found some informations but all confusing. I have an ubuntu box 12.04 connected to internet via cable with a fixed ip inside a wide internal network. The cable is plugged into motherboard network interface, that is configured with his ip, dns and so on. I bought an extra network interface card and plugged a apple airport extreme router to the second interface. I want the router to share connection with other devices using the connection taken by the cable. How i can do this?


If I understood correctly, the network layout is as follows,

clients <-wireless-> airport <-eth1-> ubuntu <-eth0-> ISP

With this setup you will need to have ip forwarding enabled and have iptables setup correctly to masquerade all the traffic from eth1 to eth0.


sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT

All you need to do is then to persist these changes.

  • I solved using an ubuntu setting (in graphical enviroment) Settings -> Network Connections -> Wired -> eth1 -> Edit -> IPv4 Settings -> Method -> 'Shared to other computer' and set the airport in dhcp. I guess it is the same thing but, in your case, using terminal, isn't? Thank you very much for the answer! – Sasha Grievus Oct 9 '15 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.