Routing Multiple Nic's within the same subnet

Routing Multiple Nic's within the same subnet

You may find that when working with multiple Ethernet cards within the same subnet that outgoing traffic may default to only one Nic. This is due to the routing table that Linux uses by default and while this works in most cases, you may want to customize your routing to ensure that traffic is routed through a specific card.

Example:

Fiber Card : ens8f0 xxx.xxx.xxx.129 255.255.254.0

Non Fiber Card : enp1s0f0 xxx.xxx.xxx.130 255.255.254.0

Default Route output:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default xxx.xxx.xxx.1 0.0.0.0 UG 0 0 0 ens8f0
xxx.xxx.xxx.0 * 255.255.254.0 U 0 0 0 ens8f0
xxx.xxx.xxx.0 * 255.255.254.0 U 0 0 0 enp1s0f0

To ensure that you control how the traffic is routed via the hardware then you will need to remove the default routes and add them explicitly for each card.

route delete default gw <IP><NIC>

route add -net <IP> netmask <IP> gw <NIC>

route delete default gw xxx.xxx.xxx.1 ens8f0

route delete default gw xxx.xxx.xxx.1 enp1s0f0

route add -net xxx.xxx.xxx.0 netmask 255.255.254.0 xxx.xxx.xxx.129 gw ens8f0

route add -net xxx.xxx.xxx.0 netmask 255.255.254.0 xxx.xxx.xxx.130 gw ens8f0

 

    • Related Articles

    • Changing NIC failover mode

      Log into the IPMI web interface by entering the IP address into the URL of a web browser on a client system. Go to Configuration > Network, and scroll down to the drop-down list for LAN Interface, or Default Interfaces. The default setting is Fail ...
    • Physical port layout

      Q: Which physical network port does IPMI operate over? A: IPMI will function over one of two ports on the motherboard integrated NIC, and utilizes a failover option to determine which interface it will use. The first port is the dedicated IPMI port, ...
    • Updating MAC Addresses (CentOS/RHEL)

      If your system's motherboard has recently been replaced, you may encounter network failures due to the new motherboard using different MAC addresses. Modern Linux distributions such as CentOS and Red Hat will typically auto-populate udev rules and ...
    • Update BIOS firmware on multiple systems at once using Supermicro Update Manager (SUM)

      One method to update BIOS and IPMI firmware remotely is via the Supermicro Update Manager command-line tool, a.k.a. "SUM". Before using SUM for BIOS updates, it is critical to ensure that all target systems are of the same motherboard model. If you ...
    • LSI 12 Gb/s MegaRAID BIOS RAID Configuration

      This step by step guide will help in the creation of any RAID that is supported by the LSI 12 Gb/s MegaRAID controllers using the LSI CTRL-R utility built into the controller.   1. Boot your server and at the end of the LSI screen you will see an ...