firewall: Add WireGuard RW to the UI

commit 5a1c02df8973b3acc5c3101a94e86fe6df4b43b6
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Sep 12 19:39:26 2024 +0200

    firewall: Add WireGuard RW to the UI

    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
Vincent Li
2025-06-27 22:26:40 -07:00
parent f4c22fcd54
commit 8cb4ea1e31
4 changed files with 46 additions and 5 deletions

View File

@@ -1965,6 +1965,13 @@ sub getcolor
}
}
# WireGuard Roadwarrior
if ($Wireguard::settings{'CLIENT_POOL'}) {
if (&Network::ip_address_in_network($sip, $Wireguard::settings{'CLIENT_POOL'})) {
return "<font style='color: $Header::colourwg;'>$c</font>"
}
}
#Check if IP is part of OpenVPN dynamic subnet
my ($a,$b) = split("/",$ovpnsettings{'DOVPN_SUBNET'});
if (&General::IpInSubnet($sip,$a,$b)){
@@ -3036,6 +3043,9 @@ sub getipforgroup
&General::readhash("${General::swroot}/ethernet/settings",\%hash);
return $hash{'ORANGE_NETADDRESS'}."/".&Network::convert_netmask2prefix($hash{'ORANGE_NETMASK'}) || $hash{'ORANGE_NETMASK'};
}
if ($name eq "WGRW") {
return $Wireguard::settings{'CLIENT_POOL'};
}
if ($name eq 'ALL'){
return "0.0.0.0/0";
}