Create container with routable ip address

Dear all,

I have been trying to do the following setup the last few days. Unfortunately unsuccessfully.

Docker host where host’s:

  • eth0 is the management ip with gateway
  • eth1 resides in network which I want to use for assigning container addresses.

Besides the default docker0 bridge, another bridge is created with macvlan capabilities as follows:

 docker network create -d macvlan \
  --subnet= \
  --gateway= \
  -o parent=eth1 \

Then container is created in container_macvlan network.

docker run --rm -itd \
  --network container_macvlan \
  --name external_ip_tests \
  centos:7 \

Container gets created successfully and IP can be seen from inside.

docker exec external_ip_tests hostname -I

The problem is that I cannot ping anything in that network from within the container, not even the gateway.
Though I can ping other containers that reside on that bridge (default docker behaviour).
The container cannot be accessed from the outside as well. :confused:

Why there is no routing ? Docker networking documentation explains that macvlan networks create container interface which looks like a VM interface (has IP and MAC) from the network side.

Is there something wrong in my approach? May be I miss something important.

FYI - docker host is Centos 7 - 3.10.0-693.11.6.el7.x86_64 VM hosted on Xenserver 7.1.

Thank you for your time!