Account Links: Cart | Register | Log In

Skip to content

Red Hat Knowledgebase
Red Hat Knowledgebase Search
Article translations:
Currently Being Moderated

How do I configure static routes in Red Hat Enterprise Linux?

Article ID: 8024 - Created on: Apr 22, 2004 6:00 PM - Last Modified:  Aug 18, 2009 8:20 AM

To add static routes on Red Hat Enterprise Linux systems, 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

Feedback from users like yourself is a critical factor in helping us make the Red Hat Knowledgebase as useful as possible.

More Like This

  • Retrieving data ...