Pb config with VPN: script issue? LAN issue? ... I am lost now!!

Discussion in 'Tomato Firmware' started by jbesclapez, Jan 20, 2014.

  1. jbesclapez

    jbesclapez Networkin' Nut Member

    Hi there,

    I have a modem Dlink DSL-320T and a routeur RT-N66U with tomato shibby AIO 116.
    I changed my LAN settings yesterday as I had problems with the modem. Modem was not bridged and now it is bridged! So now the routeur uses PPPOE for the internet.
    My VPN is running OK but not in the way i would like. I want all IPs from to to use the VPN. Not the other IPs!

    My modem is using a different subnet: /

    My Routeur is using : /
    DHCP from to 199
    (See below)


    Her is below the routing table with the VPN OFF:


    The VPN Settings are like that:


    The script in WAN UP is like below :
    for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do
    echo 0 > $i
    ip route flush table 100
    ip route del default table 100
    ip rule del fwmark 1 table 100
    ip route flush cache
    iptables -t mangle -F PREROUTING
    iface_lst=`route | awk ' {print $8}'`
    for tun_if in $iface_lst; do
    if [ "$tun_if" = "tun11" ]; then
    exit 0
    elif [ "$tun_if" = "tun12" ]; then
    exit 0
    ip route show table main | grep -Ev ^default | grep -Ev $tun_if \
    | while read ROUTE ; do
    ip route add table 100 $ROUTE
    ip route add default table 100 via $(nvram get wan_gateway)
    ip rule add fwmark 1 table 100
    ip route flush cache
    # By default all traffic bypasses the VPN
    iptables -t mangle -A PREROUTING -i br0 -j MARK --set-mark 1
    # IP_RANGES - Uncomment as necessary
    iptables -t mangle -A PREROUTING -i br0 -m iprange --src-range $ip_range1 -j MARK --set-mark 0
    When I start the VPN, all IPs use the VPN... and my routing table looks like that :

    So, what should i do to have only the iPs in the range using the VPN?

    Thanks for your help
  2. jbesclapez

    jbesclapez Networkin' Nut Member

  3. jbesclapez

    jbesclapez Networkin' Nut Member

  4. jbesclapez

    jbesclapez Networkin' Nut Member

  5. jbesclapez

    jbesclapez Networkin' Nut Member

  6. jbesclapez

    jbesclapez Networkin' Nut Member

    Please someone help... i have no idea why my VPN is putting my static IPs in the VPN...
  7. PetervdM

    PetervdM Network Guru Member

    your router is using a /24 subnet which is part of the of the modem's /16 subnet. this might trigger unwanted side effects. or is this just a typo?
  8. Jorge Nerín

    Jorge Nerín Reformed Router Member

    You are using the TUN mode in the interface type, this mode is routed, you need a different subnet. You seem to want a bridge, the bridge mode is TAP, if you choose TAP then you'll have the option to let the DHCP server manage the assignations or to have a different range managed by openvpn.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice