summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2010-03-09 19:07:52 +0000
committerErmal Luçi <eri@pfsense.org>2010-03-09 19:07:52 +0000
commit101ce09aee348471171d7d4c948ea1f01ddb98ad (patch)
tree7eede5729d3b3e07528fcf4c77d3312bf8bd5778 /etc
parent329db7050206e398dbcb8456d19c43bbce91b97d (diff)
downloadpfsense-101ce09aee348471171d7d4c948ea1f01ddb98ad.zip
pfsense-101ce09aee348471171d7d4c948ea1f01ddb98ad.tar.gz
Ticket #406. Add openvpn tunnel networks to the auto generated nat rules.
Diffstat (limited to 'etc')
-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