0

I have a macvlan network created with the following command:

docker network create -d macvlan --subnet=192.168.1.0/24  --gateway=192.168.1.2  -o parent=wlp2s0 pub_ne 

Where wlp2s0 is the name of the wireless interface of my laptop. gateway is 192.168.1.1 and subnet 192.168.1.0/24

Then I have created and attached a container to this network:

docker run --rm -itd  --network pub_ne  --name myAlpine alpine:latest  sh

In addition I have created a virtual machine using, virtualbox provider, with bridged network interface.

if I use ping command: - docker container -> vm ubuntu (ip of vm: 192.168.1.200) : ping works

but if I use ping command: - docker container -> gateway 192.168.1.1 or - docker container -> external world (google.com): ping not works

suggestions?

edit 1:

On docker host if i run tcpdump ( tcpdump -i icmp ) i see:

    14:53:30.015822 IP 192.168.1.56 > 216.58.205.142: ICMP echo request, id 5376, seq 29, length 64
14:53:31.016143 IP 192.168.1.56 > 216.58.205.142: ICMP echo request, id 5376, seq 30, length 64
14:53:32.016426 IP 192.168.1.56 > 216.58.205.142: ICMP echo request, id 5376, seq 31, length 64
14:53:33.016722 IP 192.168.1.56 > 216.58.205.142: ICMP echo request, id 5376, seq 32, length 64

Where 192.168.1.56 is my docker container and 216.58.205.142 should be google ip address. No echo reply is received.

2
  • Try ip link set wlp2s0 promisc on, and make sure your kernel is v3.9–3.19 and 4.0+
    – menya
    Jul 5, 2019 at 12:38
  • Thanks for the reply. I tried but unfortunately it doesn't work.
    – MarVar
    Jul 5, 2019 at 12:57

1 Answer 1

3

Macvlan is unlikely to work with IEEE 802.11.

Your wifi access point, and/or your host network stack, are not going to be thrilled.

You might want to try ipvlan instead: add -o ipvlan_mode=l2 to your network creation call and see if that helps.

That might very well still not work... (for eg, if you rely on DHCP and your DHCP server uses macaddresses and not client id)

And your only (reasonable) solution might be to drop the wifi entirely and wire the device up instead... (or move away from macvlan and use host / bridge - whichever is the most convenient)

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.