summaryrefslogtreecommitdiff
path: root/scripts/vpn-config.pl
diff options
context:
space:
mode:
authorKim <kim.sidney@gmail.com>2019-03-14 16:25:08 +0100
committerUnicronNL <kim.sidney@gmail.com>2019-03-14 16:28:30 +0100
commitbcdf0dead416fdc8e390ee3ba56fc5e7c6490e72 (patch)
tree95739272d866079199ee32fe2bb2e2d244f41d12 /scripts/vpn-config.pl
parent9900fb602e29b52e940ba7ee6eae3886b764fbfe (diff)
downloadvyatta-cfg-vpn-bcdf0dead416fdc8e390ee3ba56fc5e7c6490e72.tar.gz
vyatta-cfg-vpn-bcdf0dead416fdc8e390ee3ba56fc5e7c6490e72.zip
Fixes T1298 use vti tunnel with ipsec and dhcp.
* make dhcp interface work for vti interfaces * clean up code, loger timeout use python api * change vti tunnel ip on new dhcp lease * only change ip on up and do not get non dhcp ip * fix error in function, include up-host and down-host
Diffstat (limited to 'scripts/vpn-config.pl')
-rwxr-xr-xscripts/vpn-config.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl
index ace33e8..d68e419 100755
--- a/scripts/vpn-config.pl
+++ b/scripts/vpn-config.pl
@@ -1078,6 +1078,9 @@ if ($vcVPN->exists('ipsec')) {
vpn_die(["vpn","ipsec","site-to-site","peer",$peer,"vti","bind"],"$vpn_cfg_err No interface bind specified for peer \"$peer\" vti\n");
}
$genout .= "\tleftupdown=\"/usr/lib/ipsec/vti-up-down $tunName\"\n";
+ if (defined($dhcp_iface)){
+ $dhcp_if = $dhcp_if + 1;
+ }
}
#
@@ -1522,7 +1525,7 @@ sub dhcp_hook {
if ($dhcp_iface > 0){
$str =<<EOS;
#!/bin/sh
-/opt/vyatta/bin/sudo-users/vyatta-ipsec-dhcp.pl --interface=\"\$interface\" --new_ip=\"\$new_ip_address\" --reason=\"\$reason\" --old_ip=\"\$old_ip_address\"
+/usr/libexec/vyos/system/vyatta-ipsec-dhcp.py --interface=\"\$interface\" --new_ip=\"\$new_ip_address\" --reason=\"\$reason\" --old_ip=\"\$old_ip_address\"
EOS
}
my $hook = "/etc/dhcp/dhclient-exit-hooks.d/ipsecd";