4 ms·
Thanks, this is very useful. Has that been written up somewhere in a suitably abstract form? Is there a list of variables that are affected, and how they are
by mafribe 10y ago
Thanks, this is very useful.
Has that been written up somewhere in a suitably abstract form?
Is there a list of variables that are affected, and how they are affected.
In particular, I wonder about network interfaces. Say your hardware
has a network interface that's got MAC address 0b:21:b5:e2:11:22 and
IPv4 address 123.234.34.45, how are these addresses affeced by
cloning?
- geofft 10y agoYou get a completely separate network stack. None of the network devices are copied/cloned. You can move a network device into the container, but it's no longer accessible in the host. Since most people don't have spare physical devices, there are a couple of approaches using virtual devices. You can create a "veth" device pair, which is basically a two-ended loopback connection. Move one end of the veth into the container, configure them as 192.168.1.1 and 2 (or whatever), and set up NAT. Or you can create a "macvlan" device, which hangs off an existing device and generates a new MAC address. Any traffic destined for the macvlan's MAC address goes to the macvlan device; any other traffic goes to the parent device. So I can move the macvlan into the container and assign it the address of 123.234.34.46, and it will ARP for that address using its own MAC address. The container also has its own routing table, iptables (firewall) rule set, etc. And anyone listening on a broadcast interface in the host won't get packets destined to the container, or vice versa. It's basically like a virtual machine.
- mafribe 10y agoThanks for the description. I guess container networking like Weave works by 'hijacking' veth and executing NAT-like address translation. like a virtual machine. That's surprising. Containers were advertised to me as being much more lightweight than conventional virtualisation (e.g. VMware, Xen), because the former, unlike the latter, share the ambient operating system. completely separate network stack What does that mean exactly, does the container copy the actual code, or is the network stack's code shared, just run in a separate address space?