I have a CentOS 6 install that had 1 NIC, eth0, working fine
I added another NIC, eth1
. Both NICs are on the same switch, and same LAN.
I copied ifcfg-eth0
to ifcfg-eth1
, and then simply changed the DEVICE=
, IPADDR=
, and HWADDR=
iines.
After setting up /etc/sysconfig/network-scripts/ifcfg-eth1
, I can ping eth1
from an external machine all day and it is fine.
But if I try to ping from inside the server (ping -Ieth1 google.com
), I get no response, whereas ping -Ieth0 google.com
works fine.
I have removed the GATEWAY=
lines from both ifcfg-eth0
and ifcfg-eth1
, and put GATEWAY=
in /etc/sysconfig/network
.
Here are my obfuscated config files:
eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.40
NETMASK=255.255.255.0
HWADDR=00:00:23:45:67:8F
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
DNS1=192.168.1.240
DNS2=192.168.1.244
eth1
DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.1.41
NETMASK=255.255.255.0
HWADDR=00:00:23:45:67:99
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
DNS1=192.168.1.240
DNS2=192.168.1.244
network
NETWORKING_IPV6=no
HOSTNAME=myserver
NETWORKING=yes
GATEWAY=192.168.1.2
My iptables -L -v
are currently completely empty. And I am not using SELinux.
ethX
will be linked to a different 1to1NATeth1
IP just fine from an external machine (which makes no sense). It is only a ping from inside the machine to an external IP that fails. I'm not sure how you could successfully ping from outside to inside but not vice versa without an interfering firewall, but the firewall rules are empty...