标签:
环境说明:
1.系统:centos7
2.docker:Docker version 1.3.2
配置过程:
1.通过网桥的方式实现:
cat /etc/sysconfig/network-scripts/ifcfg-bond0
BOOTPROTO=none
BRIDGE=br0
DEVICE=bond0
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Bond
USERCTL=no
设置网桥
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
启动容器:
docker run --rm -t -i --net=none --name=test centos:latest /bin/bash
为容器指定ip(下载pipework,通过pipework实现)
pipework br0 $cid xx.xx.xx.xx
标签:
原文地址:http://www.cnblogs.com/276815076/p/4204122.html