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


Red Hat 9:

File contains lines of the form:


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 netmask eth1


Content Copyright 2003-2014 George Toft