Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker 如何在firewalld中进行SNAT_Docker_Iptables_Firewalld - Fatal编程技术网

Docker 如何在firewalld中进行SNAT

Docker 如何在firewalld中进行SNAT,docker,iptables,firewalld,Docker,Iptables,Firewalld,我正试着做与之相当的事情 iptables -t nat -I POSTROUTING -p all -s 172.17.0.0/16 -j SNAT --to-source 5.6.7.8 在firewalld中,允许docker绑定到我的NIC上的辅助IP 我能做的最接近的 firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -d 172.17.0.0/16 -p all -j SNAT --to 5.6.

我正试着做与之相当的事情

iptables -t nat -I POSTROUTING -p all -s 172.17.0.0/16 -j SNAT --to-source 5.6.7.8
在firewalld中,允许docker绑定到我的NIC上的辅助IP

我能做的最接近的

firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -d 172.17.0.0/16 -p all -j SNAT --to 5.6.7.8
我在一篇文章中修改了这篇文章

$ firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -d 10.x.x.x -p udp --dport 162 -j SNAT --to 10.x.x.204
作为一个稍微不同的问题的解决方案,但不确定。我说得对吗