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

    Setting up OpenVPN for new remote office

    Scheduled Pinned Locked Moved OpenVPN
    25 Posts 5 Posters 2.9k 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.
    • DerelictD
      Derelict LAYER 8 Netgate
      last edited by Derelict

      Based on the information given, no.

      There is no problem having multiple OpenVPN servers running on different ports.

      If traffic enters an OpenVPN interface, there must be a rule allowing it.

      If traffic is to be sent out an OpenVPN interface, there must be a route. You do not set the remote networks the same on both sides of a tunnel. You set the remote networks to the networks on the other side you want to route to. (aka the remote networks).

      You will probably want to include the current configurations and a specific example (including source and destination addresses, etc) that cannot communicate.

      Chattanooga, Tennessee, USA
      A comprehensive network diagram is worth 10,000 words and 15 conference calls.
      DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
      Do Not Chat For Help! NO_WAN_EGRESS(TM)

      B 1 Reply Last reply Reply Quote 0
      • B
        BlazeStar @Derelict
        last edited by

        Hey @Derelict, thank you so much for your help.

        So I'm trying to figure out what you're saying, sorry for being a n00b.

        Based on the information given, no.

        There is no problem having multiple OpenVPN servers running on different ports.

        If traffic enters an OpenVPN interface, there must be a rule allowing it.

        On the server side, there are two firewall rules :

        • PASS / IPv4 UDP / WAN / 1194
        • PASS / IPv4 UDP / WAN / 1195

        No rules on the client side (SG-1100).

        I think on the firewall side everything seems correct?

        If traffic is to be sent out an OpenVPN interface, there must be a route. You do not set the remote networks the same on both sides of a tunnel. You set the remote networks to the networks on the other side you want to route to. (aka the remote networks).

        On my "road warrior" set up (Remote Access (SSL/TLS + User Auth)), I set up IPv4 Local network(s) to:

        10.0.3.0/24,10.0.4.0/24
        

        Everything works perfect: I can connect to a host on 10.0.3.XXX using OpenVPN client on Windows and Viscosity on MAC. We've been using it for years successfully.

        As soon as I fire up the second OpenVPN service (openvpn_2), nothing works anymore.

        You will probably want to include the current configurations and a specific example (including source and destination addresses, etc) that cannot communicate.

        The current configuration is up there:
        https://forum.netgate.com/topic/146151/setting-up-openvpn-for-new-remote-office/3

        With the exception that now on both sides of the Peer to Peer (Shared Key) Open VPN configuration, the IPv4 Remote network(s) are set to:

        10.0.3.0/24,10.0.4.0/24
        

        So for example, I have a NAS server on 10.0.3.20

        I want to connect to it with SMB.

        Normally, I would fire up my OpenVPN client, connect through 1194 to my OpenVPN server with Remote Access (SSL/TLS + User Auth) and I can easily connect to my shares, no problem.

        Now as soon as the second OpenVPN server on 1195 with Peer to Peer (Shared Key) configuration is running on the server side: I will still be able to connect like I usually do to my 1194 OpenVPN server I will not be able to connect with SMB to my 10.0.3.20 host.

        I'm not sure if that's the info you wanted? If not, let me know and I'll be happy to provide more.

        1 Reply Last reply Reply Quote 0
        • DerelictD
          Derelict LAYER 8 Netgate
          last edited by

          Why are you setting the remote networks on both sides of a p2p connection to the same networks? Set each side to list the networks on the other side.

          Chattanooga, Tennessee, USA
          A comprehensive network diagram is worth 10,000 words and 15 conference calls.
          DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
          Do Not Chat For Help! NO_WAN_EGRESS(TM)

          B 1 Reply Last reply Reply Quote 0
          • B
            BlazeStar @Derelict
            last edited by

            @Derelict that's because of that:

            @chpalmer said in Setting up OpenVPN for new remote office:

            Get rid of the custom options. You do not need that there.

            Use " 10.0.3.0/25,10.0.4.0/28" on the IPv4 Remote Networks line at the office opposite of those. Do the same for the office where those are with the subnet of the opposite office on the other end. Yes you have to.

            So I set it up on both sides.

            Now I'm assuming I need to get rid of it on the client side, right?

            1 Reply Last reply Reply Quote 0
            • DerelictD
              Derelict LAYER 8 Netgate
              last edited by

              The networks that are on the other side of the tunnel go in the remote networks setting on each side. Consult your network diagram to determine which networks are where.

              Chattanooga, Tennessee, USA
              A comprehensive network diagram is worth 10,000 words and 15 conference calls.
              DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
              Do Not Chat For Help! NO_WAN_EGRESS(TM)

              B 1 Reply Last reply Reply Quote 0
              • B
                BlazeStar @Derelict
                last edited by

                On the client side, I don't want to make anything available.

                On the server side, I just want to make 10.0.3.0/24,10.0.4.0/24 available.

                1 Reply Last reply Reply Quote 0
                • DerelictD
                  Derelict LAYER 8 Netgate
                  last edited by

                  You have to put the networks you are sourcing from in the remote networks on the other side in order to route traffic. Else you have to assign an interface and perform outbound NAT to the tunnel address.

                  You can determine what connections can be made into that side using firewall rules on the OpenVPN tab.

                  Chattanooga, Tennessee, USA
                  A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                  DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                  Do Not Chat For Help! NO_WAN_EGRESS(TM)

                  B 1 Reply Last reply Reply Quote 0
                  • B
                    BlazeStar @Derelict
                    last edited by

                    So basically, on the CLIENT side I should put 10.0.3.0/24,10.0.4.0/24 in IPv4 Remote network(s)

                    and on the SERVER side I should leave blank.

                    Right?

                    DerelictD 1 Reply Last reply Reply Quote 0
                    • RicoR
                      Rico LAYER 8 Rebel Alliance
                      last edited by

                      Check out
                      https://www.netgate.com/resources/videos/site-to-site-vpns-on-pfsense.html
                      to get a basic understanding how it works. :-)

                      -Rico

                      B 1 Reply Last reply Reply Quote 0
                      • DerelictD
                        Derelict LAYER 8 Netgate @BlazeStar
                        last edited by

                        @BlazeStar said in Setting up OpenVPN for new remote office:

                        So basically, on the CLIENT side I should put 10.0.3.0/24,10.0.4.0/24 in IPv4 Remote network(s)

                        and on the SERVER side I should leave blank.

                        Right?

                        No. You have to put the remote networks on each side to be able to route traffic (or implement tunnel address NAT). You control who can connect to what using firewall rules.

                        Yeah, some study into exactly what is going on is likely in order.

                        Chattanooga, Tennessee, USA
                        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                        Do Not Chat For Help! NO_WAN_EGRESS(TM)

                        1 Reply Last reply Reply Quote 0
                        • B
                          BlazeStar @Rico
                          last edited by

                          @Rico said in Setting up OpenVPN for new remote office:

                          Check out
                          https://www.netgate.com/resources/videos/site-to-site-vpns-on-pfsense.html

                          That's the video I watched to set up my stuff.

                          Yet I'm still very puzzled why it doesn't work.

                          Around the end of the video, a few tests are recommended, and when I try them they fail.

                          For example, I try to ping host 10.0.3.20 which is a server I have on the server-side.

                          On the client-side, from pfSense, it works:

                          139b8cab-3693-4c28-9c06-8c41e86988f5-image.png

                          On the client-side, from LAN, it fails!!

                          d45ab070-c5ea-45fe-80bc-74263ab66b97-image.png

                          And in the routing tables I see this:

                          82e0b31b-308d-4ee1-8e2c-1928c67ca8f2-image.png

                          Which appears to me like, once again, this should work!

                          Anything I'm not seeing here??

                          1 Reply Last reply Reply Quote 0
                          • DerelictD
                            Derelict LAYER 8 Netgate
                            last edited by

                            Does the server side have a route back to 192.168.1.1?

                            Chattanooga, Tennessee, USA
                            A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                            DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                            Do Not Chat For Help! NO_WAN_EGRESS(TM)

                            B 1 Reply Last reply Reply Quote 0
                            • B
                              BlazeStar @Derelict
                              last edited by

                              @Derelict on the server-side I can see this entry in my routing table:

                              99b6e77f-6974-4b27-9161-e50e7cc70bd2-image.png

                              So I would say yes there's a route back.

                              Is that what you meant?

                              B 1 Reply Last reply Reply Quote 0
                              • B
                                BlazeStar @BlazeStar
                                last edited by

                                And both side have this firewall rule in OpenVPN tab

                                65efe20c-2bee-44de-86a0-82bbfa74a73f-image.png

                                1 Reply Last reply Reply Quote 0
                                • DerelictD
                                  Derelict LAYER 8 Netgate
                                  last edited by

                                  That doesn't look like a route back to me. How does the server side firewall know to route traffic back to 192.168.1.1 over the VPN?

                                  Add 192.168.1.0/24 to the remote networks in the OpenVPN instance on the server side.

                                  Chattanooga, Tennessee, USA
                                  A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                  DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                  Do Not Chat For Help! NO_WAN_EGRESS(TM)

                                  1 Reply Last reply Reply Quote 0
                                  • B
                                    BlazeStar
                                    last edited by

                                    Damn.

                                    So I made a typo in the IPv4 Remote network(s) on the server-side.

                                    Now everything works.

                                    Thank you so much for you help @Derelict

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