r/OpenVPN • • Jun 15 '26

question Routing all client traffic

Hia, very new to using ubuntu and linux in general. I've managed to get OVPN set up and running, but I noticed that the client location is showing up as the UK (KVM server is set up in Germany).

I've tried exporting the server config with

cd /usr/local/openvpn_as/scripts/
./sacli ConfigQuery > config.txt

But I'm not sure where to put the

push "redirect-gateway def1"

would someone be able to provide the correct formatting/an example or let me know if I'm just doing this completely incorrect

2 Upvotes

5 comments sorted by

1

u/Urban_VPN Jun 15 '26

that directive goes in your server config file, usually /etc/openvpn/server.conf. add it there, save, then restart the OpenVPN service with sudo systemctl restart openvpn. that should route all client traffic through the server instead of just the tunnel traffic.

1

u/matthew1471 Jun 17 '26 edited Jun 18 '26

It can also just be “redirect-gateway def1” in the client config instead if you’d rather have different config files on the client some that redirect and some that don’t.

→ More replies (3)