-
Notifications
You must be signed in to change notification settings - Fork 21
Cannot ping my docker container IP after executing the macvlan plugin #20
Description
https://github.com/lowescott/learning-tools/tree/master/docker-macvlan
Using the build from the link, I'm able to run the driver ok:
./macvlan-docker-plugin-0.2-Linux-x86_64 --macvlan-subnet "138.42.44.0/24" --gateway "138.42.44.1" --host-interface "eno33554992"
INFO[0000] Plugin configuration options are:
container subnet: [138.42.44.0/24],
container gateway: [138.42.44.1],
host interface: [eno33554992],
mmtu: [1500],
macvlan mode: [bridge]
INFO[0000] Macvlan network driver initialized successfully
I created my macvlan - testmacvlan:
docker network create -d macvlan --subnet=138.42.44.0/24 --gateway=138.42.44.1 -o host_iface=eno33554992 testmacvlan
f456c261fdfd1f83b7533b8fd61f46e65a37013a1e24374603cd0f8804c98f3a
I created my container:
docker run --net=testmacvlan --privileged -d --name test3 -t -i centos6-template:v1 /bin/bash
d05c4ee0fec7b4045f55f6119540bc22d63f7ce8dd7a5f67e8c4b777dd370f49
INFO[0919] Allocated container IP: [ 138.42.44.2/24 ]
INFO[0919] Created Macvlan port: [ 2f8b6 ] using the mode: [ bridge ]
At this point my container has a 138net IP:
ifconfig
eth0 Link encap:Ethernet HWaddr EE:A8:0D:70:E9:E7
inet addr:138.42.44.2 Bcast:0.0.0.0 Mask:255.255.255.0
inet6 addr: fc00:44::eca8:dff:fe70:e9e7/64 Scope:Global
inet6 addr: fe80::eca8:dff:fe70:e9e7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4738 errors:0 dropped:0 overruns:0 frame:0
TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:491154 (479.6 KiB) TX bytes:4442 (4.3 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:656 (656.0 b) TX bytes:656 (656.0 b)
But i'm not able to ping in or out of the container or ping my gw. How is the IP of the container obtained, is it using dhcp/dhclient? Each time I try this my container is getting assigned 138.42.44.2, I don't think this is getting served by dhcp. Any ideas what could be the problem?