Apr 302008

The Default Gateway is the IP Address of a router or a routing device to which all the packet to a destination for which the server doesn't have a route will be forwarded to. Most of the servers in any network leave the routing job to the routers meaning there will be a default gateway added to the system and very little (if any) static routes added to it. This makes management much easier.

This procedure should work on Redhat Enterprise Linux, Fedora, Centos.

The default gateway in Redhat Enterprise Linux is set in the /etc/network file.

Edit the file and the Default Gateway IP Address as follows:

rhel5# vi /etc/network

Add the following lines


where HOSTNAME – sets the Hostname of the server or system

GATEWAY – sets the IP Address of the Default Gateway

This should add the default gateway to the server. For the changes to take effect, restart the network services as follows

rhel5# service network restart

or to just reread the interface config files

rhel5# service network reload

This should help. For information on adding or modifying IP Address click here. To add static routes in Redhat, click here

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

  2 Responses to “How to set the default gateway in Redhat Enterprise Linux”

  1. ** /etc/sysconfig/network **

  2. What if you had ipv6 configured and you wanted to setup a gateway for ipv6?

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>