initial source tree import
[tails-test.git] / config / chroot_local-includes / etc / firewall.conf
blobf8c9e115033658b9f6512f89d33d15691a4411b9
1 *filter
2 :INPUT ACCEPT [0:0]
3 :FORWARD ACCEPT [0:0]
4 :OUTPUT ACCEPT [0:0]
6 # Established connections are accepted.
7 [0:0] -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
9 # Local network connections should not fo through Tor.
10 [0:0] -A OUTPUT -d 192.168.0.0/255.255.0.0 -j ACCEPT
11 [0:0] -A OUTPUT -d 10.0.0.0/255.0.0.0 -j ACCEPT
12 [0:0] -A OUTPUT -d 172.16.0.0/255.240.0.0 -j ACCEPT
13 [0:0] -A OUTPUT -d 127.0.0.0/255.0.0.0 -j ACCEPT
15 # Tor is allowed to do anything it wants to, everything else is dropped.
16 [0:0] -A OUTPUT -m owner --uid-owner debian-tor -j ACCEPT
17 [0:0] -A OUTPUT -j REJECT --reject-with icmp-port-unreachable
19 COMMIT
21 *nat
22 :PREROUTING ACCEPT [0:0]
23 :POSTROUTING ACCEPT [0:0]
24 :OUTPUT ACCEPT [0:0]
26 # Local network connections should not fo through Tor. Note that we
27 # exclude the VirtualAddrNetwork used for .onion:s here.
28 [0:0] -A OUTPUT -d 192.168.0.0/255.255.0.0 -j RETURN
29 [0:0] -A OUTPUT -d 10.0.0.0/255.0.0.0 -j RETURN
30 [0:0] -A OUTPUT -d 172.16.0.0/255.240.0.0 -j RETURN
31 [0:0] -A OUTPUT -d 127.0.0.0/255.128.0.0 -j RETURN
32 [0:0] -A OUTPUT -d 127.128.0.0/255.192.0.0 -j RETURN
34 # Tor is allowed to do anything it wants to.
35 [0:0] -A OUTPUT -m owner --uid-owner debian-tor -j RETURN
37 # .onion mapped addresses redirection to Tor.
38 [0:0] -A OUTPUT -d 127.192.0.0/255.192.0.0 -p tcp -m tcp -j DNAT --to-destination 127.0.0.1:9040
40 # Redirect all remaining TCP traffic to Tor.
41 [0:0] -A OUTPUT -o ! lo -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j DNAT --to-destination 127.0.0.1:9040
43 COMMIT