ip_forward

iptables

docker3网络 容器与外网连接

----------------------------------------------------------------------------------------------------------------------------------------------

容器要想访问外部网络,需要本地系统的转发支持

  

cat /etc/sysctl.conf
net.ipv4.ip_forward = 1

如果再启动Docker服务的时候设定 --ip-forward=true,Docker就会自动设置系统的ip_forward值为1

 

---------------------------------------------------------------------------------------------------------------------------------

容器允许外部访问,可以在docker run 的时候指定-p 或参数-P来启用

iptables -t filter -nL  
(filter表)
iptables -t nat -nL

(nat表)

 

 

 

 

 

 

相关文章:

  • 2021-06-16
  • 2021-12-07
  • 2022-12-23
  • 2021-08-24
  • 2021-04-01
  • 2021-06-18
  • 2021-06-04
猜你喜欢
  • 2021-12-25
  • 2021-10-12
  • 2022-12-23
  • 2022-12-23
  • 2021-03-31
  • 2021-08-09
  • 2021-08-24
相关资源
相似解决方案