Macvlan based interface pings from host but not from namespace

Posted by jtlebi on Server Fault See other posts from Server Fault or by jtlebi
Published on 2013-10-20T13:52:15Z Indexed on 2013/10/20 15:56 UTC
Read the original article Hit count: 192

Filed under:
|
|
|

My setup:

  1. Private network vboxnet1 10.0.7.0/24
  2. 1 Host, ubuntu desktop
  3. 1 VM, ubuntu server (VirtualBox)

Adressing layout:

  1. HOST: 10.0.7.1
  2. VM: 10.0.7.101
  3. VM MAC NAMESPACE: 10.0.7.102

On the VM, I ran the following commands:

ip netns add mac                        # create a new nmespace
ip link add link eth0 mac0 type macvlan # create a new macvlan interface
ip link set mac0 netns mac

On the mac namespace, inside the VM:

ip link set lo up
ip link set mac up
ip addr add 10.0.7.102/24 dev mac0

So that we basically end up with: (Like Inception ?)

+------------------------+
| Host: 10.0.7.1         |
|                        |
| +--------------------+ |
| | VM: 10.0.7.101     | |
| |                    | |
| | +----------------+ | |
| | | NS: 10.0.7.102 | | |
| | |                | | |
| | +----------------+ | |
| +--------------------+ |
+------------------------+

What works:

  • Ping between Host and VM
  • Ping between NS and NS
  • dhclient from NS

What does not work:

  • ping between NS and VM
  • ping between NS and Host

Where I started to go nuts:

  • tcpdump on host (the real machine) actually shows ARP request AND replies
  • tcpdump on NS shows ARP requests sent to the host
  • tcpdump on VM makes the whole mess work (!) --> ping starts to get answers when tcpdump is started on the VM ?!?

So, I bet you were eager for it, my question is: how to I make it work ? I suspect something's wrong with ARP on the macvlan inside the NS but can't figure out what exactly...

Btw, I did the same expérimentations with the mac0 interface directly on the VM (no namespace) and it worked flawlessly.

© Server Fault or respective owner

Related posts about linux

Related posts about networking