Strange route in PiVPN (OpenVPN)

This is the forum to post your config. Include diagrams, usage graphs, and all the other goodies to show off your network.

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

Post Reply
MyastanPatrin
OpenVpn Newbie
Posts: 2
Joined: Sat May 21, 2022 12:24 pm

Strange route in PiVPN (OpenVPN)

Post by MyastanPatrin » Sat May 21, 2022 12:38 pm

Hello all!
I'm using PiVPN-OpenVPN in a Raspberry Pi (also being the DHCP server via PiHole) to provide a Site-to-Site VPN between my parents house and mine; I'm using my pfSense to connect to it and allow routing to their network in order to troubleshoot better the problems they might have, i had to add a static route as well as a NAT route in my pfSense.

PiVPN script tipically does not allow LAN access when connected to it, so I've added the "route 192.168.26.0 255.255.255.0" to my /etc/openvpn/server.conf.

But now my parents are having connectivity issues and from my house I can only access the Raspberry Pi itself.
When I ping a machine I get some strange messages like From 10.102.44.1 icmp_seq=69 Redirect Host(New nexthop: 10.102.44.2)

I found this in the routes and i found that if i delete the third route I can access the rest of the network and it seems everything starts to function. But if i reconnect, it doesnt work again until i remove the route.

Code: Select all

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.26.1    0.0.0.0         UG    202    0        0 eth0
10.102.44.0     0.0.0.0         255.255.255.0   U     0      0        0 tun0
192.168.26.0    10.102.44.2     255.255.255.0   UG    0      0        0 tun0
192.168.26.0    0.0.0.0         255.255.255.0   U     202    0        0 eth0
Can anyone help me?

Thanks in advance

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

Re: Strange route in PiVPN (OpenVPN)

Post by TinCanTech » Sat May 21, 2022 12:51 pm


User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1332
Joined: Tue Feb 16, 2021 10:41 am

Re: Strange route in PiVPN (OpenVPN)

Post by openvpn_inc » Sat May 21, 2022 1:03 pm

Hello MyastanPatrin,

As far as I can tell what you're doing is telling your OpenVPN server to add a local route to 192.168.26.0/24 that goes into the VPN tunnel, but which ultimately then goes nowhere because there's nothing on the tunnel to deal with that traffic.

Probably what you wanted to do was something like adding a local route to 192.168.26.0/24 that goes to the VPN server, but add that route on the client side. Not the server side.

You can try to either move that route 192.168.26.0 255.255.255.0 line to the client config file instead of having it in the server config file, or alter it so it's a push command instead so the client will implement it when connecting:

A push command would look like this on the server side;
push "route 192.168.26.0 255.255.255.0"

Good luck,
Johan
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

MyastanPatrin
OpenVpn Newbie
Posts: 2
Joined: Sat May 21, 2022 12:24 pm

Re: Strange route in PiVPN (OpenVPN)

Post by MyastanPatrin » Sun May 22, 2022 11:22 am

Hello! I'm happy to report that it worked!
Thank you very much :)

Best regards :)

Post Reply