Richard van Dijk's picture

I ran into some issues getting my static IPv4+IPv6 network configuration stable after a reboot on TurnKey Linux 16 using default settings and a Webmin generated /etc/network/interfaces. Each reboot, there is a chance that one or more virtual IPs don't come up in ifconfig, for example 3 out of 4 IPv6 addresses are missing, or interface eth0:1 with its IPv4 address is missing.

This is the original Webmin generated config that doesn't work reliably:

# UNCONFIGURED INTERFACES
# remove the above line if you edit this file

auto lo eth0 eth1 eth0:1 eth0:2 eth0:3
iface lo inet loopback

iface eth0 inet static
    address x.x.134.34
    netmask 255.255.255.0
    broadcast x.x.134.255
    network x.x.134.0
    gateway x.x.134.1
    post-up ip6tables-restore < /etc/ip6tables.up.rules
    post-up iptables-restore < /etc/iptables.up.rules


iface eth0 inet6 static
    pre-up /sbin/modprobe -q ipv6 ; /bin/true
    address y.y.y:b::c926
    netmask 48
    up ifconfig eth0 inet6 add y.y.y:b::942b/128
    up ifconfig eth0 inet6 add y.y.y:b::3bae/128
    up ifconfig eth0 inet6 add y.y.y:b::47f3/128
    gateway y.y.y::1

iface eth1 inet dhcp
    up ip route add z.z.z.0/16 via z.z.z.253

iface eth0:1 inet static
    address x.x.130.20
    netmask 255.255.255.0
    broadcast x.x.130.255
    network x.x.130.0

iface eth0:2 inet static
    address x.x.130.40
    netmask 255.255.255.0
    broadcast x.x.130.255
    network x.x.130.0

iface eth0:3 inet static
    address x.x.130.66
    netmask 255.255.255.0
    broadcast x.x.130.255
    network x.x.130.0

By trial and error I got to the config below which - combined with adding kernel command line option biosdevname=0 - seems to work reliably now, although I'm not quite sure why:

# UNCONFIGURED INTERFACES
# remove the above line if you edit this file

allow-hotplug eth0 eth1
auto lo eth0:1 eth0:2 eth0:3 eth0:4
iface lo inet loopback

iface eth0 inet static
    address x.x.134.34
    netmask 255.255.255.0
    broadcast x.x.134.255
    network x.x.134.0
    gateway x.x.134.1
    pre-up /sbin/modprobe -q ipv6 ; /bin/true
    pre-up sysctl -w net.ipv6.conf.eth0.autoconf=0
    post-up iptables-restore < /etc/iptables.up.rules
    post-up ip6tables-restore < /etc/ip6tables.up.rules

iface eth1 inet dhcp
    up ip route add z.z.z.0/16 via z.z.z.253

iface eth0:1 inet static
    address x.x.130.20
    netmask 255.255.255.0
    broadcast x.x.130.255
    network x.x.130.0

iface eth0:1 inet6 static
    address y:y:y:b:c926
    netmask 48
    gateway y:y:y::1

iface eth0:2 inet static
    address x.x.130.40
    netmask 255.255.255.0
    broadcast x.x.130.255
    network x.x.130.0

iface eth0:2 inet6 static
    address y:y:y:b::942b
    netmask 128

iface eth0:3 inet static
    address x.x.130.66
    netmask 255.255.255.0
    broadcast x.x.130.255
    network x.x.130.0

iface eth0:3 inet6 static
    address y:y:y:b::3bae
    netmask 128

iface eth0:4 inet6 static
    address y:y:y:b::47f3
    netmask 128

By the way, using this format Webmin can only display the IPv6 addresses (except the last one on eth0:4), but won't let me edit any of them. The IPv6 input fields disappear as soon as some IPv4 is configured on an interface. And without IPv4 fields filled in it won't allow to save the IPv6 fields.

So there is something up with this in TKL16, hope this can help someone.

Forum: 
Jeremy Davis's picture

Ultimately I think that this is a Webmin issue with anything more complex than a simple network config. Reading through your thread and the fact that you've been able to get it to work, certainly suggest that's the case. As such, it's probably worth reporting upstream to them. If it is a Webmin issue, I'm not sure how easily it would be able to be fixed because as you're probably aware, Webmin is cross platform and so has to work across a huge range of OSes.

A less likely, but also possible thing worth mentioning is that 'ifconfig' is considered deprecated, so may have just been reporting wrong? It's unclear to me whether you checked the config externally (or perhaps I just missed it) or whether you were relying on the feedback from ifconfig to determine whether it was working or not?

FWIW, there are currently 2 different config methods (IIRC there was also an intermediate method that is no longer supported) and 2 sets of tools. AFAIK Webmin only supports the legacy method at this point (but I could be wrong).

The newest config method is the "modern" systemd related method and is described in the section 5.3 of the Debian manual. It is configured via files within /etc/systemd/network/. I have also heard reference to "networkd" and assume that is the same thing, but can't be 100% sure.

Then there is the legacy config method as described in section 5.6 of the Debian manual. It relies on use of the /etc/network/interfaces file and is the method that TurnKey still uses (as you'd be aware).

As for the tools, there are the legacy "net tools" - which includes 'ifconfig'. This toolset are still relatively usable although are considered deprecated. The new/current iproute2 tools are considered the preferred networking toolset these days. Both sets of tools are included in TurnKey by default.

So bottom line is that it sounds like it's primarily a bug in Webmin but it may also be related to ifconfig. Thanks for reporting...

Add new comment