Skip to content

Instantly share code, notes, and snippets.

@fredhsu
Last active March 7, 2016 23:42
Show Gist options
  • Save fredhsu/63344b94fc18c87f8ed2 to your computer and use it in GitHub Desktop.
Save fredhsu/63344b94fc18c87f8ed2 to your computer and use it in GitHub Desktop.
Running Docker macvlan bridge mode with a ToR Arista switch
# switch config
interface Ethernet24
description r18-u34-svr2
no switchport
ip address 192.168.1.1/24
# Docker commands
$ docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o host_iface=enp5s0f0 mac_net100
1cd42773a15a385691f72a6527e4a1846ad7fdd623541006c2b9a01888ac09fe
$ docker run --net=mac_net100 -it --rm alpine /bin/sh
/ # ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=0.290 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=0.229 ms
$ docker run --net=mac_net100 -it --rm alpine /bin/sh
/ # ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2): 56 data bytes
64 bytes from 192.168.1.2: seq=0 ttl=64 time=0.113 ms
64 bytes from 192.168.1.2: seq=1 ttl=64 time=0.073 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment