Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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:

SERVER:

auto eth0

iface eth0 inet static

    address 192.168.1.250
    gateway 192.168.1.4
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255

auto eth2

iface eth2 inet static

    address 192.168.1.2
    gateway 127.0.0.1
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.26.255

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 192.168.1.2 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
add comment

1 Answer

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 192.168.1.4 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 (192.168.1.0) om both interfaces. That means that there is nothing to route for your server. I don't think 127.0.0.1 is a valid gateway either (eth2). You probably don't need any gateway address on your local network. Another mistake is that eth2 has 192.168.26.255 as broadcast address. That is not a valid address on your network 192.168.1.0 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 192.168.1.4 you must not use 192.168.1.0 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
add comment

Your Answer

 
discard

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.