官术网_书友最值得收藏!

Bridge

This is the default network type in Docker. When the Docker service daemon starts, it configures a virtual bridge, named docker0. If you do not specify a network with the docker run -net=<NETWORK> option, the Docker daemon will connect the container to the bridge network by default. Also, if you create a new container, it will be connected to the bridge network. For each container that Docker creates, it allocates a virtual Ethernet device which will be attached to the bridge. The virtual Ethernet device is mapped to appear as eth0 in the container, using Linux namespaces, as you can see in the following diagram:

The in-container eth0 interface is given an IP address from the bridge's address range. In other words, Docker will find a free IP address from the range available on the bridge and will configure the container's eth0 interface with that IP address. From now on, if the new container wants to, for example, connect to the Internet, it will use the bridge; the host's own IP address. The bridge will automatically forward packets between any other network interfaces that are attached to it and also allow containers to communicate with the host machine, as well as with the containers on the same host. The bridge network will probably be the most frequently used one.

主站蜘蛛池模板: 江安县| 洛隆县| 略阳县| 衡南县| 磐石市| 长寿区| 吉林市| 霍邱县| 广南县| 安图县| 宣城市| 昌乐县| 呈贡县| 崇礼县| 柘荣县| 台江县| 子长县| 凤山市| 河曲县| 开江县| 巩留县| 大庆市| 会东县| 本溪市| 鹰潭市| 拉孜县| 明星| 肥东县| 云南省| 雷波县| 来宾市| 梁河县| 荥经县| 吉木乃县| 关岭| 鄂尔多斯市| 光山县| 祁门县| 建湖县| 托里县| 阳春市|