Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having an issue with a CentOS trixbox server which is dual-homed (one private facing NIC [eth1], one internet-facing NIC [eth0]).

I can't seem to get the default gateway to set properly to our ISP's GW via eth0. I've modified the /etc/sysconfig/network to contain both a GATEWAY & GATEWAYDEV line and removed the GATEWAY line from /etc/sysconfig/network-scripts/ifcfg-eth1 (as well as /etc/sysconfig/network-scripts/ifcfg-eth0).

No default GW shows up in the routing table unless it's specified in the ifcfg-eth1 file (which both the wrong interface and wrong gateway IP), otherwise, the routing table simply does not contain a default gateway..any ideas would be greatly appreciated!

Thanks!

EDIT

Just realized when attempting to add the default gateway manually using the route add command, I receive an error stating:

SIOCADDRT: Network is unreachable

I know this error can occur when your default gateway and interface IP address are not on the same subnet..in this case, my public IP address of eth0 is a /29.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

In the end, the issue ended up being that the default gateway was not in fact on the same subnet!

Once I changed the gateway to a router on the same subnet (and removed all instances of GATEWAY from the configuration files /etc/sysconfig/network-scripts/ifcfg-eth*), exclusively the GATEWAY/GATEWAYDEV entries in the /etc/sysconfig/network

I was able to restart the networking service and access the internet.

share|improve this answer
    
Since this question has been resuscitated, do you want to accept your own answer, then it can be put to bed? I'm glad you solved your problem, and thanks for bothering to write up the fix. –  MadHatter Jul 31 at 7:31

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.