can't update the default gateway

Hi,

I have server that I change its network configuration from using DHCP to using static IP.

I have edited the file /etc/sysconfig/network-scripts/ifcfg-eth0
To:

BOOTPROTO=STATIC
IPADDR=xxx.xxx.xxx.xxx
NETMASK=255.255.255.0 
GATEWAY=yyy.yyy.yyy.yyy

I did

/etc/init.d/network stop
/etc/init.d/network start

Everything has been update except formthe default gateway it is still 0.0.0.0

Why is that ?

'gateway' is not a per-card setting. Set it in /etc/sysconfig/network

1 Like

Add your gateway entry in the below file

cat /etc/sysconfig/network-scripts/route-<device>
ADDRESS0=xxx.xxx.xxx.xxx
NETMASK0=xxx.xxx.xxx.xxx
GATEWAY0=xxx.xxx.xxx.xxx

This will reflect the gateway

1 Like