File: libxt_tcp.txlate

package info (click to toggle)
iptables 1.8.2-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,220 kB
  • sloc: ansic: 55,460; sh: 5,794; makefile: 208; yacc: 187; python: 83; lex: 54
file content (26 lines) | stat: -rw-r--r-- 1,233 bytes parent folder | download | duplicates (3)
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
iptables-translate -A INPUT -p tcp -i eth0 --sport 53 -j ACCEPT
nft add rule ip filter INPUT iifname "eth0" tcp sport 53 counter accept

iptables-translate -A OUTPUT -p tcp -o eth0 --dport 53:66 -j DROP
nft add rule ip filter OUTPUT oifname "eth0" tcp dport 53-66 counter drop

iptables-translate -I OUTPUT -p tcp -d 8.8.8.8 -j ACCEPT
nft insert rule ip filter OUTPUT ip protocol tcp ip daddr 8.8.8.8 counter accept

iptables-translate -I OUTPUT -p tcp --dport 1020:1023 --sport 53 -j ACCEPT
nft insert rule ip filter OUTPUT tcp sport 53 tcp dport 1020-1023 counter accept

iptables -A INPUT -p tcp --tcp-flags ACK,FIN FIN -j DROP
nft add rule ip filter INPUT tcp flags & fin|ack == fin counter drop

iptables-translate -A INPUT -p tcp --syn -j ACCEPT
nft add rule ip filter INPUT tcp flags & (fin|syn|rst|ack) == syn counter accept

iptables-translate -A INPUT -p tcp --syn --dport 80 -j ACCEPT
nft add rule ip filter INPUT tcp dport 80 tcp flags & (fin|syn|rst|ack) == syn counter accept

iptables-translate -A INPUT -f -p tcp
nft add rule ip filter INPUT ip frag-off & 0x1fff != 0 ip protocol tcp counter

iptables-translate -A INPUT ! -f -p tcp --dport 22
nft add rule ip filter INPUT ip frag-off & 0x1fff 0 tcp dport 22 counter