Page 1 of 1

Strange route in PiVPN (OpenVPN)

Posted: Sat May 21, 2022 12:38 pm
by MyastanPatrin
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

Re: Strange route in PiVPN (OpenVPN)

Posted: Sat May 21, 2022 12:51 pm
by TinCanTech

Re: Strange route in PiVPN (OpenVPN)

Posted: Sat May 21, 2022 1:03 pm
by openvpn_inc
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

Re: Strange route in PiVPN (OpenVPN)

Posted: Sun May 22, 2022 11:22 am
by MyastanPatrin
Hello! I'm happy to report that it worked!
Thank you very much :)

Best regards :)