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

I've been looking for an answer for my problem but I've found some things that I couldn't understand.

I have a network with some machines running Windows and Ubuntu Desktop. I also have one server running Ubuntu Server. Everything works fine.

That I want is make this Server a firewall. I supose that I must have two network cards (I actually have them) and connect ISP modem to eth0 and eth1 goes to the switch where are the other machines connected.

I read about Shorewall but I don't know how to configure it and I can't connect to Internet with the others. My current configuration (LAN works OK, but WAN doesn't) is the following:


auto eth0

iface eth0 inet static


auto eth2

iface eth2 inet static


The client has as a gateway the IP of eth2

With this configuration, I can't connect to the Internet. If I do a ping to or 250, it replies successfully.

share|improve this question
do you want to use it has a firewall that also serves as a proxy? – Engels Peralta Nov 29 '11 at 21:03

How do you get your IP-address from ADSL? With DHCP? or do you have a static IP? eth0 should be configured regarding to what you use to configure IP.

As your eth0 config looks now you have a default gateway at the IP and this would be your ADSL connection with this configuration.

eth2 you say is your local network. The problem here is that you have the same (!) IP-network ( om both interfaces. That means that there is nothing to route for your server. I don't think is a valid gateway either (eth2). You probably don't need any gateway address on your local network. Another mistake is that eth2 has as broadcast address. That is not a valid address on your network you have defined for eth2.

What you have to do is to configure eth0 as it should be. And if your default gateway to the internet is you must not use network on eth2 (local net).

share|improve this answer
I totally agreed with Jonasbjork very nicely he told – Deepak Rajput Dec 8 '11 at 10:13

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.