How to build a simple docker Network in DDBMS
This article will explain in detail how to build a simple docker network in DDBMS. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
The topology diagram is as follows:
Host1:10.20.10.70
Host2:10.20.10.71
Create an ovs switch on host 1 and host 2, respectively:
Ovs-vsctl add-br ovs0ip link set ovs0 up
Add a port for ovs0 (br0 in the same IP address range):
Ovs-vsctl add-port ovs0 br0
Create a gre tunnel to host2 on host 1:
Ovs-vsctl add-port ovs0 gre0-set interface gre0 type=gre options:remote_ip=10.20.10.71
Create a gre tunnel to host1 on host 2:
Ovs-vsctl add-port ovs0 gre0-set interface gre0 type=gre options:remote_ip=10.20.10.70
Start a container on host 1 (use pipework to hang the container on br0, assigned the ip address of 192.168.2.10):
. / ldocker.sh
Start a container on host 2 (use pipework to hang the container on br0, assigned the ip address of 192.168.2.11):
. / ldocker.sh
Enter the container on host 1 and the container on ping host 2:
You can communicate with ping.
Configuration successful
The ldocker.sh code on host1 is as follows (because of trial and error, the hand is soft, so use a simple script):
#! / bin/shdocker run-itd-- name=test1 hochikong/erbuntu:v1pipework br0 test1 192.168.2.10 docker 24 this is the end of the article on "how to build a simple docker network in DDBMS". I hope the above content can be helpful to you so that you can learn more knowledge. if you think the article is good, please share it for more people to see.