0

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.

cjones26
  • 276
  • 1
  • 6
  • 18

1 Answers1

1

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.

Abhijeet Kasurde
  • 985
  • 9
  • 20
cjones26
  • 276
  • 1
  • 6
  • 18
  • 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 '14 at 07:31