Static routing

Trying to configure dNFS with multipath I ran into the need of routing traffic from a specific devices (10G), this article describing how to do this in the Operating System (Centos/Redhat/Oracle).

There are 2 different ways of configuring persistent static routes.

The first approach requires adding entries for each device (NIC) to the files
For eth0, the file would be

echo " via" >> /etc/sysconfig/network-scripts/route-eth0
echo " via" >> /etc/sysconfig/network-scripts/route-eth1

To add the routes instantly, run the script /etc/sysconfig/network-scripts/ifup-routes. It takes the device name as input. The script is always run at boot time so the static routes are recreated after reboots.

/etc/sysconfig/network-scripts/ifup-routes eth0
/etc/sysconfig/network-scripts/ifup-routes eth1

The second approach involves adding routes using the "route" statement. Executing the "route" statement will add the route.

To ensure the routes are persistent, one has to edit the /etc/rc.local file and add the static routes to this file. This file is run once at boot time. Add the following lines to the /etc/rc.local file.

route add -net netmask dev eth0
route add -net netmask dev eth1



Popular posts from this blog

Fixing & Registering ORACLE_HOMES in Central Inventory

Export in Pl/Sql via DBMS_DATAPUMP