Routing table issues with dual nic non routing server

Issues related to configuring your network
Post Reply
eclay
Posts: 9
Joined: 2011/09/09 21:20:26

Routing table issues with dual nic non routing server

Post by eclay » 2014/07/29 16:36:04

Hello,

I've run into a strange issue with a freshly installed centos7 install using the kickstart method. When the OS is installed the default gateway is put into the /etc/sysconfig/network file. This gateway is on the same subnet as the eth0 device. The server is configured with a public IP address on eth0 and a private 10.x.x.x IP on eth1. What seems to happen is when the server is booted up the routing table seems to get confused and I'm unable to ping the default gateway from the server. If I use ifdown for each interface and then bring them up using ifup one at a time starting with the public interface I can ping the default gw and the world.

/etc/sysconfig/network
# cat /etc/sysconfig/network
# Created by anaconda
GATEWAY=1.2.2.1
HOSTNAME=hostname.domain.com

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:25:90:A3:15:48
ONBOOT=yes
BOOTPROTO=static
IPADDR=1.2.2.5
NETMASK=255.255.255.0
DNS1=1.2.3.4
DNS2=1.2.3.5
DNS3=1.2.3.6

/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=00:25:90:A3:15:49
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.1.1.5
NETMASK=255.255.255.0
DNS1=1.2.3.4
DNS2=1.2.3.5
DNS3=1.2.3.6

After booting up the system with this config the routing table looks like the following.

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 1.2.2.1 0.0.0.0 UG 1024 0 0 eth1
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
1.2.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
1.2.2.1 0.0.0.0 255.255.255.255 UH 1024 0 0 eth1

After taking down eth0 then eth1 and bringing them back up eth0 then eth1 the routing table looks like the following and I can ping the world.
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 1.2.2.1 0.0.0.0 UG 1024 0 0 eth0
10.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
1.2.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

This same exact config was working just fine in CentOS 6.5.

Any suggestions on why this is happening and how to resolve?

eclay
Posts: 9
Joined: 2011/09/09 21:20:26

Re: Routing table issues with dual nic non routing server

Post by eclay » 2014/07/29 19:33:00

By adding a couple lines of code to the kick start I'm able to remove the gateway= from the /etc/sysconfig/network and put it in the public interfaces ifcg-eth# file. Seems odd that I would need to do this kind of hack to make this work.

Post Reply