From f4e6bc26b224c7365c97aec58f95660911123634 Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Thu, 5 Jun 2008 09:32:33 +0000 Subject: If the Interface is not WAN remove static route on change --- usr/local/www/vpn_ipsec_edit.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'usr/local') diff --git a/usr/local/www/vpn_ipsec_edit.php b/usr/local/www/vpn_ipsec_edit.php index 4cba538..aa1810d 100755 --- a/usr/local/www/vpn_ipsec_edit.php +++ b/usr/local/www/vpn_ipsec_edit.php @@ -209,6 +209,13 @@ if ($_POST) { $ipsecent['interface'] = $pconfig['interface']; pconfig_to_address($ipsecent['local-subnet'], $_POST['localnet'], $_POST['localnetmask']); $ipsecent['remote-subnet'] = $_POST['remotenet'] . "/" . $_POST['remotebits']; + /* if the remote gateway changed and the interface is not WAN then remove route */ + /* the vpn_ipsec_configure() handles adding the route */ + if($_POST['interface'] <> "wan") { + if($ipsecent['remote-gateway'] <> $_POST['remotegw']) { + mwexec("/sbin/route delete -host {$ipsecent['remote-gateway']}"); + } + } $ipsecent['remote-gateway'] = $_POST['remotegw']; $ipsecent['p1']['mode'] = $_POST['p1mode']; -- cgit v1.1