Routing between 2 links
I am setting up a network with 2 pfsense machines. The main pfsense is acting as a NAT/firewall/VPN for multiple LANs in a business. The other pfsense is going to serve multiple LANs as well, but it will sometimes be connected directly to the main pfsense and sometimes over vpn.
Here is a sketch of the network LANs and link interfaces.
192.168.0.0/24 –---| | Public IP
172.16.0.16/29 -----| Mainpfsense | tun0: 172.16.0.25/30 (Openvpn site2site)
10.0.50.0/24 -------| | opt1: 172.16.0.1/30 (LAN link)
10.0.2.0/24-----| | tun0: 172.16.0.26/30 (Openvpn site2site)
172.16.0.8/29---|Mobilepfsense | opt1: 172.16.0.2/30 (LAN link)
| Public IP
The mobilepfsense is in a bus that is sometimes parked and connected through LAN link network (172.16.0.0/30) and sometimes through openvpn link network (172.16.0.24/30).
I need to make routing work between the different LANs so that it routes throgh the LAN link when connected to it and vpn when not connected to the LAN. Static routning with metrics doesn't work right? So I thought of dynamic routing. I tried ripv2 but that didn't work well. I tried to run OSPFd on the the LAN link and tunnel interfaces, and that kind of works, but there seems to be some kind of problems. (maybe a misconfiguration...)
Is there some other way that I may have missed? This shouldn't be so difficult to accomplish.
Communication works fine on all links, it's just the routing that I have an issue with...
Any help appreciated. Thank you.