Last active
June 5, 2022 20:13
-
-
Save karoltheguy/50b965d7765e4ad702ac6cd19189b625 to your computer and use it in GitHub Desktop.
macvlan seen by host
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
| #!/usr/bin/env bash | |
| #Change these variables! | |
| NIC_NAME="eth0" | |
| DOCKER_ROUTING_INTERFACE_NAME="mymacvlan" | |
| DOCKERNETWORK_IP_ADDRESS="192.168.0.249/32" | |
| DOCKERNETWORK_IP_RANGE="192.168.0.64/26" | |
| sleep 15 #Do not rush things if executing during boot. This line is not mandatory and can be removed. | |
| ip link add ${DOCKER_ROUTING_INTERFACE_NAME} link ${NIC_NAME}type macvlan mode bridge ; ip addr add ${DOCKERNETWORK_IP_ADDRESS} dev ${DOCKER_ROUTING_INTERFACE_NAME} ; ip link set ${DOCKER_ROUTING_INTERFACE_NAME} up | |
| ip route add ${DOCKERNETWORK_IP_RANGE} dev ${DOCKER_ROUTING_INTERFACE_NAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment