@AMartinelli said in Establish openVPN tunnel from remote:
From my understanding, the steps should be these ones:
openVPN traffic must be allowed to and from B3 WAN port in the whole network B. Tipically, this means allowing UDP traffic on port 1194 for B3 WAN IP address.
Since B3 is the server, it is sufficient to allow the OpenVPN traffic (e.g. port 1194) to B3. The OpenVPN server itself doesn't initiate a connection on its own.
openVPN traffic reaching B1 must be forwarded to B3, more specifically to its WAN port IP address.
So you have to forward UDP 1194 to B3.
As ist seems B2 is also a router in between, you have to forward it on B1 to the WAN port of B2, and on B2 to B3.
There must exist in network B routing rules allowing network B devices (in this example B1 and B2) to reach B3 WAN port.
If you only need to access B4 devices as you stated above, there are no routes needed for the other networks.
I assume, you have stated the LAN address of B2 as the WAN gateway on pfSense in the interface settings. If this is the case, pfSense nats outbound traffic on the WAN to its interface address.
If the VPN is for your own private purposes, what I assume, this would be fine and you would also be able to access B2 without the need of a static route. However, since B1 is behind a router from the point of pfSense you would need to add routes to access this subnet.
In either case, you need to enter all subnets you want to access (B1, B2, B4) from the remote site into the "Local Networks" box in the OpenVPN server settings.
Maybe the B4 devices need additional settings to allow access from outside of their subnets, if it's even possible. At least, they need to have the pfSense LAN IP as their default gateway.
Try to access them from B2 to check this.
B3 needs to be able to communicate through internet
This is not necessary to connect to the OpenVPN server, however, it is for installing packages and updates on pfSense.