3 # Do IP mangling for checksum error issue after disable_dgaf=1
4 iptables -D POSTROUTING -t mangle -p udp --dport 68 -j CHECKSUM --checksum-fill
5 iptables -A POSTROUTING -t mangle -p udp --dport 68 -j CHECKSUM --checksum-fill
7 # block everything except ssh, icmp, http, and dhcp
9 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
12 iptables -A FORWARD -j ACCEPT -p icmp;
13 iptables -A INPUT -j ACCEPT -p icmp;
14 iptables -A OUTPUT -j ACCEPT -p icmp;
17 # Note: 192.168.1.198 is the address of the master Raspberry Pi.
18 # So, please adjust it to your own setup if needed.
19 #iptables -A INPUT -j ACCEPT -s 192.168.1.198 -d 192.168.1.1 -p tcp --dport ssh;
20 #iptables -A INPUT -j ACCEPT -s 192.168.1.198 -d 192.168.1.1 -p tcp --sport ssh;
21 #iptables -A INPUT -j ACCEPT -s 192.168.1.1 -d 192.168.1.198 -p tcp --dport ssh;
22 #iptables -A INPUT -j ACCEPT -s 192.168.1.1 -d 192.168.1.198 -p tcp --sport ssh;
23 #iptables -A OUTPUT -j ACCEPT -s 192.168.1.198 -d 192.168.1.1 -p tcp --dport ssh;
24 #iptables -A OUTPUT -j ACCEPT -s 192.168.1.198 -d 192.168.1.1 -p tcp --sport ssh;
25 #iptables -A OUTPUT -j ACCEPT -s 192.168.1.1 -d 192.168.1.198 -p tcp --dport ssh;
26 #iptables -A OUTPUT -j ACCEPT -s 192.168.1.1 -d 192.168.1.198 -p tcp --sport ssh;
27 iptables -A INPUT -j ACCEPT -p tcp --dport ssh;
28 iptables -A INPUT -j ACCEPT -p tcp --sport ssh;
29 iptables -A OUTPUT -j ACCEPT -p tcp --dport ssh;
30 iptables -A OUTPUT -j ACCEPT -p tcp --sport ssh;
32 iptables -A FORWARD -j ACCEPT -p tcp --dport ssh;
33 iptables -A FORWARD -j ACCEPT -p tcp --sport ssh;
35 # DNS UDP and TCP port 53
36 iptables -A INPUT -j ACCEPT -p tcp --dport domain
37 iptables -A INPUT -j ACCEPT -p tcp --sport domain
38 iptables -A OUTPUT -j ACCEPT -p tcp --dport domain
39 iptables -A OUTPUT -j ACCEPT -p tcp --sport domain
40 iptables -A INPUT -j ACCEPT -p udp --dport domain
41 iptables -A INPUT -j ACCEPT -p udp --sport domain
42 iptables -A OUTPUT -j ACCEPT -p udp --dport domain
43 iptables -A OUTPUT -j ACCEPT -p udp --sport domain
44 # BOOTP Client port 68
45 iptables -A INPUT -j ACCEPT -p udp --dport bootpc
46 iptables -A INPUT -j ACCEPT -p udp --sport bootpc;
47 # BOOTP Server port 67
48 iptables -A OUTPUT -j ACCEPT -p udp --dport bootps
49 iptables -A OUTPUT -j ACCEPT -p udp --sport bootps;
50 iptables -A FORWARD -j REJECT
51 iptables -A INPUT -j REJECT
52 iptables -A OUTPUT -j REJECT
55 #/usr/sbin/brctl hairpin br-wifi wlan0 on