issue: ifdown does not work (well) with mapped interfaces

Levente Huszko levente.huszko at high-end.hu
Wed Jun 20 10:28:56 UTC 2018


Hi,

I'm using Busybox 1.26.2 and have an issue with ifdown and mappings.

CONFIG_FEATURE_IFUPDOWN_IP=y
CONFIG_FEATURE_IFUPDOWN_MAPPING=y

I have mappings in place for eth0 and wlan0.
eth0 is auto configured at boot (`ifup -a`)
wlan0 is brought up by a hotplug event handler with udev (calls `ifup
wlan0`)

/etc/network/interfaces:

auto lo eth0
iface lo inet loopback
  up sysctl -w net.netfilter.nf_conntrack_helper=1
  up /etc/nftables/ipv4-filter

mapping eth0
  script /etc/network/if-check

mapping wlan0
  script /etc/network/if-check

iface eth0-dhcp inet dhcp
  pre-up /etc/network/nfs_check
  wait-delay 15

iface eth0-static inet static
  address 10.10.20.1
  broadcast 10.10.20.255
  netmask 255.255.255.0

iface eth1 inet static
  address 10.10.10.1
  broadcast 10.10.10.255
  netmask 255.255.255.0

iface wlan0-dhcp inet dhcp
  pre-up /etc/network/wlan-startstop
  post-down /etc/network/wlan-startstop

iface wlan0-adhoc inet manual
  #do nothing yet

The mappings work on ifup, /var/run/ifstate contains:
lo=lo
eth1=eth1
eth0=eth0-dhcp
wlan0=wlan0-adhoc

// or

lo=lo
eth1=eth1
eth0=eth0-static
wlan0=wlan0-dhcp

depending on what the `/etc/network/if-check` script echos for either
interface, respectively.
However, the mappings fail on `ifdown`, neither `ifdown -a`, `ifdown eth0`
or `ifdown wlan0` works.

The output is:
ifdown: ignoring unknown interface eth0

I noticed that specifying the full `physical=logical` ifstate entry works,
but that's not what I would expect, nor what `-a` does.

`ifdown eth0=eth0-dhcp`

Is this the expected behavior and if not, how could I resolve this? I
looked at
https://github.com/mirror/busybox/blob/1_26_stable/networking/ifupdown.c
but could not figure it out. Thanks for the insight!
-Lev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20180620/760bac87/attachment.html>


More information about the busybox mailing list