Skip to content

Commit 8697d26

Browse files
Fix: Invalid priority expression value with -m nftables #154
1 parent 6f46b60 commit 8697d26

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

natter.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,25 +686,29 @@ def _nftables_init(self):
686686
return
687687
except subprocess.CalledProcessError:
688688
pass
689+
690+
# Priority values:
691+
# dstnat (-100) - 5: -105
692+
# srcnat ( 100) - 5: 95
689693
initial_rules = (
690694
'''
691695
table ip natter {
692696
chain natter_dnat { }
693697
chain natter_snat { }
694698
chain prerouting {
695-
type nat hook prerouting priority dstnat-5; policy accept;
699+
type nat hook prerouting priority -105; policy accept;
696700
jump natter_dnat;
697701
}
698702
chain output {
699-
type nat hook output priority dstnat-5; policy accept;
703+
type nat hook output priority -105; policy accept;
700704
jump natter_dnat;
701705
}
702706
chain postrouting {
703-
type nat hook postrouting priority srcnat-5; policy accept;
707+
type nat hook postrouting priority 95; policy accept;
704708
jump natter_snat;
705709
}
706710
chain input {
707-
type nat hook input priority srcnat-5; policy accept;
711+
type nat hook input priority 95; policy accept;
708712
jump natter_snat;
709713
}
710714
}

0 commit comments

Comments
 (0)