Jim's Depository

this code is not yet written

macvlan is used to give a second MAC address to a network adapter and see it as a new device at the higher levels. It is useful to pretend you are multiple machines, as the container people do, or in my case, to implement your own TCP stack without interference from the kernel IP code.

My ugly scars thus far:

  • There is nearly no documentation.
  • What there is, is¬†inaccurate.
  • Just because your iproute ip command doesn’t have any help or documentation for “link add”, doesn’t mean it won’t work. Lenny’s will.
  • You create a new interface thusly (note eth0, missing in most docs):¬† ip link add link eth0 address 00:19:d1:29:d2:58 macvlan0 type macvlan
  • You can leave out the macvlan0 and it will allocate one.
  • The Debian Lenny kernels do not have macvlan turned on.
  • make-kpkg is broken in Lenny. Badly broken. But if you specify the architecture and revision on the command line and turn off Xen support in your config you can get it to work.

Not macvlan’s fault, but if you are working on a user space TCP stack and you are wondering why it seems to be sending RST packets… make sure you aren’t accidentally sharing the link with the kernel.