1.docker One kind of bridge network schematic diagram
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/85/8B/wKioL1eoMpKQn9yIAABuACV_d8k586.png "title=" Docker bridging. png "alt=" Wkiol1eompkqn9yiaabuacv_d8k586.png "/>
2. Configure the Docker container network and host host network in the same network segment using the pipework third-party open Source Network Configuration Tool
#1). Installing the Pipework Open Source Network Configuration Tool
git clone https://github.com/jpetazzo/pipework
CP ~/pipework/pipework/usr/local/bin/
#第2步和第3步和第4步放入脚本一起执行, otherwise there will be a phenomenon of broken network connection
#2). Bind virtual Bridge and physical network card, implement physical network card and virtual network card public IP
Brctl ADDBR Br0
Brctl addif br0 eth0
#3). Configure the physical network card address as the management address of the virtual bridge, because the container does not communicate directly with the physical network card
IP addr del 10.0.0.10/24 dev eth0
Ifconfig br0 10.0.0.10/24 up
#4). Delete the previous route, add a new route, exit to the BR0 virtual network card, gateway to the physical switch
IP route del default
Route add default GW 10.0.0.254
#5). Start a container without a network
Docker run-itd--name Test--net=none Centos/bin/bash
#6). Configure the address and gateway for a container that already exists named Test (if the CENTOS6 upgrade kernel installs Docker This step may be an error, need to upgrade Iproute)
Pipework br0 test 10.0.0.100/[email protected]
This article from "Monotonous ~ Lifetime No" blog, please be sure to keep this source http://chenshifei.blog.51cto.com/11883413/1835666
Docker bridging network schematic sharing and pipework simple configuration