OpenVPN Client - for a specific host IP

Discussion in 'Asuswrt-Merlin' started by phantomc, Jan 24, 2013.

  1. phantomc

    phantomc New Around Here

    Joined:
    Jan 24, 2013
    Messages:
    1
    Hello,

    I own a AC66U router with the RT-AC66U_3.0.0.4_266.23b merlin build flashed.

    I was experimenting with OpenVPN client, and got it working perfectly.

    My only problem is that once I setup OpenVPN client, all my devices connect to the internet through OpenVPN's server, however I want only some IP hosts to use OpenVPN client 1 whereas others use the default pppoe wan connection.

    as an example: I would like 192.168.1.3 to use the default pppoe connection whereas 192.168.1.4 will connect according to the openvpn client 1 settings.

    I tried to disable "Create NAT on tunnel" and "Redirect Internet traffic" however I could not advance as I had not created a static routing before.

    Would this be possible, and how?

    Thanks in advance
     
  2. Log in / Register to remove this ad

  3. jobongo

    jobongo Regular Contributor

    Joined:
    Jan 30, 2013
    Messages:
    62
    Suggestions

    There are several ways that you can do this. Usually when you connect to the openvpn server for the commercially provided services the router automatically pulls the route and dns configuration from the server. You can use the

    route-nopull

    option in the openvpn configuration to prevent this. Then you would have to setup manual routes and routing rules to direct the addresses that you want to go over the vpn. For instance:

    Code:
    ip route default dev tun0 table 10
    ip rule add from 192.168.1.3 table 10
    This means that for device that uses the ip of 192.168.1.3 to lookup routing table 10 in order to get its routing information. It would then see that the default route is through the openvpn tunnel and get routed that way. There are a few more steps that need to be done but this is the general idea. Let me know if you need more help.
     
    Last edited: Feb 9, 2013
  4. janosek

    janosek Regular Contributor

    Joined:
    Jan 8, 2013
    Messages:
    140

Share This Page