1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

VPN PPTP CLIENT over default WAN Connection

Discussion in 'Tomato Firmware' started by wilsonhlacerda, Apr 12, 2011.

  1. wilsonhlacerda Networkin' Nut

    Googleing for VPN PPTP on Tomato I found some useful info that seems is not here in forum yet. So I'd like to share with you (and maybe also get some help).

    Main thread focus: how to have a VPN PPTP CLIENT running on Tomato over default WAN connection (DHCP, PPPoE,...).
    Bellow I'll transcript the solution I found, but if you have other please post it!

    1st Plus: how to automatically send traffic thru VPN PPTP or default WAN based on target IP/subnet.
    Bellow I'll transcript the solution I found, but if you have other please post it!

    2nd Plus: how to automatically send traffic thru VPN PPTP or default WAN based on source MAC/IP/subnet.
    Couldn't find any solution for that yet, if you have one please post it!
  2. wilsonhlacerda Networkin' Nut

    How to have a VPN PPTP CLIENT running on Tomato over default WAN connection

    The best solution I found so far is this teddy_b's script:
    http://pastebin.com/ZMkDxcYy

    This start a separate instance of pppd to connect to the VPN network. It was done thinking on Tomato USB, where the standalone (accel-pptp based) pptp client is already part of Tomato USB. There's just no UI to configure it separately from the main WAN connection. But should also run on any other Tomato that has pptp client on it.

    Tip: Don't leave PPTP_DOMAIN empty - this version of the script expects it to be populated. For instance it should be "reliablehosting.com" for a PPTP_SERVER=vpn-sf22.reliablehosting.com

    How to automatically send traffic thru VPN PPTP or default WAN based on target IP/subnet.


    docbill brought this solution on how to redirect to a single site through the PPTP connection:

    Code:
    PPP5_GATEWAY=$(ifconfig ppp5 |sed -n -e 's,.*inet addr:\([^ ]*\).*,\1,p')
    iptables -t nat -A POSTROUTING -o ppp5 -d 192.94.73.9 -j MASQUERADE
    route add -net 192.94.73.9 netmask 255.255.255.255 gw $PPP5_GATEWAY
    
    now when I connect to 192.94.73.9 from any site in my network, I end-up going through the vpn connection.

    Of course normally you would want to do a something more, like maybe a complete subnet:

    Code:
    PPP5_GATEWAY=$(ifconfig ppp5 |sed -n -e 's,.*inet addr:\([^ ]*\).*,\1,p')
    iptables -t nat -A POSTROUTING -o ppp5 -d 192.94.73.0/24 -j MASQUERADE
    route add -net 192.94.73.0 netmask 255.255.255.0 gw $PPP5_GATEWAY

    All above was copied from and is better detailed on this Tomato USB forum thread:
    http://tomatousb.org/forum/t-309256/pptp-on-tomato
  3. wilsonhlacerda Networkin' Nut

    Now the problem that I'm having: I'm running "Tomato RAF Firmware v1.28.8525 _RAF ND VPN" on a WRT54G. And I cannot get teddy_b's script to work:

    Code:
    ./pptpcs.sh start
    Stopping pppd5...
    killall: ppp5-up: no process killed
    killall: ppp5-down: no process killed
    Starting pppd5...
    Plugin pptp.so loaded.
    PPTP plugin version 0.8.5 compiled for pppd-2.4.5, linux-2.4.37.9
    pppd: In file /tmp/ppp/ppp5/options: unrecognized option 'lcp-echo-adaptive'
    
    Can someone help me on that? Why PPPD is not recognizing lcp-echo-adaptive option? :confused:
  4. wilsonhlacerda Networkin' Nut

    Today I tried with:

    tomato-ND-1.28.8754-vpn3.6.trx
    Tomato Firmware v1.28.8754 ND vpn3.6
    Linux kernel 2.4.37.10 and Broadcom Wireless Driver 4.150.10.29 updates

    and

    tomato-K26-1.28.9054MIPSR1-beta-vpn3.6.trx
    Tomato Firmware v1.28.9054 MIPSR1-beta K26 vpn3.6
    Linux kernel 2.6.22.19 and Broadcom Wireless Driver 5.10.147.0 updates

    but with both I got exactly the same error before:
    pppd: In file /tmp/ppp/ppp5/options: unrecognized option 'lcp-echo-adaptive' :cry:

    Any suggestion?
  5. Mojonba Addicted to LI

    I curiously tried the script with bestfreevpn.com and got the same 'lcp-echo-adaptive' error. It would be nice to have this working on tomato as many of us need a vpn in order to use geo-blocked services.

Share This Page