Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build a simple docker Network in DDBMS

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report