Can't access virtual interface eth0:0

network

#1

Hi guys, :face_with_raised_eyebrow:

I’m trying to setup a service that starts a TFTP server but it needs to run on a specific IP address let’s say:
10.0.1.32/24
For that I created a virtual interface eth0:0 like this:
ifconfig eth0:0 10.0.1.32 netmask 255.255.255.0

My pi3 is connected to a switch that allows me to bridge the 10.0.1.* network between devices yet I can’t download or upload files to this address, this address is simply not visible from outside the container.

Why would eth0 be fully reachable but not eth0:0 ? :thinking:


#4

I’d expect that the issue here is that the docker environment doesn’t know to forward requests to eth0:0 on the container, but that eth0 is set up automatically. I think there are a few routes here. My personal preference is for reserved IPs. Using either of static or reserved you could then just publish the tftp server on eth0 and be done with it.

  1. Reserved IPs. The DHCP in most domestic switches can be configured such that particular mac addresses are always configured with particular IP addresses.
  2. Static IPs. https://docs.resin.io/reference/OS/network/2.x/#setting-a-static-ip
  3. Network binding. You could set the docker environment up to know to forward inbound tftp requests down to the eth0:0 interface on the container.

#6

I also want to point out that NetworkManager is the problem and that it sometimes, not always override any interface that was set using the ip command


#7

NetworkManager will do those kind of things, e.g. through the DHCP client, etc. I think in general you have two options:

  1. Define all your configuration through the NetworkManager’s connection profiles without using any additional configuration from the lower level tools like ip. This is the first option I would go with.
  2. If the first option does not fit your use case, then make the device not be managed by NetworkManager and do all the configuration using the lower level tools. Currently we do not support editing the global NetworkManager.conf file that resides on the host OS (although this will be possible in the future). You may do that through the NetworkManager’s D-Bus API from inside your container though: https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Managed

Please let me know how that goes for you.