Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

On a RHEL6 server I added a 2nd nic and have configured it to use a static ip on a different subnet.

$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface U     1      0        0 eth1 U     1      0        0 eth0         UG    0      0        0 eth1

However, /etc/sysconfig/network states:


Why is this statement getting ignored?

I can manually change the default route using the ip or route command, but when I restart the network, the default route still goes back to eth1.

share|improve this question
Just a tip: you could change default gw with one command - "ip ro change default via" – ALex_hha Jul 25 '13 at 14:32
But I want the change to be permanent. – jsp Jul 25 '13 at 15:16
Oh, right, you just meant that I could do this instead of using two route commands. – jsp Jul 25 '13 at 16:10

Just add the following line


in to the /etc/sysconfig/network. Also check that there is no default gw in the /etc/sysconfig/network-scripts/ifcfg-eth1

share|improve this answer
/etc/sysconfig/network already had the line GATEWAY= in it. I had already tried to to removing the GATEWAY statement from /etc/sysconfig/network-scripts/ifcfg-eth1, but when I do that, the routing table shows the gateway at, but it shows the interface at eth1, and my network seems borked (can't see outside world or ssh in). – jsp Jul 25 '13 at 14:32
It's worth having a read of the RHEL Deployment Guide for finding out how to do these things. – James O'Gorman Jul 25 '13 at 14:33
I have done what the deployment guide has recommended. It says that /etc/sysconfig/network contains the GATEWAY option, which sets the network's gateway. This option was already set correctly, but it seems to be getting ignored. – jsp Jul 25 '13 at 15:14
I have been seen the system where default gw was defined in ifcfg-ethX. Also check /etc/sysconfig/network-scripts/route-eth1 if one exist – ALex_hha Jul 25 '13 at 15:18
@ALex_hha As noted, I removed the GATEWAY option from ifcfg-eth1, but when I did this, it changed the default gateway ip to the correct value, but it left the interface at eth1. This seems to have had an ill effect on my network. – jsp Jul 25 '13 at 15:21

When I entered the parameters for the new interface, I made the interface "available to all users". If I delete the interface and add it back without making it available to all users, the gateway stays at eth0.

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.