How to set gateway in Centos/Red Hat Linux using command line

go to /etc/sysconfig/network-scripts

vi ifcfg-eth0

add a new line “GATEWAY=” as per below

DEVICE=eth0
BOOTPROTO=static
BROADCAST=***.**.**.*
HWADDR=00:0C:29:3*:15:6*
IPADDR=***.**.**.*
NETMASK=255.255.255.0
NETWORK=***.**.**.8
ONBOOT=yes
TYPE=Ethernet
GATEWAY=***.**.**.**

About these ads

3 thoughts on “How to set gateway in Centos/Red Hat Linux using command line

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s