From ecdc9b1f0bf47b762669d8600aaddc5cfa5ed206 Mon Sep 17 00:00:00 2001 From: aapostoliuk Date: Thu, 16 Mar 2023 12:33:18 +0200 Subject: ipsec: T5043: Rewritten and fixed 'reset vpn' commands 1. Rewritten CLI of 'reset vpn' commands. 2. Created 'reset vpn ipsec remote-access' commands to reset RA IKEv2 session. 3. Created 'reset vpn ipsec site-to-site all' command to reset all configured IPSec site-to-site peers sessions. 4. Rewritten 'reset vpn l2t|pptp|sstp' commands to new opmode style. --- op-mode-definitions/reset-vpn.xml.in | 120 +++++++++++++++++------------------ op-mode-definitions/vpn-ipsec.xml.in | 97 +++++++++++++++++++--------- 2 files changed, 126 insertions(+), 91 deletions(-) (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/reset-vpn.xml.in b/op-mode-definitions/reset-vpn.xml.in index 94ee1c7df..8de95d1cc 100644 --- a/op-mode-definitions/reset-vpn.xml.in +++ b/op-mode-definitions/reset-vpn.xml.in @@ -7,82 +7,78 @@ Reset Virtual Private Network (VPN) information - + - Reset remote access VPN connections + Reset L2TP server VPN sessions - Terminate all users current remote access VPN session(s) + Reset all L2TP server VPN sessions - - - - Terminate specified users current remote access VPN session(s) with specified protocol - - - - - Terminate all users current remote access VPN session(s) with L2TP protocol - - sudo ${vyos_op_scripts_dir}/reset_vpn.py --username="all_users" --protocol="l2tp" - - - - Terminate all users current remote access VPN session(s) with PPTP protocol - - sudo ${vyos_op_scripts_dir}/reset_vpn.py --username="all_users" --protocol="pptp" - - - - Terminate all users current remote access VPN session(s) with SSTP protocol - - sudo ${vyos_op_scripts_dir}/reset_vpn.py --username="all_users" --protocol="sstp" - - - - - sudo ${vyos_op_scripts_dir}/reset_vpn.py --username="all_users" + sudo ${vyos_op_scripts_dir}/reset_vpn.py reset_conn --protocol="l2tp" - Terminate a remote access VPN interface + Reset specified interface on L2TP VPN server - sudo ${vyos_op_scripts_dir}/reset_vpn.py --interface="$5" + sudo ${vyos_op_scripts_dir}/reset_vpn.py reset_conn --protocol="l2tp" --interface="$5" - Terminate specified users current remote access VPN session(s) + Reset specified user on L2TP VPN server - - - - Terminate specified users current remote access VPN session(s) with specified protocol - - - - - Terminate all users current remote access VPN session(s) with L2TP protocol - - sudo ${vyos_op_scripts_dir}/reset_vpn.py --username="$5" --protocol="l2tp" - - - - Terminate all users current remote access VPN session(s) with PPTP protocol - - sudo ${vyos_op_scripts_dir}/reset_vpn.py --username="$5" --protocol="pptp" - - - - Terminate all users current remote access VPN session(s) with SSTP protocol - - sudo ${vyos_op_scripts_dir}/reset_vpn.py --username="$5" --protocol="sstp" - - - - - sudo ${vyos_op_scripts_dir}/reset_vpn.py --username="$5" + sudo ${vyos_op_scripts_dir}/reset_vpn.py reset_conn --protocol="l2tp" --username="$5" + + + + + + Reset PPTP server VPN sessions + + + + + Reset all PPTP server VPN sessions + + sudo ${vyos_op_scripts_dir}/reset_vpn.py reset_conn --protocol="pptp" + + + + Reset specified interface on PPTP VPN server + + sudo ${vyos_op_scripts_dir}/reset_vpn.py reset_conn --protocol="pptp" --interface="$5" + + + + Reset specified user on PPTP VPN server + + sudo ${vyos_op_scripts_dir}/reset_vpn.py reset_conn --protocol="pptp" --username="$5" + + + + + + Reset SSTP server VPN sessions + + + + + Reset all SSTP server VPN sessions + + sudo ${vyos_op_scripts_dir}/reset_vpn.py reset_conn --protocol="sstp" + + + + Reset specified interface on SSTP VPN server + + sudo ${vyos_op_scripts_dir}/reset_vpn.py reset_conn --protocol="sstp" --interface="$5" + + + + Reset specified user on SSTP VPN server + + sudo ${vyos_op_scripts_dir}/reset_vpn.py reset_conn --protocol="sstp" --username="$5" diff --git a/op-mode-definitions/vpn-ipsec.xml.in b/op-mode-definitions/vpn-ipsec.xml.in index ee006a2d5..5baaec7ce 100644 --- a/op-mode-definitions/vpn-ipsec.xml.in +++ b/op-mode-definitions/vpn-ipsec.xml.in @@ -7,49 +7,88 @@ Reset Virtual Private Network (VPN) information - + - Reset all tunnels for given peer - - vpn ipsec site-to-site peer - + Reset IPSec VPN sessions - + - Reset a specific tunnel for given peer + Reset all tunnels for given DMVPN profile - vpn ipsec site-to-site peer ${COMP_WORDS[3]} tunnel + vpn ipsec profile - sudo ${vyos_op_scripts_dir}/ipsec.py reset_peer --peer="$4" --tunnel="$6" + + + + Reset a specific tunnel for given DMVPN profile + + sudo ${vyos_op_scripts_dir}/vpn_ipsec.py --action="reset-profile" --name="$6" --tunnel="$8" + + + sudo ${vyos_op_scripts_dir}/vpn_ipsec.py --action="reset-profile" --name="$6" --tunnel="all" - + - Reset the VTI tunnel for given peer + Reset remote access IPSec VPN connections - sudo ${vyos_op_scripts_dir}/ipsec.py reset_peer --peer="$4" --tunnel="vti" + + + + Reset all users current remote access IPSec VPN sessions + + sudo ${vyos_op_scripts_dir}/ipsec.py reset_ra + + + + Reset specified user current remote access IPsec VPN session(s) + + sudo ${vyos_op_scripts_dir}/ipsec.py reset_ra --user="$6" + + - - sudo ${vyos_op_scripts_dir}/ipsec.py reset_peer --peer="$4" - - - - Reset all tunnels for given DMVPN profile - - vpn ipsec profile - - - - + - Reset a specific tunnel for given DMVPN profile + Reset site-to-site IPSec VPN connections - sudo ${vyos_op_scripts_dir}/vpn_ipsec.py --action="reset-profile" --name="$4" --tunnel="$6" - + + + + Reset all site-to-site IPSec VPN sessions + + sudo ${vyos_op_scripts_dir}/ipsec.py reset_all_peers + + + + Reset all tunnels for given peer + + vpn ipsec site-to-site peer + + + + + + Reset a specific tunnel for given peer + + vpn ipsec site-to-site peer ${COMP_WORDS[5]} tunnel + + + sudo ${vyos_op_scripts_dir}/ipsec.py reset_peer --peer="$6" --tunnel="$8" + + + + Reset the VTI tunnel for given peer + + sudo ${vyos_op_scripts_dir}/ipsec.py reset_peer --peer="$6" --tunnel="vti" + + + sudo ${vyos_op_scripts_dir}/ipsec.py reset_peer --peer="$6" + + + - sudo ${vyos_op_scripts_dir}/vpn_ipsec.py --action="reset-profile" --name="$4" --tunnel="all" - + -- cgit v1.2.3