1. 停止docker服务
systemctl stop docker.service
2. 删除docker0 网卡
brctl delbr docker0
3. 新建一块网卡br0
cd /etc/sysconfig/network-scripts/
vim ifcfg-br0
-
DEVICE='br0'
-
TYPE=Bridge
-
BOOTPROTO=static
-
ONBOOT=yes
-
IPADDR=10.1.1.1
-
PREFIX=24
4. 重启网络
systemctl restart network.service
5. 查看网络状态
ip a
6.修改docker启动文件
vim /lib/systemd/system/docker.service
ExecStart=/usr/bin/docker
-b=br0 daemon -H fd://
7. 启动容器,查看容器网络桥接状态
brctl show
阅读(1767) | 评论(0) | 转发(0) |