Created
October 12, 2015 02:27
-
-
Save ninjadq/4d4c38b0828669e789bb to your computer and use it in GitHub Desktop.
add macvlan to a container
This file contains 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
#!/bin/bash | |
ip link add em1p0 link em2 type macvlan mode bridge | |
ip link set netns $@ em1p0 | |
nsenter -t $@ -n ip link set em1p0 up | |
nsenter -t $@ -n ip route del default | |
nsenter -t $@ -n ip addr add 118.26.188.97/24 dev em1p0 | |
nsenter -t $@ -n ip route add default via 118.26.188.254 dev em1p0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment