summaryrefslogtreecommitdiffstats
path: root/etc/inc/filter.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/filter.inc')
-rw-r--r--etc/inc/filter.inc17
1 files changed, 17 insertions, 0 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 817155f..f06d6ec 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1003,6 +1003,23 @@ function filter_nat_rules_generate() {
$tonathosts .= "{$FilterIflist['l2tp']['sa']}/{$l2tp_subnet} ";
}
}
+ /* add openvpn interfaces */
+ if(is_array($config['openvpn']['openvpn-server'])) {
+ foreach ($config['openvpn']['openvpn-server'] as $ovpnsrv) {
+ if (!empty($ovpnsrv['tunnel_network'])) {
+ $numberofnathosts++;
+ $tonathosts .= "{$ovpnsrv['tunnel_network']} ";
+ }
+ }
+ }
+ if(is_array($config['openvpn']['openvpn-client'])) {
+ foreach ($config['openvpn']['openvpn-client'] as $ovpnsrv) {
+ if (!empty($ovpnsrv['tunnel_network'])) {
+ $numberofnathosts++;
+ $tonathosts .= "{$ovpnsrv['tunnel_network']} ";
+ }
+ }
+ }
$natrules .= "\n# Subnets to NAT \n";
if($numberofnathosts > 4) {
$natrules .= "table <tonatsubnets> { {$tonathosts} }\n";
OpenPOWER on IntegriCloud