Skip to content

Instantly share code, notes, and snippets.

@nerdalert
Last active March 8, 2017 16:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nerdalert/0bae9e5807113c723034 to your computer and use it in GitHub Desktop.
Save nerdalert/0bae9e5807113c723034 to your computer and use it in GitHub Desktop.
Example MacVlan Bridge mode configuration

Example MacVlan Bridge mode

# add the namespaces
ip netns add ns1
ip netns add ns2

ip link add mv1 link eth0 type macvlan mode bridge
ip link add mv2 link eth0 type macvlan mode bridge

ip link set mv1 netns ns1
ip link set mv2 netns ns2

ip netns exec ns1 ip link set dev mv1 up
ip netns exec ns2 ip link set dev mv2 up

# set ip addresses
ip netns exec ns1 ifconfig mv1 10.10.10.1/24 up
ip netns exec ns2 ifconfig mv2 10.10.10.2/24 up

ns1 and ns2 should be reachable via icmp at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment