(ubuntu ufw)My firewall is blocking network connections from the docker container to outside
2021-07-09 06:05
标签:isa ima document let ext solution xpl rom docker0 Maybe this is due to the current version, but the current answer doesn‘t work on my system (Docker 0.7.2 with base Ubuntu image). The solution is explained here in the official Docker documentation. For the lazy ones: edit /etc/default/ufw to change DEFAULT_FORWARD_POLICY‘s value to "ACCEPT", This ensures ufw forward your traffic to the Docker‘s bridged network (as of my current understanding of these things...). ufw allow in on docker0 Edit /etc/ufw/before.rules as follows: In the *filter section, after the first block of required lines, add: # docker rules to enable external network access from the container At the end of the file, after the line that says COMMIT, add the following section: *nat After saving the file, restart ufw with sudo ufw disable && sudo ufw enable (ubuntu ufw)My firewall is blocking network connections from the docker container to outside 标签:isa ima document let ext solution xpl rom docker0 原文地址:http://www.cnblogs.com/SZLLQ2000/p/7094274.html
reload with [sudo] ufw reload.
This fixed it for me:
# forward traffic accross the bridge
-A ufw-before-forward -i docker0 -j ACCEPT
-A ufw-before-forward -i testbr0 -j ACCEPT
-A ufw-before-forward -m state --state RELATED,ESTABLISHED -j ACCEPT
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 172.16.42.0/8 -o eth0 -j MASQUERADE
# don‘t delete the ‘COMMIT‘ line or these rules won‘t be processed
COMMIT
上一篇:requireJS文件夹
文章标题:(ubuntu ufw)My firewall is blocking network connections from the docker container to outside
文章链接:http://soscw.com/index.php/essay/102650.html