]> git.ipfire.org Git - thirdparty/dracut.git/commit
do 'ip route replace default' instead of 'add'
authorWill Woods <wwoods@redhat.com>
Thu, 28 Aug 2014 17:44:47 +0000 (13:44 -0400)
committerHarald Hoyer <harald@redhat.com>
Fri, 12 Sep 2014 08:22:21 +0000 (10:22 +0200)
commit7e50abfdb8ab51a2086b60635bfc3cc7f9db03df
tree061767457556b4c8fb5b7434dd3ffc5cc818d6aa
parenta49cac2e65eb1beb8b0442b74aaa4851d184c0ce
do 'ip route replace default' instead of 'add'

When you define the gateway for an interface, dracut sets it up with:

  ip route add default via $gw dev $netif

If a default route is already set (e.g. if you have multiple NICs), this
will fail with the message "RTNETLINK answers: File exists".

So, if your first NIC isn't usable as a default route

Using "ip route replace default" instead allows ifup/dhclient-script to
correctly change the default route to the new interface.
modules.d/40network/dhclient-script.sh
modules.d/40network/ifup.sh