Skip to content
Inho Oh edited this page Dec 27, 2017 · 1 revision

2 NIC control

  • eth0: intranet
  • eth1: public internet (gateway 192.168.0.1)
$ docker network create --subnet 192.168.0.0/24 --aux-address "DefaultGatewayIPv4=192.168.0.1" --gateway=192.168.0.200 enjoynet
$ docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
20e631f0ee79        bridge              bridge              local
bb0016dd392b        enjoynet            bridge              local
df017b311678        host                host                local
3d9646977956        none                null                local

$ brctl show
bridge name	bridge id		STP enabled	interfaces
br-bb0016dd392b		8000.024254d852dc	no
docker0		8000.02426b0de501	no

$ sudo brctl addif br-bb0016dd392b eth1
$ btcrl show
bridge name	bridge id		STP enabled	interfaces
br-bb0016dd392b		8000.024254d852dc	no		eth1
docker0		8000.02426b0de501	no	

# Remove ip address
$ sudo ip a del 192.168.0.200/24 dev br-bb0016dd392b

$ docker run --network enjoynet --name enjoy -it ubuntu /bin/bash
Clone this wiki locally