IF_* variables are not defined (for static IP) in post-up phase
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ifupdown (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
SYMPTOM
My computer is set up with static IP on interface eno1 and running 'sudo apt update' fails. Adding nameserver aaa.bbb.ccc.ddd in resolv.conf helps, as a workaround, but this is reset on reboot. Another workaround is to create a secondary IP on the same interface using DHCP (it works), but I don't want that.
ANALYSIS
I have traced the problem to the IF_* variables not being set at "post-up" phase, where resolvconf tries to get the values. (see 000resolvconf file in /etc/network/
To verify this I created a script named 0000dbg which I placed in all the if-*.d folders:
#---- Start
DBGDIR=/etc/test
mkdir -p $DBGDIR
DEBUGFILE=
set | grep -E "^(IF_|
#--- end
(For some reason the mkdir command did not work, so I created the directory manually.)
These where the resulting files (listed with tail -n20 ...):
==> /etc/test/post-down <==
ADDRFAM='meta'
IFACE='--all'
LOGICAL='auto'
METHOD='none'
MODE='stop'
PATH='/
PHASE='post-down'
VERBOSITY='0'
==> /etc/test/post-up <==
ADDRFAM='meta'
IFACE='--all'
LOGICAL='auto'
METHOD='none'
MODE='start'
PATH='/
PHASE='post-up'
VERBOSITY='0'
==> /etc/test/pre-down <==
ADDRFAM='inet'
IFACE='eno1'
IF_ADDRESS=
IF_BROADCAST=
IF_DNSNAMESERVE
IF_GATEWAY=
IF_HOSTNAME=
IF_NETMASK=
LOGICAL='eno1'
METHOD='static'
MODE='stop'
PATH='/
PHASE='pre-down'
VERBOSITY='0'
==> /etc/test/pre-up <==
ADDRFAM='inet'
IFACE='lo'
LOGICAL='lo'
METHOD='loopback'
MODE='start'
PATH='/
PHASE='pre-up'
VERBOSITY='0'
As you can see the IF_* variables were created in the 'pre-down' phase but not in the 'post-up' as expected.
I would expect that some of the code in the ifdown program should have been in the ifup program.
VERSIONS
Distribution: Ubuntu 16.04 (LTS) (latest and greatest)
ifupdown 0.8.10ubuntu1.1 amd64
I also found this one <http://
description: | updated |
description: | updated |
description: | updated |