Last active
February 17, 2026 09:19
-
-
Save micw/4a7f14135ab1c60efec38b7fe72a130c to your computer and use it in GitHub Desktop.
Setup macvlan device to use with docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker network create --driver=macvlan --subnet=192.168.1.0/24 --gateway 192.168.1.210 -o parent=eno1 -o macvlan_mode=bridge macvlan0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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