Docker containers communicate with each other on different machines

Source: Internet
Author: User

Environment Description:

1. System: CENTOS7

2.docker:docker version 1.3.2

Configuration process:

1. By means of a bridge:

Cat/etc/sysconfig/network-scripts/ifcfg-bond0
Bootproto=none
Bridge=br0
Device=bond0
Nm_controlled=no
Onboot=yes
Type=bond
Userctl=no

Set up a network bridge

Cat/etc/sysconfig/network-scripts/ifcfg-br0
Bootproto=static
Device=br0
ipaddr=xx.xx.xx.xx
netmask=255.255.0.0
Nm_controlled=no
Onboot=yes
Slave=bond0
Userctl=no
Type=bridge

To start the container:

Docker run--rm-t-i--net=none--name=test Centos:latest/bin/bash

Specify IP for container (download pipework, implemented via pipework)

Pipework Br0 $cid xx.xx.xx.xx

Docker Chinese starter Book

Docker containers communicate with each other on different machines

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.