2nd NIC Troubles

Home » CentOS » 2nd NIC Troubles
CentOS 7 Comments

Remove the GATEWAY line from eth1, unless you have another router (with its own access to the Internet) at 10.0.254.1. If eth0 points at your upstream, then this is unlikely.

7 thoughts on - 2nd NIC Troubles

  • I do have another gateway at 10.0.254.1, it is a Linksys router that all the provate stuff plugs into, and that Linksys plugs directly into our modem.

  • multiple gateways is problematic. there should be only one default route to 0.0.0.0/0

    so you have a pfSense firewall AND a linksys soho router both connected to the internet? sounds messy.

  • You can only have one ‘default’ gateway. Keep the one pointed to the internet router. Make a file named
    /etc/sysconfig/network-scripts/route-eth1 to hold the route(s) handled by the other interface. Something like:
    10.0.0.0/8 via 10.0.254.1
    should work if you want the whole private class A space to go that way. The ifup/ifdown scripts will add/remove the routes matching the interfaces.

  • Hi John,

    Yes, indeed. We have a pfsense box with servers behind it connected to our modem as well as a router connected with private stuff behind it.

    We do need to move the private stuff behind the pfsense box as well. It is on the list.

    Jason

  • Hi Les,

    > I do have another gateway at 10.0.254.1, it is a Linksys router that all

    So this is a static route. I trued what you suggested and the eth1
    interface stalls to come up. It just wont. All SSH sessions get disconnected and everything stops working

    I did:

    [root@meowbox network-scripts]# cat route-eth1
    10.0.0.0/8 via 10.0.254.1

    I found:
    http://www.CentOS.org/docs/5/html/5.1/Deployment_Guide/s1-networkscripts-static-routes.html

    So I changed it to:

    [root@meowbox network-scripts]# cat route-eth1
    10.0.0.0/8 via 10.0.254.1 dev eth1

    and commented out the GATEWAY= line in ifcfg-eht1 and the interface comes up.

    Testing SSH and the websites, they seem to be fine.

    Thank you for this lesson.

    Jason

  • Interesting – I’ve never had to specify the device when it can be deduced from the interface IP and netmask. And I’ve never been able to make much sense out of the ‘ip’ man page either to tell what is actually required.

  • Seconded — multiple default gateways are definitely problematic.

    You could set a metric on the second interface (eth1) prior to upping it so that the primary has priority. This doesn’t completely remedy problematic situations though. Example: if eth0 is downed at the switch, but not downed on the host … so the host will continue to try and use eth0. A situation in which serial remote management or physical vga/ip kvm access is helpful.
    ;)

    Add “METRIC0” to your ifcfg-eth1 file.

LEAVE A COMMENT