vpn on/off switch

Posted on 2011-04-28
Last Modified: 2012-08-13
Is there any software/script that blocks all internet traffic if it's not going through openvpn or pptp? I'm looking for something simple that I could switch on and off whenever I need it.
Question by:11friend
    LVL 2

    Expert Comment

    Take a look at -
    VPN LifeGuard:

    One of those should be what you're looking for.


    Author Comment

    Thanks. Do you know other solutions? The second software isn't in English and the first one doesn't work properly on my computer despite great effort from the author to help.
    LVL 67

    Expert Comment

    I might think too simplistic, but if you do not use a default gateway while not connected, you cannot have Internet traffic ... While on PPTP/OpenVPN, just have the default gateway added.

    Author Comment

    That would be probably the best solution but I don't know how to do this exactly. I found something here but I get a message that my route can't be changed.
    LVL 67

    Accepted Solution

    That message only appears if you do not have a default gateway. But the issue is - you can't get to the VPN server, if it is not on LAN, and you haven't any specific routes for the VPN server IP set!

    OpenVPN can set the routes on connection. See the redirect-gateway directive.

    If you want to do it manually, you should add and change the default route:
       2>nul route add mask Ip.Addr.of.Gateway
       2>nul route change mask IP.Addr.of.Gateway
    The 2>nul will prevent errors from being shown.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
    Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
    Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now