Configuring static routes in RHEL3+
December 16, 2007 – 00:18 by Hannes Van de VelThe new way to add static routes on Red Hat Enterprise Linux systems is to create a file /etc/sysconfig/network-scripts/route-ethX where X corresponds to the network interface you wish to use the alternate route(s). This file deals with three fields: GATEWAY, NETMASK, and ADDRESS. Each field should have a number appended to it indicating what route it relates to. The example below shows two static routes configured for the eth0 network interface.
/etc/sysconfig/network-scripts/route-eth0
GATEWAY0=10.10.0.1 NETMASK0=255.0.0.0 ADDRESS0=10.0.0.0 GATEWAY1=10.2.0.1 NETMASK1=255.255.0.0 ADDRESS1=192.168.0.0 |
After this is done either reboot the system or restart networking: service network restart