Archive > 17.7 Legacy Series

OpenVPN Redirect Gateway - Option from Client

(1/1)

Heathy65:
I have OpenVPN on OPNsense installed and working with the Redirect Gateway option enabled in the server so all traffic from my clients (iPhone & Mac) is routed via the VPN connection.  This is what I want when I'm connected to public Wi-Fi services etc.  However I have another use case when I just want specific traffic to route via the VPN and other "Internet" traffic not not do this.

Is there any way to set this from the client side (I'm using the OpenVPN client on my iPhone & Viscosity on my Mac).  I'm sure I could achieve this "manually" on Mac by manipulating the routing table but not on the iPhone?

One messy/alternative solution I thought of is having two OpenVPN servers configured on OPNsense, one configured each way.

xinnan:

--- Quote from: Heathy65 on November 05, 2017, 11:23:00 pm ---One messy/alternative solution I thought of is having two OpenVPN servers configured on OPNsense, one configured each way.

--- End quote ---

Not sure why that is messy?  Thats exactly what I would do. 

NilsS:
you can eithter only set the redirect gateway option on "client specific overrides" or remove the redirect gateway in the client ovpn file with

--- Code: ---route 0.0.0.0 192.0.0.0 net_gateway
route 64.0.0.0 192.0.0.0 net_gateway
route 128.0.0.0 192.0.0.0 net_gateway
route 192.0.0.0 192.0.0.0 net_gateway

--- End code ---
https://community.openvpn.net/openvpn/wiki/IgnoreRedirectGateway

sofien:
were you been able to fix you concern?

sofien:
Were you be able to forward all traffic through your tunnel? did you find a way to indicate which traffic need to goes through the vpn?

--- Quote from: Heathy65 on November 05, 2017, 11:23:00 pm ---I have OpenVPN on OPNsense installed and working with the Redirect Gateway option enabled in the server so all traffic from my clients (iPhone & Mac) is routed via the VPN connection.  This is what I want when I'm connected to public Wi-Fi services etc.  However I have another use case when I just want specific traffic to route via the VPN and other "Internet" traffic not not do this.

Is there any way to set this from the client side (I'm using the OpenVPN client on my iPhone & Viscosity on my Mac).  I'm sure I could achieve this "manually" on Mac by manipulating the routing table but not on the iPhone?

One messy/alternative solution I thought of is having two OpenVPN servers configured on OPNsense, one configured each way.

--- End quote ---

Navigation

[0] Message Index

Go to full version