summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_conntrack.txlate
blob: 0f44a957878e8c12520e693cc5b997277fcaf3b4 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
iptables-translate -t filter -A INPUT -m conntrack --ctstate NEW,RELATED -j ACCEPT
nft 'add rule ip filter INPUT ct state new,related counter accept'

ip6tables-translate -t filter -A INPUT -m conntrack ! --ctstate NEW,RELATED -j ACCEPT
nft 'add rule ip6 filter INPUT ct state ! new,related counter accept'

ip6tables-translate -t filter -A INPUT -m conntrack ! --ctstate NEW -j ACCEPT
nft 'add rule ip6 filter INPUT ct state ! new counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctproto UDP -j ACCEPT
nft 'add rule ip filter INPUT ct original protocol 17 counter accept'

iptables-translate -t filter -A INPUT -m conntrack ! --ctproto UDP -j ACCEPT
nft 'add rule ip filter INPUT ct original protocol != 17 counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctorigsrc 10.100.2.131 -j ACCEPT
nft 'add rule ip filter INPUT ct original saddr 10.100.2.131 counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctorigsrc 10.100.0.0/255.255.0.0 -j ACCEPT
nft 'add rule ip filter INPUT ct original saddr 10.100.0.0/16 counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctorigdst 10.100.2.131 -j ACCEPT
nft 'add rule ip filter INPUT ct original daddr 10.100.2.131 counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctreplsrc 10.100.2.131 -j ACCEPT
nft 'add rule ip filter INPUT ct reply saddr 10.100.2.131 counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctrepldst 10.100.2.131 -j ACCEPT
nft 'add rule ip filter INPUT ct reply daddr 10.100.2.131 counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctproto tcp --ctorigsrcport 443:444 -j ACCEPT
nft 'add rule ip filter INPUT ct original protocol 6 ct original proto-src 443-444 counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctstatus EXPECTED -j ACCEPT
nft 'add rule ip filter INPUT ct status expected counter accept'

iptables-translate -t filter -A INPUT -m conntrack ! --ctstatus CONFIRMED -j ACCEPT
nft 'add rule ip filter INPUT ct status ! confirmed counter accept'

iptables-translate -t filter -A INPUT -m conntrack ! --ctstatus CONFIRMED,ASSURED -j ACCEPT
nft 'add rule ip filter INPUT ct status ! assured,confirmed counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctstatus CONFIRMED,ASSURED -j ACCEPT
nft 'add rule ip filter INPUT ct status assured,confirmed counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctexpire 3 -j ACCEPT
nft 'add rule ip filter INPUT ct expiration 3 counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctdir ORIGINAL -j ACCEPT
nft 'add rule ip filter INPUT ct direction original counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctstate NEW --ctproto tcp --ctorigsrc 192.168.0.1 --ctorigdst 192.168.0.1 --ctreplsrc 192.168.0.1 --ctrepldst 192.168.0.1 --ctorigsrcport 12 --ctorigdstport 14 --ctreplsrcport 16 --ctrepldstport 18 --ctexpire 10 --ctstatus SEEN_REPLY --ctdir ORIGINAL -j ACCEPT
nft 'add rule ip filter INPUT ct direction original ct original protocol 6 ct state new ct status seen-reply ct expiration 10 ct original saddr 192.168.0.1 ct original daddr 192.168.0.1 ct reply saddr 192.168.0.1 ct reply daddr 192.168.0.1 ct original proto-src 12 ct original proto-dst 14 ct reply proto-src 16 ct reply proto-dst 18 counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctstate SNAT -j ACCEPT
nft 'add rule ip filter INPUT ct status snat counter accept'

iptables-translate -t filter -A INPUT -m conntrack --ctstate DNAT -j ACCEPT
nft 'add rule ip filter INPUT ct status dnat counter accept'