-
Notifications
You must be signed in to change notification settings - Fork 2
/
rules.v4
38 lines (29 loc) · 1.11 KB
/
rules.v4
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
37
38
*raw
-A PREROUTING -j NOTRACK
-A OUTPUT -j NOTRACK
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
## Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
## allow incoming SSH, port 22
-A INPUT -p tcp --dport 22 -j ACCEPT
## DirPort, ORPort (optional: Webserver)
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
## Allow several ICMP types
## http://www.oregontechsupport.com/articles/icmp.txt
-A INPUT -p icmp -m icmp --icmp-type host-unreachable -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type port-unreachable -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type fragmentation-needed -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type source-quench -j ACCEPT
-A INPUT -p icmp --icmp-type echo-request -m limit --limit 2/s -j ACCEPT
-A INPUT -p icmp --icmp-type echo-request -j DROP
## to log denied packets uncomment this line
#-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
## drop non-established TCP
-A INPUT -p tcp --syn -j DROP
## allows all udp in, but avoids conntrack
COMMIT