Seamless connection to website through OpenVPN
-
Good day, everybody!
I have to apologize in advance for my terrbile english.
So I've got to make this VPN connection to PFSense where gateway on client stays by default (so they would use their internet connection) but all traffic to 8.8.8.8 (for example) should be routed through VPN.
I've tried to use push route and iroute commands, but to no avail.Maybe you can help me out?
-
So you have set up an access server?
Is pfSense the default gateway in the network you want to access via vpn?
Have you added firewall rules to OpenVPN interface to allow access?
-
Yes the OpenVPN itself is setup and working, PFSense is default gateway and I've added rules that deny any connection besides IP-address I wanted.
If I turn on "redirect gateway" option then everything works perfectly but I have no access to web besides the host I selected and if I turn that option off then I have no connection to my host. -
If it works when you activate "Redirect gateway" there are presumable only missing the routes when it is not activated.
To push the routes to the client, you must enter the hosts or networks the client should be able to access in "Local Networks" box in the server settings in CIDR notation, meaning if it is only a single host use e.g. 8.8.8.8/32. Multiple hosts or subnets have to be separated by commas. -
That is a use case for policy routing. See the many, many threads about only sending traffic from certain hosts to, for instance, PIA. You will just need to alter the rules to match certain destinations instead.