![]() | 1 | initial version |
Here's my setup, hope it helps:
[pete@randomuser.org@ruminant guides]$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default gateway 0.0.0.0 UG 0 0 0 randomuser0
10.27.0.0 0.0.0.0 255.255.0.0 U 0 0 0 randomuser0
link-local 0.0.0.0 255.255.0.0 U 0 0 0 randomuser0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
[pete@randomuser.org@ruminant guides]$ brctl show
bridge name bridge id STP enabled interfaces
randomuser0 8000.e840f23e44d2 no bond0
virbr0 8000.525400c28bab yes virbr0-nic
[pete@randomuser.org@ruminant guides]$ cat /etc/sysconfig/docker-network
# /etc/sysconfig/docker-network
DOCKER_NETWORK_OPTIONS="--bridge=randomuser0 --default-gateway=10.27.0.1"
# --ip-forward=true"
[pete@randomuser.org@ruminant guides]$ cat /etc/sysc
sysconfig/ sysctl.conf sysctl.d/
[pete@randomuser.org@ruminant guides]$ cat /etc/sysconfig/net
netconsole network network-scripts/
[pete@randomuser.org@ruminant guides]$ cat /etc/sysconfig/network-scripts/ifcfg-randomuser0
NAME=randomuser0
DEVICE=randomuser0
TYPE=Bridge
IPADDR=10.27.0.55
NETMASK=255.255.0.0
GATEWAY=10.27.0.1
DNS1=10.27.0.3
BOOTPROTO=none
DELAY=0
ONBOOT=yes
NM_CONTROLLED=yes
[pete@randomuser.org@ruminant guides]$
Properly built containers (ports exposed, etc) act on the local physical network as if they were connected to the switch.
![]() | 2 | No.2 Revision |
Here's my setup, hope it helps:
[pete@randomuser.org@ruminant guides]$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default gateway 0.0.0.0 UG 0 0 0 randomuser0
10.27.0.0 0.0.0.0 255.255.0.0 U 0 0 0 randomuser0
link-local 0.0.0.0 255.255.0.0 U 0 0 0 randomuser0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
[pete@randomuser.org@ruminant guides]$ brctl show
bridge name bridge id STP enabled interfaces
randomuser0 8000.e840f23e44d2 no bond0
virbr0 8000.525400c28bab yes virbr0-nic
[pete@randomuser.org@ruminant guides]$ cat /etc/sysconfig/docker-network
# /etc/sysconfig/docker-network
DOCKER_NETWORK_OPTIONS="--bridge=randomuser0 --default-gateway=10.27.0.1"
# --ip-forward=true"
[pete@randomuser.org@ruminant guides]$ cat /etc/sysc
sysconfig/ sysctl.conf sysctl.d/
[pete@randomuser.org@ruminant guides]$ cat /etc/sysconfig/net
netconsole network network-scripts/
[pete@randomuser.org@ruminant guides]$ cat /etc/sysconfig/network-scripts/ifcfg-randomuser0
NAME=randomuser0
DEVICE=randomuser0
TYPE=Bridge
IPADDR=10.27.0.55
NETMASK=255.255.0.0
GATEWAY=10.27.0.1
DNS1=10.27.0.3
BOOTPROTO=none
DELAY=0
ONBOOT=yes
NM_CONTROLLED=yes
[pete@randomuser.org@ruminant guides]$
guides]$ cat /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=network.target
Wants=docker-storage-setup.service
[Service]
Type=notify
EnvironmentFile=-/etc/sysconfig/docker
EnvironmentFile=-/etc/sysconfig/docker-storage
EnvironmentFile=-/etc/sysconfig/docker-network
Environment=GOTRACEBACK=crash
ExecStart=/usr/bin/docker daemon \
$OPTIONS \
$DOCKER_STORAGE_OPTIONS \
$DOCKER_NETWORK_OPTIONS \
$INSECURE_REGISTRY
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
MountFlags=slave
TimeoutStartSec=1min
[Install]
WantedBy=multi-user.target
Properly built containers (ports exposed, etc) act on the local physical network as if they were connected to the switch.