Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

nabla_lib/network Macvtap error with network namespaces #37

Open
lumjjb opened this issue Oct 17, 2018 · 2 comments
Open

nabla_lib/network Macvtap error with network namespaces #37

lumjjb opened this issue Oct 17, 2018 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@lumjjb
Copy link
Member

lumjjb commented Oct 17, 2018

When trying to use the function CreateMacvtapInterfaceDocker when a network namespace for a container is in use, we run into the error like:

Could not create /dev/tap8424: open /sys/devices/virtual/net/macvtap8424/tap8424/dev: no such file or directory

This seems to be w.r.t. to code at

d := fmt.Sprintf("/sys/devices/virtual/net/%s/tap%d/dev",

@lumjjb lumjjb added the bug Something isn't working label Oct 23, 2018
@lumjjb
Copy link
Member Author

lumjjb commented Nov 13, 2018

Macvtap uses less kernel function calls, security ++++++ :)

@lumjjb lumjjb added the enhancement New feature or request label Nov 13, 2018
@niks3089
Copy link
Contributor

The actual problem looks like macvtap isn't created. Also, I see a veth pair being created. I am not sure if this is expected.

veth6dd40be: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::e40b:11ff:fe85:2dd3  prefixlen 64  scopeid 0x20<link>
        ether e6:0b:11:85:2d:d3  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 29  bytes 3378 (3.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ubuntu:/sys/devices/virtual/net]$ ls
docker0/  lo/  tap08ca9040bf2e/  veth6dd40be/  virbr0/  virbr0-nic/

Also, CreateTapInterfaceDocker which is used as a work-around uses cfg.Tap to create the required tap device. However, CreateMacvtapInterfaceDocker doesn't use cfg.Tap. I am surprised to see however, cfg.Tap being created.

tap08ca9040bf2e: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether ee:33:22:c9:5d:25  txqueuelen 1000  (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

May be its a part of veth pair. However, the problem seems to be due to failure f creating macvtap. However, the netlink API seems to indicate success which is confusing. Need to see if the macvtap API is correctly used.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants