Policy Based Routing for OpenVPN Client

This forum is for admins who are looking to build or expand their OpenVPN setup.
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
TuckerTale
OpenVpn Newbie
Posts: 1
Joined: Thu Jun 11, 2020 10:00 pm

Policy Based Routing for OpenVPN Client

Post by TuckerTale » Thu Jun 11, 2020 10:13 pm

Hello,

I've running a private server which is connected to the internet via VPN, but the problem is that I'm not able to access my OwnCloud from the internet when OpenVPN is connected. If I disconnect OpenVPN the port forwarding is working like a charm - so I've found policy based routing, but don't know what I'm configuring wrong that I'm not able to access my OwnCloud.

Setup

Code: Select all

Public-IP               ->  ISP-Rounter             ->  LAN-Router           ->  Linux Server / OpenVPN-Client
123.123.123.123             192.168.160.1               192.168.150.1            192.168.150.150 / 170.130.12.12
I've configured my ISP router to forward port 8080 to 192.168.150.1:8080 which forwards 8080 to 192.168.150.150:8080, which works without connected OpenVPN. I think the problem is that the response is going through the VPN tunnel?

Now I've added a policy based route

Code: Select all

sudo ip rule add from 192.168.150.150 table no_vpn
sudo ip route add 192.168.150.0/24 dev eth0
sudo ip route add default via 192.168.150.1 dev eth1
Won't work, probably something missing?!

Thank you for your help.

Post Reply