No default route with Fedora’s legacy network service

There’s a bug in Fedora 20 and RHEL 7, where the legacy network service does not set the default route properly. This is due to the fact, that the network service does not evaluate the GATEWAY0 directive in /etc/sysconfig/network-scripts/ifcfg-ethX that is used by NetworkManager.
To set the default route with the legacy network service, simply change GATEWAY0 to GATEWAY:

UUID=57a49f0d-31f9-4b44-9730-4f9778f71521
DNS1=192.168.2.1
BOOTPROTO=none
DEVICE=eth0
ONBOOT=yes
IPV6INIT=yes
HWADDR=46:46:46:46:46:46
TYPE=Ethernet
IPADDR0=192.168.2.180
PREFIX0=24
GATEWAY=192.168.2.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME="System eth0"

Of course, you have to set DEFROUTE=yes, too. Note that this is going to be fixed in Fedora 21.

Leave a Reply

Your email address will not be published.