which command i should use to start and stop an l2tp client on Asus RT- AC5300 using SSH
I searched but i couldn't find anything for l2tp clients in specific.
nvram set vpnc_proto=pptp
nvram set vpnc_pptp_options_x="+mppe-128"
nvram set vpnc_proto=l2tp
nvram set vpnc_pptp_options_x=
service stop_vpncall
Use this PPTP script as a template to initiate the L2TP connection:
https://www.snbforums.com/threads/delay-pptp-vpn-start.38026/#post-313277
You will need to change the protocol and ideally the PPTP specific option should be erased
e.g.
change script lines toCode:nvram set vpnc_proto=pptp nvram set vpnc_pptp_options_x="+mppe-128"
Code:nvram set vpnc_proto=l2tp nvram set vpnc_pptp_options_x=
To terminate the L2TP connection issue:
Code:service stop_vpncall
Does this script have to start at boot or can i assign a command to call it whenever i want
Works like a charmThe crude script can be called post-boot manually or via cru/cron to initiate the L2TP connection, but if the GUI profile L2TP connection is ACTIVE when you reboot, then the firmware will automatically restart the L2TP connection, which may not be what you require.
You may improve the script to allow you to specify say 'del' as a command argument so you could add the 'service stop_vpncall' to the script.
NOTE: The crude script does not update the GUI if there is no matching L2TP profile, but you can again tweak the script etc. to 'fix' this.
The userid/password credentials should be set to the appropriate server you are connecting to.
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!