Docker Community Forums

Share and learn in the Docker community.

Trying to passthrough multiple Network interfaces from host to docker container

docker

(Akhambadkone) #1

I have a docker rhel 7.2 container that I am trying to run a networking app.
This app wants to read packets from the network interfaces and do some processing.

Currently I need to pass through 4 interfaces from the host to the container.

After exploring a bit, I realized that I could use pipework --direct-phys to do this. But it can only do it for eth1.

Rest of them do show up in the container (when I do a ifconfig), but they does not seem to be up and running.

Currently I can see eth0 and eth1 (and loopback) only available on the container, but I cannot use the rest

Is there a way I can achieve this? I believe for SDN or networking apps, this must be a must, Can docker do this?

OR should I revert to linux containers?

-Ajay


(Akhambadkone) #2

Here are the logs when I tried to use pipework on all the four interface, the first one works rest gives me a log.
on Host.
[root@xxxx network-scripts]# pipework --direct-phys enp4s0f0 e1d737d19c6b 192.168.1.2/24
[root@xxxx network-scripts]# pipework --direct-phys enp4s0f1 e1d737d19c6b 192.168.1.2/24
RTNETLINK answers: File exists
[root@xxxx network-scripts]# pipework --direct-phys enp132s0f0 e1d737d19c6b 192.168.1.4/24
RTNETLINK answers: File exists
[root@xxxx network-scripts]# pipework --direct-phys enp132s0f1 e1d737d19c6b 192.168.1.5/24
RTNETLINK answers: File exists

On the docker container.

[root@e1d737d19c6b /]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.2 netmask 255.255.0.0 broadcast 0.0.0.0
inet6 fe80::42:acff:fe11:2 prefixlen 64 scopeid 0x20
ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet)
RX packets 8 bytes 648 (648.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 648 (648.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::21b:21ff:fec2:2674 prefixlen 64 scopeid 0x20
ether 00:1b:21:c2:26:74 txqueuelen 1000 (Ethernet)
RX packets 124063312 bytes 18051459395 (16.8 GiB)
RX errors 3 dropped 0 overruns 0 frame 3
TX packets 32 bytes 2592 (2.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 0 (Local Loopback)
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


(Industrial64) #3

Too bad this never got answered/tendered. This is why I have held off using containers in production network environments. Pipework rocks, but it’s a full-KLUDGE, for features that should be implemented (but aren’t prod-ready) in Docker.