Results 1 to 2 of 2

Thread: HowTo: Routing all client traffic through the VPN

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2004

    HowTo: Routing all client traffic through VPN

    For a couple of days ago I tried posting this HowTo under “WL-500g/WL-500gx Tutorials” where other tutorials are. Either forum’s administrators have not had the time to publish it or administrator’s rules have restrained this HowTo from being published. In any case, the result is the distortion of the intended structure of this forum leading it to find HowTos where there should not be.

    -. “HowTo install OpenVPN server" tutorial in this forum

    -. Have read or installed OpenVPN server following the above source

    HOW-TO 1: Automatically without user intervention
    Create new server.conf and client.ovpn files as follows:

    server.conf file
    dev tun0
    secret static.key
    # Routing all client traffic (including web-traffic) through the VPN
    push "redirect-gateway def1"
    push "dhcp-option DNS"
    client.ovpn file
    remote myremote.mydomain
    dev tun0
    secret static.key
    keepalive 10 60
    redirect-gateway def1
    route-method exe
    route-delay 2
    dhcp-option DNS
    where myremote.mydomain is the WAN ip address or host name of your Router.

    i) With Microsoft Vista, client.ovpn may be started as administrator (run OpenVPN GUI as administrator).

    HOW-TO 2: By manipulating routing table on client
    After following “HowTo install OpenVPN server” tutorial one should gather the below parameters:

    1) Internet IP address of the VPN Server. I will call it VpnSrvIp
    2) Default gateway on VPN Client. I will call it GtwClntIp (see notes)

    I assume far-end IP address of the VPN link is as it is on the above mentioned tutorial.

    Open a DOS prompt window and write the following:
    route add VpnSrvIp MASK GtwClnIp METRIC 1
    route add MASK METRIC 1
    It may happen that after a while Windows restructures the routing table giving priority to the Internet gateway. If so, run:

    route change MASK METRIC 1

    i) If no DNS resolution edit file /etc/dnsmasq.conf and add line
    and then restart the dnsmasq process (kill & invoke)
    ii) One way to identify the default gateway (GtwClntIp) on a Windows XP machine is by running “route print” on a DOS prompt window. This easy the identification in case more than one NIC is present.
    iii) More information:
    Last edited by Tamadite; 11-10-2009 at 11:29. Reason: New info added

Similar Threads

  1. Превью новой версии прошивки
    By Oleg in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 804
    Last Post: 14-03-2009, 20:42
  2. HowTo re-route all traffic through VPN
    By Tamadite in forum WL-500g/WL-500gx Tutorials
    Replies: 0
    Last Post: 15-11-2008, 00:54
  3. How to configure WL-500 as VPN client / router?
    By ePh432 in forum WL-500g Q&A
    Replies: 1
    Last Post: 04-06-2008, 06:49
  4. D-link VPN Client
    By satjoey in forum WL-500gP Q&A
    Replies: 1
    Last Post: 09-12-2007, 11:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts