Find two test machines: [root@docker1 centos_zabbix]# docker network ls NETWORK ID NAME DRIVER SCOPE 19ac9a55bedb bridge bridge local 0a3cbfe2473f host host local aab77f02a0b1 none null local [root@docker1 centos_zabbix]# docker network create --driver macvlan --subnet 10.0.0.0/24 --gateway 10.0.0.254 -o parent=ens33 macvlan_1 This command executes both, which means adding the macvlan network type [root@docker1 centos_zabbix]# docker network ls NETWORK ID NAME DRIVER SCOPE 19ac9a55bedb bridge bridge local 0a3cbfe2473f host host local 4e5ccdc657e1 macvlan_1 macvlan local aab77f02a0b1 none null local Make sure both servers have the centos6.9:v2 version image: Execute on one machine: [root@docker1 centos_zabbix]# docker run -it --network macvlan_1 --ip=10.0.0.155 centos6.9:v2 /bin/bash Execute on one machine: [root@docker2 opt]# docker run -it --network macvlan_1 --ip=10.0.0.156 centos6.9_ssh:v2 /bin/bash [root@9ea3f69d89c4 /]# ping 10.0.0.155 PING 10.0.0.155 (10.0.0.155) 56(84) bytes of data. 64 bytes from 10.0.0.155: icmp_seq=1 ttl=64 time=2.15 ms 64 bytes from 10.0.0.155: icmp_seq=2 ttl=64 time=0.569 ms The fact that another container can be pinged here indicates that the containers are identical^C This kind of problem is IP addresses cannot be repeated. If they are repeated, confusion will occur. For example, if two IP addresses are both 155, then ping155 can be pinged, but ssh will not know which machine it is connected to. In fact, it cannot connect and the link will be wrong. Therefore, the overlay network is introduced to manage IP addresses. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: WeChat applet to save albums and pictures to albums
>>: Brief analysis of centos 7 mysql-8.0.19-1.el7.x86_64.rpm-bundle.tar
Common methods for limiting input 1. To cancel the...
Download the image (optional step, if omitted, it...
Step 1: Add Ubuntu source Switch to root su root ...
Vue router transitions are a quick and easy way t...
1. What is Vue Vue is a progressive framework for...
Written in the opening: Absolute said: "Rela...
Table of contents Preface start Basic layout Data...
Recently, due to work needs, I need to format num...
Table of contents (1) Introduction: (2) The ways ...
1. Background of Parallel Replication First of al...
It is provided in the form of WeChat components. ...
Preface The language classification of SQL mainly...
1. Pull the image docker pull registry.cn-hangzho...
In Docker's design, a container runs only one...
Table of contents 1. Environmental Preparation 2....