summaryrefslogtreecommitdiff
path: root/hosts/vidhar/ruleset.nft
blob: a996d914bb5a9a3dd3b0b79cc0186d209edeb7e2 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
table inet filter {
  chain reject-rl {
    limit rate over 1024 / second burst 1024 packets counter drop
  }


  chain forward {
    type filter hook forward priority filter
    policy drop


    iifname eno1 oifname dsl counter accept
    iifname dsl oifname eno1 ct state {established, related} counter accept

    meta l4proto ipv6-icmp counter accept
    meta l4proto icmp counter accept
    meta l4proto igmp counter accept


    log prefix "reject forward: " counter
    jump reject-rl
    meta l4proto tcp counter reject with tcp reset
    counter reject
  }

  chain input {
    type filter hook input priority filter
    policy drop


    iifname lo counter accept
    iif != lo ip daddr 127.0.0.1/8 counter reject
    iif != lo ip6 daddr ::1/128 counter reject

    ct state {established, related} counter accept

    tcp dport 22 counter accept
    ip version 4 udp dport 51820 counter accept
    udp dport 60000-61000 counter accept

    iifname "dsl" ip6 version 6 udp dport 546 udp sport 547 counter accept

    meta l4proto ipv6-icmp counter accept
    meta l4proto icmp counter accept
    meta l4proto igmp counter accept


    log prefix "reject input: " counter
    jump reject-rl
    meta l4proto tcp counter reject with tcp reset
    counter reject
  }

  chain output {
    type filter hook output priority filter
    policy accept

    counter
  }
}

table ip nat {
  chain postrouting {
    type nat hook postrouting priority srcnat
    policy accept

    oifname dsl counter masquerade

    counter
  }
}

table inet mangle {
  chain postrouting {
    type filter hook postrouting priority mangle
    policy accept

    oifname dsl meta l4proto tcp tcp flags & (syn|rst) == syn counter tcp option maxseg size set rt mtu

    counter
  }
}