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.

link|improve this question

67% accept rate
feedback

1 Answer

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 /etc/sysconfig/network-scripts/ifcfg-eth* files), exclusively the GATEWAY/GATEWAYDEV entries in the /etc/sysconfig/network, I was able to restart the networking service and access the internet.

Thanks anyway fellas!

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.