diff options
author | Ermal Luçi <eri@pfsense.org> | 2010-03-09 19:07:52 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2010-03-09 19:07:52 +0000 |
commit | 101ce09aee348471171d7d4c948ea1f01ddb98ad (patch) | |
tree | 7eede5729d3b3e07528fcf4c77d3312bf8bd5778 /etc | |
parent | 329db7050206e398dbcb8456d19c43bbce91b97d (diff) | |
download | pfsense-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.inc | 17 |
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"; |