尝试了网上各种方法还是不行,请大家帮忙看看是哪里的原因
docker0 8000.8aa94e25aa49 no vethdd1f0f9
docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 8a:a9:4e:25:aa:49 brd ff:ff:ff:ff:ff:ff
inet 172.17.10.1/24 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::18c9:95ff:fe72:fa1e/64 scope link
valid_lft forever preferred_lft forever
{
"registry-mirrors": ["https://3laho3y3.mirror.aliyuncs.com"],
"graph": "/home/docker/lib",
"bip":"172.17.10.1/24",
"dns":["114.114.114.114"]
}
sysctl -p
vm.nr_hugepages = 1208
vm.nr_hugepages = 1208
vm.nr_hugepages = 1208
net.ipv4.ip_forward = 1
bash-5.1# ip route
default via 172.17.10.1 dev eth0
172.17.10.0/24 dev eth0 scope link src 172.17.10.2
bash-5.1# cat /etc/resolv.conf
nameserver 114.114.114.114
bash-5.1# ping 114.114.114.114
PING 114.114.114.114 (114.114.114.114): 56 data bytes
^C
--- 114.114.114.114 ping statistics ---
26 packets transmitted, 0 packets received, 100% packet loss
bash-5.1# curl baidu.com
curl: (6) Could not resolve host: baidu.com
重启网络、docker 服务、重建 docker 网络都不行,实在不知道是哪里问题-_-
1
quadrapop OP 主机 docker 网络:
docker network ls NETWORK ID NAME DRIVER SCOPE 3154d2c4d83a bridge bridge local f97d9dbaf6d4 host host local ba95ad441d74 none null local |
2
leonshaw 2022-10-15 18:10:43 +08:00
iptables?
|
5
quadrapop OP @leonshaw 按照网上的办法在 docker 内禁用了 iptables 也不行,来来回回重载网络,重启 docker ,删除容器,重新启动容器,不知道怎么回事,配置还是和原来一样,自己好了,里面可以上外网了-_-
|
6
RatioPattern 2022-10-15 21:23:03 +08:00
以前 centos8 还得配个
``` firewall-cmd --zone=public --add-masquerade --permanent firewall-cmd reload service docker restart ``` |