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

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.

主站蜘蛛池模板: 台东县| 和静县| 卢湾区| 北流市| 贵德县| 陈巴尔虎旗| 南开区| 湖口县| 芦山县| 和顺县| 岳西县| 普宁市| 县级市| 潞西市| 遵化市| 板桥市| 贵南县| 冕宁县| 澎湖县| 元阳县| 伊通| 美姑县| 龙口市| 赫章县| 三台县| 曲阜市| 宿松县| 永济市| 蓝田县| 岱山县| 玉树县| 平原县| 天水市| 新乡县| 乌拉特前旗| 四川省| 北安市| 益阳市| 穆棱市| 平远县| 都匀市|