Open th0m opened 2 years ago
Any thoughts on this @hbhasker? Thank you!
Sorry I haven't had time to look at this report.
@nybidari Could you take a look?
No worries, thanks for assigning this issue. @nybidari feel free to let me know if you need any additional information.
I will take a look at this one.
Caveat: this is my first time hearing about MACVLAN interfaces. I'm mostly going with the description here.
runsc
was written to operate in a Docker-esque environment. For networking, this means a netns containing one end of a veth pair. In sandbox mode, runsc
scrapes the addresses and routes from its veth device, removes them from the veth (the host no longer needs them and shouldn't respond to pings and whatnot -- that's runsc
's job), and sets up its own network stack with those addresses and routes.
My guess is that, because MACVLAN appears not to be a "two ended pipe" like veth, deleting addresses and routes from the device makes it basically unreachable. Does other network functionality work, or is it just neighbor discovery? Can you ping another host locally or on the internet?
The reason this works in host networking mode is that we don't do any of the above: a connection made from within runsc
results in a connection made on the host. We don't modify the interface in the namespace.
What's the motivation for using MACVLAN? I'm thinking about how to deal with this, but the simplest solution is to use the traditional veth+bridge solution.
Maybe we could re-add the routes after deleting the address when using MACVLAN. That might get the kernel routing packets to the right place. Hard to know before testing -- it really depends how MACVLAN is implemented by Linux.
@th0m can give context of this specific use case (because I forgot), but in general think of macvlan as a more lightweight solution to container networking. In the default bridge/veth mode:
In some cases we just want to reuse the network "infra" already available for containers. This means just plugging them directly into the network. While it is technically possible to do so via bridge/veth - macvlan is just more convenient and less overhead. One example - we want to run services accessible via L2 over IPv6 link-local addresses. These do not require any extra setup from networking perspective and macvlan is super convenient for this.
Does other network functionality work, or is it just neighbor discovery?
For IPv6 if neighbour discovery is broken, everything else is broken as well (because it is like ARP for IPv4)
I ran the repro and confirmed that the issue exists, albeit with some weirdness:
I'm not sure when I'll have time to look more deeply into this, but support for macvlan would be a useful contribution. It seems like there's something missing in the initial setup with multiple IPv6 addresses, although the missing logic could be on the host or in gVisor.
A friendly reminder that this issue had no activity for 120 days.
Description
My setup is the following:
From each container, I'd expect ICMPv6 neighbor discovery to work and be able to ping the link local ip of the other container. ICMPv6 neighbor discovery works in host networking mode but does not work in the default sandbox/netstack networking mode.
Please see minimal reproduction steps below. Let me know if there is anything else I can provide to help diagnose the issue.
Steps to reproduce
Here are minimal reproduction steps to reproduce the issue:
Bundle setup
Container in sandbox networking mode, ICMPv6 neighbor discovery fails
Container in host networking mode, ICMPv6 neighbor discovery succeeds
runsc version
docker version (if using docker)
uname
kubectl (if using Kubernetes)
No response
repo state (if built from source)
No response
runsc debug logs (if available)
No response