RHEL Interface Route โ€“ Interface Routing on CentOS / RHEL


In my environment I have several RHEL systems with multiple network interfaces. Each interface is connected to a separate network. To avoid asynchronous routing and ensure that traffic to each network is sent via the correct interface (instead of to the default gateway) I have defined an interface route. Hereโ€™s how it works.

In this example we will configure an interface route to send traffic to out the eth1 interface.

These instructions are valid for RHEL, CentOS and Oracle Linux systems.

Adding the interface route

First, add a route statement to the /etc/sysconfig/network-scripts/route-eth1 file. If this file doesnโ€™t exist you can safely create it.

The below statement will send traffic to the subnet via the eth1 interface. A null gateway ( is used because this traffic will stay local to the LAN eth1 is connected to.

ย via dev eth1

Activating the interface route

In order to apply the route statement added above the interface needs to be brought down and back up.

# Bring down eth1 using network scripts
[root@host network-scripts]# ifdown eth1
# Bring up eth1 using network scripts
[root@host network-scripts]# ifup eth1

Verifying the rhel interface route

Now that the new route configuration has been applied we can verify that the configuration is active.

First, check the routing table for the interface route. We want to make sure that a route statement for via eth1 is present.

[root@host network-scripts]# netstat -nr | grep
# Check routing table for subnet that is interface routed.
# Added heading for readability
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
ย   U         0 0          0 eth1

Here you can see that the network ( and /24 mean the same thing) is now routed via interface eth1 with no gateway specified.

Then, confirm that traffic is flowing correctly using tcpdump. You should see traffic from only leaving via the eth1 interface.

# Listen on eth1 for traffic in subnet
[root@host ~]# tcpdump -n -i eth1 net

Using the above command you should only see outbound traffic to You may need to generate some test traffic. Using the same tcpdump filter on other interfaces should show no outbound traffic to this subnet.