Skip to content

Commit 043dabd

Browse files
fliesplrobmry
authored andcommitted
add another iptables rule to allow dns queries from container
Co-authored-by: Rob Murray <rob.murray@docker.com> Co-authored-by: fliespl <a.rzadkowolski@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent aec91a4 commit 043dabd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

content/manuals/engine/network/packet-filtering-firewalls.md

+11
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@ the source and destination. For instance, if the Docker host has addresses
126126
`2001:db8:1111::2` and `2001:db8:2222::2`, you can make rules specific to
127127
`2001:db8:1111::2` and leave `2001:db8:2222::2` open.
128128

129+
You may need to allow responses from servers outside the permitted external address
130+
ranges. For example, containers may send DNS or HTTP requests to hosts that are
131+
not allowed to access the container's services. The following rule accepts any
132+
incoming or outgoing packet belonging to a flow that has already been accepted
133+
by other rules. It must be placed before `DROP` rules that restrict access from
134+
external address ranges.
135+
136+
```console
137+
$ iptables -I DOCKER-USER -m state --state RELATED,ESTABLISHED -j ACCEPT
138+
```
139+
129140
`iptables` is complicated. There is a lot more information at [Netfilter.org HOWTO](https://www.netfilter.org/documentation/HOWTO/NAT-HOWTO.html).
130141

131142
### Direct routing

0 commit comments

Comments
 (0)