Why does the macvlan interface added to a docker container disappears in Red Hat Enterprise Linux 7 ?
Issue
- Why does the macvlan interface added to a docker container disappears in Red Hat Enterprise Linux 7 ? ?
More details of the problem
1. Bond device created using nmcli
# nmcli conn add type bond mode balance-alb ifname balance-alb con-name balance-alb
# nmcli conn add type bond-slave master balance-alb ifname enp131s0f0
# nmcli conn add type bond-slave master balance-alb ifname enp131s0f1
2. Creating macvlan network
# docker network create -d macvlan -o parent=balance-alb --subnet 10.132.0.0/21 --gateway 10.132.0.1 balance-alb
3. Starting the container and then checking for the interface.
# docker run -d --network balance-alb --ip 10.132.4.0 docker-registry:5000/imageregistry
6c5419741bcc4f670e072a1cc2294d0eb64d8b354d9fd23981a0cabe1d121668
# docker exec -it 6c5419741bcc4f670e072a1cc2294d0eb64d8b354d9fd23981a0cabe1d121668 ip a s
141: eth0@if140: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/ether 02:42:0a:84:04:00 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.132.4.0/21 scope global eth0
4. After 45 seconds, interface disappears
# docker exec -it 6c5419741bcc4f670e072a1cc2294d0eb64d8b354d9fd23981a0cabe1d121668 ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
^^^^^^^^^ eth0 is gone
Environment
- Red Hat Enterprise Linux 7
- docker container
- macvlan network created using "docker network"
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.