aboutsummaryrefslogtreecommitdiffstats
path: root/etc/net/nolocal.net
blob: a37b1859996aab9499dc08f96a287444f05666fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]

###################################################################
# Client filter rejecting local network traffic, with the exception of
# DNS traffic
#
# Usage:
#     firejail --net=eth0 --netfilter=/etc/firejail/nolocal.net firefox
#
###################################################################

#allow all loopback traffic
-A INPUT -i lo -j ACCEPT

# no incoming connections
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

# allow ping etc.
-A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
-A INPUT -p icmp --icmp-type echo-reply -j ACCEPT

# accept dns requests going out to a server on the local network
-A OUTPUT -p udp --dport 53 -j ACCEPT

# drop all local network traffic
-A OUTPUT -d 192.168.0.0/16 -j DROP
-A OUTPUT -d 10.0.0.0/8 -j DROP
-A OUTPUT -d 172.16.0.0/12 -j DROP

# drop multicast traffic
-A OUTPUT -d 224.0.0.0/4 -j DROP
COMMIT