1、确认 修改前 docker网段
root@kfk12 \~\]# ifconfig docker0  ****2、修改docker配置**** ****设置网段**** \[root@kfk12 \~\]# cat \> /etc/docker/daemon.json \<\< EOF { "registry-mirrors": \[ "https://vh3bm52y.mirror.aliyuncs.com", "https://registry.cn-hangzhou.aliyuncs.com" \], "bip": "192.168.10.1/24", "log-level": "warn" } EOF ****3、重启docker服务**** \[root@kfk12 \~\]# systemctl daemon-reload \&\& systemctl restart docker ****4、查看最新**** ****网络**** ****配置**** \[root@kfk12 \~\]# ifconfig docker0  ****5、查看**** ****容器网络**** ****配置**** \[root@kfk12 \~\]# docker ps #确认运行的容器 \[root@kfk12 \~\]# docker inspect -f "{{ .NetworkSettings.IPAddress }}" n1 #查看容器IP 