Ipfwadm problem

Posted on 1997-08-05
Last Modified: 2010-03-18
Here is the setup
NETWORK (.2-.254)  NIC          NIC            INTERNET
                   ETH0         ETH1            EXTERNAL        
  I messed around with the routing files and still have not been able to get the firewall to work properly.
Note--Everything was done from the firewall itself

  Without even touching the routing tables, I can successfully ping eth0 but not eth1.  I can also telnet out to the internet (external stuff)
  the routing table looks like this:
Destination   GW     Genmask    Flags MSS  Window Use Iface   *   U 1500   0   36 eth0       *       U 3584   0    2 lo
default   *       UG 1500   0  143 eth0
when I do route add -net eth1

Destination  Gateway  Genmask  Flags MSS  Window Use Iface   * U  1500   0    36 eth1   * U  1500   0    36 eth0       *     U  3584   0     2 lo
default   *      UG  1500   0   143 eth0

 I can now successfully ping eth1 ( but not eth0 (  I can still telnet out to the rest of the world which is connected to eth0.
  Am I missing something in the routing table?
  Is it because I am using and .2 for the two nics?  do I have
  to use separate?
  I haven't set up any rules for ipfwadm yet.  Is that the problem?
  Do I need to set up forwarding rules in order for it to work?
  Any help would be greatly appreciated!
Question by:root2

Expert Comment

ID: 1585851
The problem is that you have both NICs set up on the same sub-net.

What are you trying to acheive ?
Why do you have two NICs ?

If you have the firewall between two ethernets, then those machines must have two different IP address spaces.

(You can use 192.168.x.x for the private address space if
you use Masquerading on the linux firewall)

You realy need to do a diagram of your network topology for
anybody to understand this.

(Also you should have a lot more points for the question)


Accepted Solution

sauron earned 10 total points
ID: 1585852
You have missed a few important points.

Firstly, your IP addressing is wrong. You have three networks to consider here. The Internet is one, but you can rest assured that that is configured right :-). So, you are left with two logical networks, a small one connecting the NIC with address to the internal interface of your router. Your other network connects the NIC with address to the rest of the hosts on your network.

It is important for you to realise that your firewall is, itself a router. Ergo, you *must* recompile it's kernel, and enable IP forwarding. Without this, nothing will work. Second, you need to subnet your class C address properly. Assuming you have a full class C address, you need to split this. As you have very few interfaces (i.e. 2) on the 'external' side of the firewall, you want to use the smallest amount of your address space for subnetting. This is 1 bit. So, you end up with two subnets, like so:-

Network Address    Broadcast Address   Valid Host addresses
---------------    -----------------   -------------------- - .126 - .254

Then assign addresses from one subnet to all your hosts, and
change their subnet masks to, and addresses from the other subnet to your router's internal interface, and the 'router facing' interface on your firewall machine. You also need to change the subnet addresses on these two bits of kit.

Then, if the router facing NIC on the firewall is eth1, you need to set the default gateway on the firewall to be the IP address of the router (, and the gateway device to eth1. You can find this in /etc/sysconfig/network

All your other hosts must be configured with the IP address of the eth0 interface as their default gateway.

When you've done all that, your routing should be up and running. Then, you can start to mess around with firewall rules.

You might also consider upping the points value on this question.....

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question ( here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question