What's new

l2tp vpn client for only one device

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

You're a lifesaver, man. That worked.

So, to be clear, I have to turn on the VPN, run the script, and also run:

Code:
ip route del 0.0.0.0/1

ip route del 128.0.0.0/1

Is there any way to get this to happen automatically when I turn on the VPN?
I'm not 100% sure if this was a change that is now permanently included in the v386.x builds or was a v384.19 'feature'

The easiest solution would be to include the two commands in the PPTP_Select.sh script assuming it is always called manually once the VPN is UP

e.g. see this post for a technique to auto=execute PPTP-Select.sh upon a WAN event.
 
The easiest solution would be to include the two commands in the PPTP_Select.sh script assuming it is always called manually once the VPN is UP

Man, you're a regular Mister Wizard. :D I decided I wanted a one-click way to start the VPN and configure it for one device, so I looked around and found a thread that talked about starting PPTP over SSH, and it ends up you wrote that script too: https://www.snbforums.com/threads/start-l2tp-vpn-client-over-ssh.39782/

So, I made two scripts. The first one uses the script from the link above to start the VPN, then it calls the PPTP_Select.sh script to configure the VPN for just one IP (I have to sleep for a bit before that to wait for the VPN to "turn on", otherwise it doesn't work). The second one clears all of the settings for PPTP VPN and then calls stop_vpncall to turn VPN off.

I found and app for Android to execute ssh commands, and now I got two buttons on my phone, one to turn on VPN and one to turn it off. Thanks, man.
 
Sorry for reviving an old thread but apparently /etc/hosts.dnsmasq is not valid anymore. Will this script work for the latest merlin now if the hosts.dnsmasq is fixed?
 
Sorry for reviving an old thread but apparently /etc/hosts.dnsmasq is not valid anymore. Will this script work for the latest merlin now if the hosts.dnsmasq is fixed?
In the intervening years since I published the scripts (circa 2017), many things have changed in recent firmwares, but rule of thumb still states that for selective routing, devices must have a reserved IP address, and associating a human friendly HOSTNAME doesn't hurt.

So to match an IP address with a HOSTNAME it means that '/etc/dnsmasq.config' or even '/jffs/addons/YazDHCP.d/.hostnames' etc. should be examined rather than solely scanning '/etc/hosts.dnsmasq' to find the HOSTNAME associated with the IP address.

The script should indeed be updated with a more robust method of determining the HOSTNAME, but in the interim the script will simply report to Syslog a 'blank' associated HOSTNAME for the IP address used for the selective routing.

This 'error' is totally cosmetic, however unless someone can chime in to confirm that the script is still compatible with the available 2024 firmwares, you may have to try it yourself to prove the script satisfies your L2TP selective routing requirements.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top