容器不能联网
使用docker默认的桥接模式(bridge)无法对外访问网络,主要是转发NAT FWD导致的
linux
sysctl net.ipv4.ip_forward
查看转发情况,正常应该是 1
sysctl -w net.ipv4.ip_forward=1
sysctl -p
openwrt
单网口的这样配置,直接改 lan为dhcp客户端
,关闭dhcp server
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
docker里面配置,在wan口允许访问:
如果没有上述设置,那么改这里
还搞不定?
佳佳asr3000: 为啥要桥模式, 直接用主机网络 --net=host
最后一次更新于2024-11-10