Docker Community Forums

Share and learn in the Docker community.

Connect containers to specific physical network

I am experimenting with connecting containers to specific physical networks. So far I have done some tests with macvlan, however I hit some problems there. First I have created a docker network with:

docker network create -d macvlan
–subnet=172.16.10.0/24
–gateway=172.16.10.1
-o parent=ens160 wan

Started the container:

docker run -d \
--name=telegraf-wan \
--network=wan \
--restart=always \
telegraf:wan

Unfortunately I can not ping hosts in wan nor I can ping the GW of the docker network [172.16.10.12]

What I am doing wrong?

Could fix it, prem. mode wasn’t enabled on the vswitch.