Inconsistency between RedHat 6.5 global gateway and single gateway leads to loss of default gateway

Dear friends
I use RedHat 6.5, which sets the gateway in the configuration file / etc / sysconfig / network as GATEWAY = 192.168.1.26, and the gateway in the configuration file / etc / sysconfig / network-scripts / ifcfg-eth11 as GATEWAY = 192.168.1.256. The two gateways are different. After restarting the service, the default gateway is lost and the external network cannot be accessed. Do you know why?
The configuration file information is as follows:

/ etc / sysconfig / network
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.1.26

/ etc / sysconfig / network-scripts / ifcfg-eth11
TYPE=Ethernet
DEVICE=eth11
BOOTPROTO=static
IPADDR=192.168.1.10
NETMASK=255.255.255.0
GATEWAY=192.168.1.254
METRIC=104
ONBOOT=yes
NAME=eth11

Thanks in advance....
Regards,
Tanpeng

Why do you want two default gateways??

1 Like

--- Post updated at 07:04 AM ---

Is the gateway really lost? Check with

netstat -nr | grep -w UG
1 Like

I checked, No default gateway,

Strange, I would expect that one of the two GATEWAY would supersede. You should have a RedHat contract, then contact RedHat support to clarify if this is a bug; almost certainly they will tell you to update your OS!

To resolve the conflict, with a text editor (lvim or nano or gedit or ...) you must either delete the GATEWAY line in the /etc/sysconfig/network (common to all ifcfg-X interface files) or the GATEWAY in the ifcfg-eth11!
Alternative: delete with sed, for example:

sed -i '/^GATEWAY/d' /etc/sysconfig/network

Maybe you better use the system-config-network-tui (A correction: if not present you install it with yum install system-config-network-tui ).

1 Like

thanks,I know how to resolve conflicts, but I don't understand why the default gateway will be lost