feat: add wireguard support
This commit is contained in:
parent
a4f00a90ab
commit
1781bb5939
2 changed files with 11 additions and 2 deletions
|
|
@ -12,3 +12,6 @@ static_routes: []
|
||||||
|
|
||||||
# incoming firewall rules
|
# incoming firewall rules
|
||||||
incoming_firewall_rules: []
|
incoming_firewall_rules: []
|
||||||
|
|
||||||
|
# wireguard
|
||||||
|
wireguard_enable: true
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ table inet filter {
|
||||||
# Allow loopback
|
# Allow loopback
|
||||||
iif lo accept
|
iif lo accept
|
||||||
|
|
||||||
# Allow ICMP
|
# Allow ICMP
|
||||||
ip protocol icmp accept
|
ip protocol icmp accept
|
||||||
ip6 nexthdr ipv6-icmp accept
|
ip6 nexthdr ipv6-icmp accept
|
||||||
|
|
||||||
|
|
@ -29,6 +29,12 @@ table inet filter {
|
||||||
# Allow established/related
|
# Allow established/related
|
||||||
ct state established,related accept
|
ct state established,related accept
|
||||||
|
|
||||||
|
{% if wireguard_enabled %}
|
||||||
|
# Allow WireGuard traffic
|
||||||
|
iifname "wt*" accept
|
||||||
|
oifname "wt*" accept
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# Allow forwarding from LAN to anywhere
|
# Allow forwarding from LAN to anywhere
|
||||||
iif {{ lan_interface }} oif {{ wan_interface }} accept
|
iif {{ lan_interface }} oif {{ wan_interface }} accept
|
||||||
{% for forward in nat_port_forwards %}
|
{% for forward in nat_port_forwards %}
|
||||||
|
|
@ -47,7 +53,7 @@ table ip nat {
|
||||||
type nat hook postrouting priority 100; policy accept;
|
type nat hook postrouting priority 100; policy accept;
|
||||||
|
|
||||||
# NAT masquerade from LAN to WAN
|
# NAT masquerade from LAN to WAN
|
||||||
oif {{ wan_interface }} masquerade
|
iif {{ lan_interface }} oif {{ wan_interface }} masquerade
|
||||||
}
|
}
|
||||||
|
|
||||||
chain prerouting {
|
chain prerouting {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue