Raspberry Pi 4 as VPN Gateway
-
Hi there everybody.
I guess this is a very well known topic but I can't get it to be solved.
I have a project to manage some devices remotely. The best way I could imagine this to work was to set up a VPN gateway between our office LAN to the device's LAN. That said, a Raspberry Pi came into this to be the bridge between these sites. Each device to be managed will receive it's own Raspberry with its VPN client file generated by our pfSense appliance.
The unit will get internet through a 4G router connected to ethernet interface.
On the pfSense side I assigned a VLAN for the Raspberries to work with static IP (192.168.40.0/24). The gateway for this net is 192.168.40.1.All the rules for the VPN inside pfSense were set and some overrides also for the VPN client connection to get same VPN IP ever. I'm using tap interface for this project cause I read about some restrictions to use tun interface in this kind of scenario. If I'm wrong, I'd appreciate some tips and related subject about that.
The Raspberry unit is connected to the VPN and I can SSH to it through my local machine that resides on another VLAN managed by pfSense.
From Raspberry I can ping the pfSense Interfaces (VLAN's) with no issues, but I can't ping the Raspberry eth0 (192.168.40.11) interface, either 4G Modem (192.168.40.201) from my local machine even from pfSense diagnostics GUI.
I know that eth0 from Raspberry unit is not pointing to the pfSense GW but to the 4G Router to get internet.
I've have tried some iptables settings at the Raspberry unit with no ping response from my office side. So I flushed/deleted them all.
Ipforwarding was enabled when I tested using tun interface but now is disabled using tap.
So what am I missing here?
The overall objective is to see the Solar Panel controllers IP's to set messages remotely.
Any help will be very welcome!!