summaryrefslogtreecommitdiff
path: root/src/etc/ipsec.d
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-05-28 21:53:11 +0200
committerChristian Poessinger <christian@poessinger.com>2021-05-28 21:53:11 +0200
commitab4b85d0027e47a7c28564c9adcc5ec2fa6da1e4 (patch)
treec61c96f2223d63e73f3c0de0452db86d87cb9a56 /src/etc/ipsec.d
parentce5fe544e4d6c0bd8e6425ec97d0bdfd130630a4 (diff)
downloadvyos-1x-ab4b85d0027e47a7c28564c9adcc5ec2fa6da1e4.tar.gz
vyos-1x-ab4b85d0027e47a7c28564c9adcc5ec2fa6da1e4.zip
ipsec: T2816: drop absolute path on calls to iproute2
Diffstat (limited to 'src/etc/ipsec.d')
-rwxr-xr-xsrc/etc/ipsec.d/vti-up-down11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/etc/ipsec.d/vti-up-down b/src/etc/ipsec.d/vti-up-down
index 416966056..9abca1fd6 100755
--- a/src/etc/ipsec.d/vti-up-down
+++ b/src/etc/ipsec.d/vti-up-down
@@ -12,7 +12,8 @@ def get_config(config, base):
if not config.exists(base):
return None
- return conf.get_config_dict(base, key_mangling=('-', '_'), get_first_key=True, no_tag_node_value_mangle=True)
+ return conf.get_config_dict(base, key_mangling=('-', '_'),
+ get_first_key=True, no_tag_node_value_mangle=True)
def get_dhcp_address(interface):
addr = get_interface_address(interface)
@@ -31,7 +32,7 @@ if __name__ == '__main__':
print(f'vti-up-down: start: {verb} {connection} {interface}')
if verb in ['up-client', 'up-host']:
- call('sudo /usr/sbin/ip route delete default table 220')
+ call('sudo ip route delete default table 220')
vti_base = ['interfaces', 'vti', interface]
ipsec_base = ['vpn', 'ipsec', 'site-to-site']
@@ -72,11 +73,11 @@ if __name__ == '__main__':
if not vti_link_up:
if 'dhcp_interface' in peer_conf:
local_ip = get_dhcp_address(peer_conf['dhcp_interface'])
- call(f'sudo /usr/sbin/ip tunnel change {interface} local {local_ip}')
+ call(f'sudo ip tunnel change {interface} local {local_ip}')
if child_sa_installed:
- call(f'sudo /usr/sbin/ip link set {interface} up')
+ call(f'sudo ip link set {interface} up')
elif verb in ['down-client', 'down-host']:
if vti_link_up and not child_sa_installed:
- call(f'sudo /usr/sbin/ip link set {interface} down')
+ call(f'sudo ip link set {interface} down')
print('vti-up-down: finish')