ubuntu server openvpn to netgate pfsense openvon client
-
@ariban99
First assign an interface to the OpenVPN instance. Interfaces > Assignments. Select the corresponding Client instance (ovpncX) at "available network ports", hit Add, open the new interface, enable it and state a friendly name.Then add the outbound NAT rule. Select the interface, which you've created above.
source: the subnet, where your phone reside
destination: any (for accessing the internet. Don't know)
translation: interface address (default)Ensure to enable the hybrid mode on the outbound NAT settings.
-
@viragomann cool. i will try this. thank you
-
@viragomann i followed this, but i cant connect to 10.8.0.1
see attached screenshots -
@ariban99
This is the wrong translation address. Should be the respective interface address, so "PBXUBUNTU address" in this case. -
@viragomann like this?
if yes, its still not working.i logged into the server panel and it says
ip 45.56.162.217
gateway 45.56.162.1
netmask 255.255.255.0 -
@ariban99
Yes.So you need only to access the server itself using its virtual IP 10.8.0.1 as I got you?
This should work with this NAT rule, presumed your pfSense is the default gateway in your local network.Can you ping the server from pfSense Diagnostic > Ping?
If it works change the source to the LAN. Should work as well.
If so try to ping it from a LAN device. -
@viragomann i got it working the original way.
i create a file in CCD with the name of my common name for the certificate. in that file i put
iroute 192.168.1.0 255.255.255.0
push "route 10.8.0.0 255.255.255.0"
ifconfig-push 10.8.0.0 255.255.255.0then in the openvpn server conf file i added
route 192.168.1.0 255.255.255.0and it works!
-
@ariban99
Edit:
If it works with the client file the outbound NAT rule doesn't work obviously. -
@viragomann
correct only the server via 10.8.0.1 i do NOT need anything beyond the server (no other connected clients) yes my pfsense is the default gatewayi did not try ping, i just tried to access the GUI via chrome 10.8.0.1
somehow, by putting the CCD file and adding the server route 192..... it started working and my phones are now connected.
my question is, what is the best way to add 2 more remote locations? i know i need to add the extra CCD files. but for the server side, do i add a new line with the new remote lan subnets
route 192.168.2.0 255.255.255.0
route 192.168.3.0 255.255.255.0or do i simply add it all in one line like in pfsense GUI as follows
route 192.168.1.0,192.168.2.0,192.168.3.0 255.255.255.0 -
@ariban99 any advice on the last questions. what do i put in the server conf file for multiple remote locations? in the GUI of pfsense, you put a , in between each subnet, how should i do that in ubuntu for pfsense
-
@ariban99
You need a separate route line for each remote subnet.Also you need a client file for each client, which you want to access a network behind.