
Specific examples: #Check the host network mtu 1500

The host mode can coexist with other modes.

It is important to note that the port number of the service in the container does not conflict with the port number already used on Docker host. The IP address of the container is the same as that of Docker host. The host mode has the following characteristics:Ĭontainers in host mode have no isolated network namespace Similarly, the container will not virtualize its own network card, configure its own IP, etc., but use the host's IP and port. You can use docker networks to view docker network NAME DRIVER SCOPEĪs mentioned above, Docker isolates the network through Network Namespace, and in general each Docker allocates a separate Network Namespace, but if the host mode is used when the Docker container starts, the container will not acquire a separate Network Namespace, but will share a Network Namespace with the host. None mode: No network is specified, specify using - net=none (default is this option, not specified) Host mode: Shared host network, specified using - net=hostīridge mode: bridge network mode, specified with - net=bridgeĬontainer mode: Use container network, specify using - net=container:NAME_or_ID Generally, Docker containers allocate a separate Network Namespace. A network Namespace provides an independent network environment, including network cards, routing, Iptable rules and so on, which are isolated from other Network Namespace. Docker uses Linux's Namespace for resource isolation, which includes network resources, and network isolation is achieved through Network Namespace.

Network is the most complex part of virtualization technology, and of course it is also an important part of Docker application.
