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
Students who make websites often find that some n...
1. Install components yum install epel-rpm-macros...
Generally, on national days of mourning, days of ...
1. IE browser mode Hack logo 1. CSS hack logo Copy...
Zabbix deployment documentation After zabbix is ...
Table of contents Preface How to implement Vuex f...
Overlay network analysis Built-in cross-host netw...
The data backup operation is very easy. Execute t...
Zabbix automatically discovers rules to monitor s...
This article example shares the specific code for...
Table of contents Question: When the button is cl...
Table of contents 1. Install node 2. Install Comm...
Table of contents 1. Parameters that determine ca...
Preparation: 1. Install VMware workstation softwa...
Given a div with the following background image: ...