Docker container communication with OvS

Source: Internet
Author: User

2 Host, 192.168.11153,192.168.1.154

Installing OvS

RPM-IVH openvswitch-2.4.0-1.x86_64.rpm #预先下载的

Configure OvS

1. Configure DOCKER0 IP According to the previous article

Http://www.cnblogs.com/dopeter/p/4942606.html

2. Configure OvS

153 Machines

Ovs-vsctl ADD-BR Br0
Ovs-vsctl add-port br0 gre1--set interface Gre1 Type=gre option:remote_ip=192.168.1.154
#添加br0到本地docker0, allowing container flow through OvS through tunnel
Brctl addif Docker0 Br0

IP link set Dev br0 up
IP link set Dev Docker0 up
Iptables-t nat-f;iptables-f
IP route add 172.18.0.0/16 Dev Docker0

154 Machines

Ovs-vsctl ADD-BR Br0
Ovs-vsctl add-port br0 gre1--set interface Gre1 Type=gre option:remote_ip=192.168.1.153
#添加br0到本地docker0, allowing container flow through OvS through tunnel
Brctl addif Docker0 Br0

IP link set Dev br0 up
IP link set Dev Docker0 up
Iptables-t nat-f;iptables-f
IP route add 172.17.0.0/16 Dev Docker0

3. Start Docker

Docker run--name 153mysql-e mysql_root_password=1 MYSQL

Docker run--name 153mysql-e mysql_root_password=1 MYSQL

4. Enter Docker Mutual Ping

Docker exec-it 153mysql Bin/bash

Docker exec-it 154mysql Bin/bash

Mutual Ping

Sometimes there's a case of redirect host, but wait a minute.

Docker container communication with OvS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.