feat: change gateway forward chain policy to accept and add explicit drop rule for WireGuard interface
Change nftables forward chain default policy from drop to accept. Add rule to accept all traffic not originating from WireGuard interface. Add explicit drop rule at end of chain for remaining WireGuard interface traffic to maintain security while allowing non-VPN traffic to flow freely.
This commit is contained in:
@@ -107,8 +107,9 @@ EOF
|
|||||||
echo "table inet nexavpn {"
|
echo "table inet nexavpn {"
|
||||||
echo " chain forward {"
|
echo " chain forward {"
|
||||||
echo " type filter hook forward priority 0;"
|
echo " type filter hook forward priority 0;"
|
||||||
echo " policy drop;"
|
echo " policy accept;"
|
||||||
echo " ct state established,related accept"
|
echo " ct state established,related accept"
|
||||||
|
echo " iifname != \"${IFACE}\" accept"
|
||||||
echo " iifname \"${IFACE}\" ip saddr ${NETWORK_CIDR} oifname \"${UPLINK_IFACE}\" accept"
|
echo " iifname \"${IFACE}\" ip saddr ${NETWORK_CIDR} oifname \"${UPLINK_IFACE}\" accept"
|
||||||
|
|
||||||
jq -c '.peers[]?' "${STATE_JSON}" | while read -r peer; do
|
jq -c '.peers[]?' "${STATE_JSON}" | while read -r peer; do
|
||||||
@@ -122,6 +123,8 @@ EOF
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo " iifname \"${IFACE}\" drop"
|
||||||
|
|
||||||
echo " }"
|
echo " }"
|
||||||
if [ "${ENABLE_MASQUERADE}" = "true" ]; then
|
if [ "${ENABLE_MASQUERADE}" = "true" ]; then
|
||||||
echo " chain postrouting {"
|
echo " chain postrouting {"
|
||||||
|
|||||||
Reference in New Issue
Block a user