Docker Network 配置,自定义bridge网络 1.停止服务 service docker stop 2.关掉docker0 ifconfig docker0 down 3.删除docker brctl delbr docker0 4.增加网桥br500 yum install bridge-utils 2, 网络配置 [root@AthController53 network-scripts]# cat ifcfg-br500 DEVICE=br500 ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=static TYPE=Bridge IPADDR=10.14.23.1 NETMASK=255.255.255.0 [root@AthController53 network-scripts]# cat ifcfg-p3p2 DEVICE=p3p2 ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=static BRIDGE=br500 3,重启网卡 service netowrk restart 5, 查看网络信息 ip addr show bridge0 查看路由信息:route -n 查看网桥信息: brctl show 6. 加入变量: #Centos 6.5 配置,系统版本不一样,配置也不一样 vim /etc/sysconfig/docker other_args="-b=br500" 7, 启动docker服务 service docker start 8. 启动docker容器 service docker restart 9, 日志相关信息 2014/10/08 10:31:55 WARNING: You are running linux kernel version 2.6.32-431.29.2.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.8.0. 2014/10/08 10:31:55 docker daemon: 1.1.2 d84a070/1.1.2; execdriver: native; graphdriver: [11c90a98] +job serveapi(unix:///var/run/docker.sock) [11c90a98] +job initserver() [11c90a98.initserver()] Creating server 2014/10/08 10:31:55 Listening for HTTP on unix (/var/run/docker.sock) [11c90a98] +job init_networkdriver() [11c90a98.init_networkdriver()] bridge not found: bridge500 net: no such interface [11c90a98] -job init_networkdriver() = ERR (1) net: no such interface [11c90a98] -job initserver() = ERR (1) 2014/10/08 10:31:55 net: no such interface \n2014年 10月 08日 星期三 10:52:55 CST\n 2014/10/08 10:52:55 WARNING: You are running linux kernel version 2.6.32-431.29.2.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.8.0. 2014/10/08 10:52:55 docker daemon: 1.1.2 d84a070/1.1.2; execdriver: native; graphdriver: [dabc6783] +job serveapi(unix:///var/run/docker.sock) [dabc6783] +job initserver() [dabc6783.initserver()] Creating server 2014/10/08 10:52:55 Listening for HTTP on unix (/var/run/docker.sock) [dabc6783] +job init_networkdriver() [dabc6783] -job init_networkdriver() = OK (0) Loading containers: : done. [dabc6783.initserver()] Creating pidfile [dabc6783.initserver()] Setting up signal traps [dabc6783] -job initserver() = OK (0) [dabc6783] +job acceptconnections() [dabc6783] -job acceptconnections() = OK (0) 2014/10/08 10:53:17 GET /v1.13/images/json [dabc6783] +job images() [dabc6783] -job images() = OK (0)
本文出自 “欢迎评论,欢迎点赞” 博客,请务必保留此出处http://swq499809608.blog.51cto.com/797714/1561155
原文地址:http://swq499809608.blog.51cto.com/797714/1561155