Hi there,
I have been banging my head against this seemingly simple issue for a while now, and i really need some help before i jump out of a window ;o). Any tips or hints would be greatly appreciated.
For my organisation i run a few pfSense (24.11) firewalls on our permanent locations. We have many temporary locations for events we set up that i want to connect to HQ. I want to do this using a site to site VPN so we can do (birectional) remote hardware management on those sites. The pfSense firewall at HQ i want the sites to connect to, is already running an openVPN server for employee remote access, and a site-to-site IPSec VPN to our other permanent locations (that have a static IP).
Now i have a bunch of low cost Ubiquity Edgerouter-X firewalls, flashed with the latest version of OpenWRT (24.10.1). I want to use these edgerouters to set up a local network for us, and act as gateway and firewall between any network/internet connection offered on site. I want the edgerouters to automatically connect to HQ using openVPN, so that i can hand one of these edgerouters to the engineers and when they have an internet uplink on site, they just have to plug it in and it phones home, allowing us to access all the devices behind the edgerouter on its DHCP enabled LAN. The intended setup is as follows (the goal is to have about 20 edgerouters at different event locations in the field connected to HQ)
HQ-LAN <> HQ(pfsense) >> [INTERNET] << remote_edgerouter-openwrt_1 <> remote lan 1
HQ-LAN <> HQ(pfsense) >> [INTERNET] << remote_edgerouter-openwrt_2 <> remote lan 2
Now i have succeeded in getting the edgerouters to use a dial up remote access connection, where it connects using the remote access openvpn server on pfSense. from the network behind the edgerouter i am able to reach everything at HQ behind the pfSense firewall, but from hosts on the HQ network i am not able to reach the edgerouter or anything behind it.
So i have set up a second Peer-to-Peer VPN server on the pfSense firewall in HQ, using port 1195, but i cannot get the edgerouters to connect to it. The current config does try to connect to the server, where i can even see the incoming connections in pfsense, but they keep disconnecting due to a TLS handshake error.
Sadly all the manuals on how to set up site-to-site OpenVPN between pfSense and openWRT seem to be very outdated, and most still use the since-deprecated ' Peer-to-Peer (Shared Key)' server setting in pfSense. I would like to set up a Peer-to-Peer (SSL/TLS) connection between HQ and the edgerouters. And i am a little stuck in how to configure the edgerouter properly for this type of connection.
The following is the VPN config on the edgerouters. The many different manuals i have tried to troubleshoot the issue left my config a bit of a mess, as i am no expert on OpenVPN. But i do have some experience with (ipsec) VPN's. So i am fairly confident the server settings and (omitted) certificates i used and are reflected here below, are correct. I feel the issue is with the openVPN config on the edgerouter not correctly setting up TLS authentication, likely because i am using the wrong openvpn commands to tell openWRT to do what i want. Could anyone tell me what am i doing wrong in this setup for the client, and how i can correct it? (thanks in advance for any help!)
dev tun
nobind
persist-tun
persist-key
data-ciphers AES-256-CBC
auth SHA512
tls-client
resolv-retry infinite
keepalive 10 60
remote [[HQ-REMOTE-IP]] 1195 udp4
route [[HQ-LAN-IP-RANGE]] 255.255.255.0
verb 5
verify-x509-name "HQ-site-to-site" name
remote-cert-tls server
explicit-exit-notify
<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
</key>
key-direction 1
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
</tls-auth>