Default GATEWAY not set

Issues related to configuring your network
Post Reply
dwfa
Posts: 13
Joined: 2012/02/29 05:04:15

Default GATEWAY not set

Post by dwfa » 2014/04/15 20:09:43

Hi,

I am not sure if this is a user error or a problem in CENTOS 6. Here is the issue: When I have the default gateway specified in the /etc/sysconfig/network file and not in the /etc/sysconfig/network-scripts/ifcfg-eth0 there is not default gateway generated when I examine the routing table; I have to manually add the default route. From what I read the default gateway should be created and I do not need a /etc/sysconfig/network-scripts/route-eth0 file. If I have the GATEWAY tag in the /etc/sysconfig/network-scripts/ifcfg-eth0 then one gets generated. I do not understand what is going on.

Any insight would be helpful

Here are what the files look like.

/etc/sysconfig/network

Code: Select all

NETWORKING=yes
HOSTNAME=<hiding my domain>
GATEWAY=192.168.1.254
GATEWAYDEV=eth0
/etc/sysconfig/network-scripts/ifcfg-eth0

Code: Select all

DEVICE=eth0
HWADDR=<hiding mac address>
NM_CONTROLLED=yes
ONBOOT=yes
IPADDR=192.168.1.1
BOOTPROTO=none
NETMASK=255.255.0.0
TYPE=Ethernet
#GATEWAY=192.168.1.254
DNS1=192.168.1.1
IPV6INIT=no
USERCTL=no
dwfa

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Default GATEWAY not set

Post by gerald_clark » 2014/04/15 20:17:16

In the ifcfg-eth0 file change to NM_CONTROLLED=no
You don't need GATEWAYDEV in /etc/sysconfig/network

Then:
chkconfig NetworkManager off
chkconfig network on
service NetworkManager stop
service network start

dwfa
Posts: 13
Joined: 2012/02/29 05:04:15

Re: Default GATEWAY not set

Post by dwfa » 2014/04/15 22:25:59

Thanks for the help; that did it. I understand what the above command did; just not sure why I needed to do that. Is there some documentation I missed on this? I would like to understand better why I needed to turn off NM; this is for my edification.

Post Reply