Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    ubuntu server openvpn to netgate pfsense openvon client

    Scheduled Pinned Locked Moved OpenVPN
    14 Posts 2 Posters 880 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      viragomann @ariban99
      last edited by

      @ariban99 said in ubuntu server openvpn to netgate pfsense openvon client:

      i know i need to create client-config-dir ccd and the filename should be the common name of the cert (how do i know or find the common name, it was auto generated by the server script)

      If you don't care about which client device in your network is accessing the remote site you can circumvent this with an outbound NAT rule.

      Do you need to access the ubuntu server only or also devices behind it?
      If the latter is it the default gateway in its local network?

      A 1 Reply Last reply Reply Quote 0
      • A
        ariban99 @viragomann
        last edited by

        @viragomann the ubuntu server is a pbx in the cloud, i need my phones to connect to the server only. nothing else. only 10.8.0.1
        i believe it is the default gateway in its local network.
        what outbound nat rule should i apply?

        V 1 Reply Last reply Reply Quote 0
        • V
          viragomann @ariban99
          last edited by

          @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.

          A 2 Replies Last reply Reply Quote 0
          • A
            ariban99 @viragomann
            last edited by

            @viragomann cool. i will try this. thank you

            1 Reply Last reply Reply Quote 0
            • A
              ariban99 @viragomann
              last edited by

              @viragomann i followed this, but i cant connect to 10.8.0.1
              see attached screenshotsScreenshot 2024-10-13 050918.png Screenshot 2024-10-13 051008.png

              V 1 Reply Last reply Reply Quote 0
              • V
                viragomann @ariban99
                last edited by

                @ariban99
                This is the wrong translation address. Should be the respective interface address, so "PBXUBUNTU address" in this case.

                A 1 Reply Last reply Reply Quote 0
                • A
                  ariban99 @viragomann
                  last edited by

                  @viragomann like this?Screenshot 2024-10-13 053300.png
                  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

                  V 1 Reply Last reply Reply Quote 0
                  • V
                    viragomann @ariban99
                    last edited by

                    @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.

                    A 2 Replies Last reply Reply Quote 0
                    • A
                      ariban99 @viragomann
                      last edited by

                      @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.0

                      then in the openvpn server conf file i added
                      route 192.168.1.0 255.255.255.0

                      and it works!

                      V 1 Reply Last reply Reply Quote 0
                      • V
                        viragomann @ariban99
                        last edited by viragomann

                        @ariban99
                        Edit:
                        If it works with the client file the outbound NAT rule doesn't work obviously.

                        1 Reply Last reply Reply Quote 0
                        • A
                          ariban99 @viragomann
                          last edited by

                          @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 gateway

                          i 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.0

                          or 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

                          A 1 Reply Last reply Reply Quote 0
                          • A
                            ariban99 @ariban99
                            last edited by

                            @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

                            V 1 Reply Last reply Reply Quote 0
                            • V
                              viragomann @ariban99
                              last edited by

                              @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.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.