1

CentOS 6.6

eth0
IPADDR=10.0.0.100
IPADDR2=10.0.0.101
GATEWAY=10.0.0.250
NETMASK=255.255.0.0

eth1
IPADDR=10.120.0.100
GATEWAY=10.120.0.1
NETMASK=255.255.255.0

Gateway on eth0 has Internet access but gateway on eth1 does not. I'm trying to ping IP address 10.58.1.100 which will work on only across eth1.

How do I accomplish this? I've tried creating manual routes with metric settings but it still doesn't work. On a windows machine I just have both NICs added, set static IPs and it all works fine.

If I do ifdown eth0 then I can ping 10.58.1.100 no problem.

  • can you show us netstat -r ? – Archemar Jul 2 '15 at 9:15
2

Remove the gateway setting on eth1. That means 'default gateway', i.e. a gateway which can reach the internet, which you said that one is not. You can add manual routes for the networks which that gateway can reach.

  • Not sure I follow. eth0 has internet access and eth1 does not. eth1 is the interface that can access 10.58.1.100 but i still need Internet access. – Michael Jul 2 '15 at 5:50
  • Sorry, I was confused there for a moment. Edited the answer to fix. – Wouter Verhelst Jul 2 '15 at 9:08
0

assuming router to 10.58.1.100 is 10.120.0.1, you need to

 route add net 10.58.1.0/24 10.120.0.1 1

to add route dynamicaly.

for change to be permanent, edit /etc/sysconfig/network-scripts/route-eth1 add

10.58.1.0/24 via 10.120.0.1 dev eth1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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