安装bridge-utils
yum install -y bridge-utils
或者
sudo rpm -ivh /home/zyyt/soft/docker_ins/bridge-utils-1.5-9.el7.x86_64.rpm
方法1(可能不成功)
sudo systemctl stop docker
sudo ip link set dev docker0 down
sudo brctl delbr docker0
sudo brctl addbr docker0
sudo ip addr add 172.17.xxx.1/24 dev docker0 (XXX:主机ip最后一段)
sudo ip link set dev docker0 up
sudo systemctl start docker
ip addr
方法2
sudo chmod o+w /etc/systemd/system/docker.service
vi /etc/systemd/system/docker.service
找到 ExecStart=/usr/bin/dockerd XXX:主机ip最后一段
ExecStart=/usr/bin/dockerd --bip 172.17.XXX.1/24
sudo systemctl daemon-reload
sudo systemctl stop docker
sudo systemctl start docker
ip addr
docker24版本在
vi /lib/systemd/system/docker.service