Docker bridging network schematic sharing and pipework simple configuration

Source: Internet
Author: User
Tags docker run

1.docker One kind of bridge network schematic diagram

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/85/8B/wKioL1eoMpKQn9yIAABuACV_d8k586.png "title=" Docker bridging. png "alt=" Wkiol1eompkqn9yiaabuacv_d8k586.png "/>

2. Configure the Docker container network and host host network in the same network segment using the pipework third-party open Source Network Configuration Tool

#1). Installing the Pipework Open Source Network Configuration Tool

git clone https://github.com/jpetazzo/pipework

CP ~/pipework/pipework/usr/local/bin/

#第2步和第3步和第4步放入脚本一起执行, otherwise there will be a phenomenon of broken network connection

#2). Bind virtual Bridge and physical network card, implement physical network card and virtual network card public IP

Brctl ADDBR Br0

Brctl addif br0 eth0

#3). Configure the physical network card address as the management address of the virtual bridge, because the container does not communicate directly with the physical network card

IP addr del 10.0.0.10/24 dev eth0

Ifconfig br0 10.0.0.10/24 up

#4). Delete the previous route, add a new route, exit to the BR0 virtual network card, gateway to the physical switch

IP route del default

Route add default GW 10.0.0.254

#5). Start a container without a network

Docker run-itd--name Test--net=none Centos/bin/bash

#6). Configure the address and gateway for a container that already exists named Test (if the CENTOS6 upgrade kernel installs Docker This step may be an error, need to upgrade Iproute)

Pipework br0 test 10.0.0.100/[email protected]

This article from "Monotonous ~ Lifetime No" blog, please be sure to keep this source http://chenshifei.blog.51cto.com/11883413/1835666

Docker bridging network schematic sharing and pipework simple configuration

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.