Send all traffic through tunnel

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
john@simplerose.com
OpenVpn Newbie
Posts: 2
Joined: Thu Aug 25, 2022 1:55 pm

Send all traffic through tunnel

Post by john@simplerose.com » Thu Aug 25, 2022 2:01 pm

Operating System: Mac OSX
OpenVPN server version: Open Source Open VPN on ubuntu 22

When I'm on my home computer network and I use the VPN and I route traffic I'd expect it all to go through the 10/8 tunnel created by the VPN connection. This works for any regular DNS name, or any IP address except the VPN's IP address.

If I try to traceroute to the VPN's IP address the traffic goes through my router instead, which then requires me to whitelist the IP address of my home. I'd like to have the traffic destined for the VPN IP go through the 10/8 vpn tunnel, and back to itself for work purposes.

Note that any other IP address or DNS name goes through the 10/8 vpn tunnel.

I'd expect the traffic to go through my tunnel 10/8, then out the VPN and back to the VPN from its own IP address. Is this logic incorrect?

This would be my preferred setup, but I can't figure out how to configure this with openvpn.

I have "checked" the "forward all ipv4 traffic through the tunnel" setting in tunnelblik, but I still get the same behavior.

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

Re: Send all traffic through tunnel

Post by TinCanTech » Thu Aug 25, 2022 5:18 pm

john@simplerose.com wrote:
Thu Aug 25, 2022 2:01 pm
If I try to traceroute to the VPN's IP address the traffic goes through my router instead
What you mean is that the public IP of your server is routed via your router, which is correct routing.

What you want cannot be done.

For further assistance please start here:
viewtopic.php?t=22603

john@simplerose.com
OpenVpn Newbie
Posts: 2
Joined: Thu Aug 25, 2022 1:55 pm

Re: Send all traffic through tunnel

Post by john@simplerose.com » Thu Aug 25, 2022 7:35 pm

TinCanTech wrote:
Thu Aug 25, 2022 5:18 pm
john@simplerose.com wrote:
Thu Aug 25, 2022 2:01 pm
If I try to traceroute to the VPN's IP address the traffic goes through my router instead
What you mean is that the public IP of your server is routed via your router, which is correct routing.

What you want cannot be done.

For further assistance please start here:
viewtopic.php?t=22603
ah, that is too bad. Thanks for the response / help!

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

Re: Send all traffic through tunnel

Post by TinCanTech » Thu Aug 25, 2022 7:39 pm

If you want to know why then look up how --redirect-gateway def1 works. It's in the manual.

Post Reply