nftables
This commit is contained in:
parent
2c44b51a7e
commit
6d55fb5efe
1 changed files with 43 additions and 0 deletions
43
rt-mep/nftables.conf
Normal file
43
rt-mep/nftables.conf
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
#!/usr/sbin/nft -f
|
||||||
|
# /etc/nftables.conf
|
||||||
|
|
||||||
|
flush ruleset
|
||||||
|
|
||||||
|
# Define variables for interfaces and IP addresses
|
||||||
|
define LAN = eth1
|
||||||
|
define WAN = eth0
|
||||||
|
define LAN_SUBNET = 10.100.2.0/24
|
||||||
|
define WAN_IP = 45.139.163.92
|
||||||
|
|
||||||
|
|
||||||
|
table inet nat {
|
||||||
|
chain prerouting {
|
||||||
|
type nat hook prerouting priority 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
chain postrouting {
|
||||||
|
type nat hook postrouting priority 100;
|
||||||
|
oifname $WAN masquerade;
|
||||||
|
}
|
||||||
|
|
||||||
|
chain output {
|
||||||
|
type nat hook output priority -100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
table inet filter {
|
||||||
|
chain input {
|
||||||
|
type filter hook input priority 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
chain forward {
|
||||||
|
type filter hook forward priority 0;
|
||||||
|
|
||||||
|
# Forward LAN traffic to WAN
|
||||||
|
iifname $LAN ip saddr $LAN_SUBNET oifname $WAN accept;
|
||||||
|
}
|
||||||
|
|
||||||
|
chain output {
|
||||||
|
type filter hook output priority 0;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue