pali / igmpproxy

IGMP multicast routing daemon
Other
150 stars 77 forks source link

Match interfaces by IP address #29

Open sandersaares opened 6 years ago

sandersaares commented 6 years ago

I use Docker networks, which have randomly generated interface names. This makes it impossible to create an igmpproxy configuration for them. I request that specifying the IP address of the interface be allowed as an alternative to its name.

pali commented 6 years ago

IP address is not (unique) identifier for interface and also it may change. Moreover igmpproxy operates on network interface, therefore it is needed to specify interface. I would really suggest to use configure it via interface, so make interface names predicable and not random.

sandersaares commented 6 years ago

I would be quite happy to; however, Docker authors have decided to have it use randomly named interfaces so there is not really anything I can do. Presumably they use random names since they create virtual interfaces dynamically at runtime.

At the moment, igmpproxy is unable to make any use of Docker networks, as far as I can tell.

pali commented 6 years ago

So it is a good time to start blaming to Docker authors...

Another option is to write some Docker specific script which would generate config file for docker-igmpproxy configuration.

gasinvein commented 6 years ago

How can igmpproxy be even usable in docker without placing the container inside host's network namespace?

sandersaares commented 6 years ago

Docker creates two network interfaces in its bridge networking mode - one in the host namespace and one in the container namespace, connected to each other. What I would like to do is to use the endpoint in the host namespace as the downstream interface for igmpproxy.

gasinvein commented 6 years ago

But Docker's bridged network is NAT'ed. Isn't igmpproxy intended to run on the host which is doing NAT (outside the container in your case)?

sandersaares commented 6 years ago

Yes - I wish to run igmpproxy on the Docker host, proxying between the host eth0 (upstream) and the container bridge networks (one or more dynamic ones created by Docker) as downstream.

gasinvein commented 6 years ago

Ah, looks like now I get it. So, the problem is that Docker creates bridges (in host namespace) with random names?

sandersaares commented 6 years ago

Right - due to the randomness of the names, I cannot make a configuration file that addresses them.

This is ifconfig on a host with a user-configured Docker network:

br-8fbce660a0ec: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.31.250.254  netmask 255.255.255.0  broadcast 0.0.0.0
        ether 02:42:f0:ad:7a:a9  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.50.199  netmask 255.255.255.0  broadcast 192.168.50.255
        inet6 fe80::215:5dff:fe04:eb81  prefixlen 64  scopeid 0x20<link>
        ether 00:15:5d:04:eb:81  txqueuelen 1000  (Ethernet)
        RX packets 1309  bytes 1313021 (1.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2421  bytes 3096543 (3.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I can see all the container traffic (including IGMP) that I need on the br- interface. Furthermore, one of these is created for each container:

vethc99ea4a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::b012:96ff:fe3d:e865  prefixlen 64  scopeid 0x20<link>
        ether b2:12:96:3d:e8:65  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 31  bytes 2579 (2.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

What I want to do is set the br-* interface as the downstream for igmpproxy with eth0 as upstream. I know the IP address I assign to it, so that is the easiest point of reference for me.