Tags:default-gateway Redhat rhel
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