Super User is a question and answer site for computer enthusiasts and power users. 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 have a server running Fedora 14 on a local subnet and configured with a static IP address. It communicates to other devices on that subnet through a switch. I would like to connect this server to a second subnet using one of the other NIC interfaces on the server. This second network would obtain its IP address via a DHCP server located on the second subnet.

What do I need to do to set up this configuration so that it will use the first subnet when I refer to an address on that subnet but route the request to the second subnet for addresses that the first subnet doesn't know about?

share|improve this question

Assuming the DHCP server will provide a default gateway along with the IP address on subnet 2, the behaviour you want will happen automatically.

If the destination is one subnet 1, this is a directly connected network and so will take precedence over any other route. It will go out of ic 1.

For destinations on subnet 2, again, it is directly connected so will go out of nic 2.

For anything it doesn't know about, it will use its default gateway - as this was supplied by the dhcp server on subnet 2, the traffic will go out of nic 2 to the IP address of the default gateway.

share|improve this answer
How do I check the 2nd network for the default gateway? I don't see anything when I issue the command 'ifconfig -a eth1'. I must not be getting a gateway because I can't access any external addresses. – sizzzzlerz Oct 19 '11 at 21:40
netstat -rn will show you the routing table. If you are able to paste this it will help troubleshooting. – Paul Oct 19 '11 at 22:22

you may have to amend /etc/sysconfig/network-scripts/ifconfig-eth[01]

first of all I suggest to add HWADDR=mac-address to specify which eth* device should map to which physical interface.

For eth0 set BOOTPROTO=static set IPADDR, NETMASK, NETWORK, and BROADCAST to your needs

For eth1 set BOOTPROTO=auto and remove any static settings

for both interfaces set ONBOOT=yes

I had real trouble with NetworkManager on my Fedora 14 Box that is connected to 3 Networks (DMZ, Intranet and DMZ-test) where 2 Networks were serverd by DHCP servers. Since both DHCP servers offered a default route and (different) Nameserver. I ended up by removing the NetworkManager startup scripts from the default boot sequence and setting the immutable flag on /etc/resolv.conf. Your mileage may vary, but I found some automagic settings very annoying to circumvent.

But you only have to deal with one DHCP server, so I don't expect to much trouble at your side.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .