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
NETWORKING=yes
HOSTNAME=hostname.domain.com
GATEWAY=192.168.1.1
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
** /etc/sysconfig/network **
What if you had ipv6 configured and you wanted to setup a gateway for ipv6?