mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
firewall: Allow WG traffic when the firewall is in permissive mode
commit d6868ae94c63d0f708985e6bb6604a4bd40cf1a8
Author: Michael Tremer <michael.tremer@ipfire.org>
Date: Fri Sep 6 18:20:46 2024 +0200
firewall: Allow WG traffic when the firewall is in permissive mode
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
@@ -54,6 +54,7 @@ esac
|
||||
|
||||
HAVE_IPSEC="true"
|
||||
HAVE_OPENVPN="true"
|
||||
HAVE_WG="true"
|
||||
|
||||
# INPUT
|
||||
|
||||
@@ -97,6 +98,14 @@ case "${HAVE_OPENVPN},${POLICY}" in
|
||||
;;
|
||||
esac
|
||||
|
||||
# WireGuard INPUT
|
||||
case "${HAVE_WG},${POLICY}" in
|
||||
true,MODE1) ;;
|
||||
true,*)
|
||||
iptables -A POLICYIN -i wg+ -j ACCEPT
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${FWPOLICY2}" in
|
||||
REJECT)
|
||||
if [ "${DROPINPUT}" = "on" ]; then
|
||||
@@ -149,6 +158,9 @@ case "${POLICY}" in
|
||||
# Grant access for OpenVPN connections
|
||||
iptables -A POLICYFWD -i tun+ -j ACCEPT
|
||||
|
||||
# Grant access for WireGuard
|
||||
iptables -A POLICYFWD -i wg+ -j ACCEPT
|
||||
|
||||
if [ -n "${IFACE}" ]; then
|
||||
if [ "${HAVE_BLUE}" = "true" ] && [ -n "${BLUE_DEV}" ]; then
|
||||
iptables -A POLICYFWD -i "${BLUE_DEV}" -s "${BLUE_NETADDRESS}/${BLUE_NETMASK}" -o "${IFACE}" -j ACCEPT
|
||||
|
||||
Reference in New Issue
Block a user