Skip to content

Commit a3501cd

Browse files
thaJeztahrobmry
andauthored
add another iptables rule to allow dns queries from container (#21708)
## Description With only mentioned rule, DNS queries from containers won't work. ## Reviews - [X] Technical review - [X] Editorial review - [ ] Product review Signed-off-by: Sebastiaan van Stijn <[email protected]> Co-authored-by: Rob Murray <[email protected]>
2 parents fe9389f + 043dabd commit a3501cd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
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)