Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

* D-Link Modem
* ASUS WL520 GU router (with dd-wrt installed)
* Desktop with Ubuntu 10.04

Would like to route the internet through my Desktop, which have 2 ethernet ports. Identified in Linux as eth0 and eth1. Internet is connected to the eth0 and router to eth1. I want to share the internet through the WiFi router to my other WiFi enabled devices.

Need help in setting up this configuration.

share|improve this question
It will be much easier setup if you connect the router (WL520) to the D-Link modem and then connect the Desktop to the router's one of the the 4 LAN ports to eth0. Let the router do its job rather than make Ubuntu do the router's job. Sorry, I don't have an answer to your question. – user68186 Dec 20 '12 at 21:03

Its all ipTables. I have a guide written on my blog about using Linux as a router and firewall. You will need to use NAT on the Ubuntu machine to change your internal IP's on to external. Just connect your modem to the wall then from modem to ubuntu machine with ethenet. Set the modem to bridged mode, which means all it does is forward traffic to your linux machine where the firewall and routing will be done.

  • NAT ipTables
  • Default Gateway for internal traffic must be set in routes

This link will take you to my blog. This describes setting up your ipTables to allow NAT. Then once you have done this you will need to open any ports for applications that you use regularly.

How are you dealing with wireless?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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