Skip to content

Instantly share code, notes, and snippets.

@micw
Last active July 3, 2019 05:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micw/4a7f14135ab1c60efec38b7fe72a130c to your computer and use it in GitHub Desktop.
Save micw/4a7f14135ab1c60efec38b7fe72a130c to your computer and use it in GitHub Desktop.
Setup macvlan device to use with docker
docker network create --driver=macvlan --subnet=192.168.1.0/24 --gateway 192.168.1.210 -o parent=eno1 -o macvlan_mode=bridge macvlan0
auto eno1
iface eno1 inet manual
# http://infrastructuredevops.com/01-05-2018/docker-macvlan.html
auto macvlan0
iface macvlan0 inet static
address 192.168.1.1
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.210
dns-nameservers 192.168.1.210
pre-up ip link add link eno1 name macvlan0 type macvlan mode bridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment