Skip to content

Instantly share code, notes, and snippets.

@zflat
Created September 24, 2020 20:45
Show Gist options
  • Save zflat/f5eab1b28aa3958f7bbb1dca5c4443c6 to your computer and use it in GitHub Desktop.
Save zflat/f5eab1b28aa3958f7bbb1dca5c4443c6 to your computer and use it in GitHub Desktop.
Bridge a docker container to a physical network adapter NIC

Bridge a docker container to a physical network adapter NIC

Set up a network bridge to the physical interface (NIC) on your host connected to a specific LAN

docker network create -d macvlan \
 --subnet=192.168.111.0/24 \
 -o parent=enx000ec6be0a54 br_net

Connect a running container to the br_net network with a specific IP address

docker network connect --ip 192.168.111.205 br_net <container_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment