hans

hans

【Docker】修改doker0默认ip地址


Docker 默认地址是 172.17.0.1

改一下方便本地机和服务器上 docker 远程访问

sudo service docker stop
sudo ip link set dev docker0 down
sudo brctl delbr docker0  # sudo apt-get install bridge-util
sudo iptables -t nat -F POSTROUTING

sudo brctl addbr docker0 
sudo ip addr add xxx.xxx.xxx.xxx/xx dev docker0
sudo ip link set dev docker0 up

vi /etc/docker/daemon.json
{
    ...    
    "bip": "xxx.xxx.xxx.xxx/xxx",
    ...
}

sudo service docker start

以上内容转自 https://www.antergone.com/44.html

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.