Websitetemplate.org

Welcome > Linux > Networking > Static Routes Red Hat

Static Routes Red Hat


RHEL 4/5
Static route configuration is stored in a /etc/sysconfig/network-scripts/route-interface file. For example, static routes for the eth0 interface would be stored in the /etc/sysconfig/network-scripts/route-eth0 file. The route-interface file has two formats: IP command arguments and network/netmask directives.

Define a default gateway on the first line. This is only required if the default gateway is not set via DHCP:
Default X.X.X.X dev interface

Define a static route. Each line is parsed as an individual route:
X.X.X.X/X via X.X.X.X dev interface


Ref: http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deployment_Guide/s1-networkscripts-static-routes.html




Red Hat 9:
Edit/create
/etc/sysconfig/network-scripts/static-routes

File contains lines of the form:

host|net

may be a device name to have the route brought up and down with the device, or "any" to have the correct devices calculated at run time. Most likely example:

any net 192.168.2.0 netmask 255.255.255.0 eth1

Ref: http://endor.clublinux.org/RHCE-9.html


Content Copyright 2003-2014 George Toft