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

Port Forwarding w/ OpenVPN Tunnel - What am I doing wrong?

NAT
3
35
2.3k
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 @techboot
    last edited by Jan 14, 2024, 4:35 PM

    @techboot
    This whole thread is already pretty confusing. In the screenshot above on the VPN interface, I can see public source IP. But then you say, the provider replaces it with a private one (masquerading)...

    To get a step beyond, do a simple test, please:
    Add an outbound NAT rule for the incoming traffic:
    Interface: LAN
    source: any
    destination: <server IP>/32
    translation: interface address

    Check if you get access from outside.

    T 1 Reply Last reply Jan 14, 2024, 4:41 PM Reply Quote 0
    • T
      techboot @viragomann
      last edited by Jan 14, 2024, 4:41 PM

      @viragomann

      To clarify when you say "server ip" do you want the public ip as seen in the screenshot or the assigned internal IP via Masquerading?

      V 1 Reply Last reply Jan 14, 2024, 4:43 PM Reply Quote 0
      • V
        viragomann @techboot
        last edited by viragomann Jan 14, 2024, 4:46 PM Jan 14, 2024, 4:43 PM

        @techboot
        It's local IP.

        Edit:
        also flush the states after adding the rule.

        T 1 Reply Last reply Jan 14, 2024, 4:58 PM Reply Quote 0
        • T
          techboot @viragomann
          last edited by Jan 14, 2024, 4:58 PM

          @viragomann

          No change. To confirm:

          NAT:
          🔒 Log in to view

          Outbound NAT:
          🔒 Log in to view

          Rules (VPN Interface)
          🔒 Log in to view

          VPN Provider Port Check Tool: (Note, telnet to the public IP from an outside IP (ie: an Azure VPS, yields the same result)
          🔒 Log in to view

          --

          In an effort to maybe make this easier, should I delete this thread and re-make it? I will remove all of the rules, NAT, etc.. reboot for good measure and start over with all of the details / information in one post based on your feedback and comments thus far?

          V 1 Reply Last reply Jan 14, 2024, 5:03 PM Reply Quote 0
          • V
            viragomann @techboot
            last edited by Jan 14, 2024, 5:03 PM

            @techboot said in Port Forwarding w/ OpenVPN Tunnel - What am I doing wrong?:

            NAT:

            And the mess goes on...
            10.13.31.22 is your VPN interface address. The NAT IP has to be your internal server IP!

            Also you should limit the destination IP. Your may set it to the interface address.

            T 1 Reply Last reply Jan 14, 2024, 5:04 PM Reply Quote 0
            • T
              techboot @viragomann
              last edited by Jan 14, 2024, 5:04 PM

              @viragomann

              10.13.31.22 is my internal IP.

              The 10.65.130.4 is the IP assigned by the VPN provider.

              V 1 Reply Last reply Jan 14, 2024, 5:07 PM Reply Quote 0
              • V
                viragomann @techboot
                last edited by Jan 14, 2024, 5:07 PM

                @techboot
                Ah ya. So you need to edit the outbound NAT rule and correct the destination IP.

                T 1 Reply Last reply Jan 14, 2024, 5:13 PM Reply Quote 0
                • T
                  techboot @viragomann
                  last edited by Jan 14, 2024, 5:13 PM

                  @viragomann

                  Cleared States.

                  🔒 Log in to view

                  --
                  🔒 Log in to view

                  --

                  I am confused what you mean by limit the destination IP and limit to the interface address. I assume you mean on the port forward tab?

                  V 1 Reply Last reply Jan 14, 2024, 5:16 PM Reply Quote 0
                  • V
                    viragomann @techboot
                    last edited by Jan 14, 2024, 5:16 PM

                    @techboot said in Port Forwarding w/ OpenVPN Tunnel - What am I doing wrong?:

                    I assume you mean on the port forward tab?

                    Yes.

                    In the LAN outbound NAT rule correct the translation to interface address, please, which is the default setting.

                    T 1 Reply Last reply Jan 14, 2024, 5:23 PM Reply Quote 0
                    • T
                      techboot @viragomann
                      last edited by Jan 14, 2024, 5:23 PM

                      @viragomann

                      I think I have now gone and confused myself in all of this. Thank you for bearing with me.

                      Like this?

                      🔒 Log in to view

                      V 1 Reply Last reply Jan 14, 2024, 5:26 PM Reply Quote 0
                      • V
                        viragomann @techboot
                        last edited by Jan 14, 2024, 5:26 PM

                        @techboot
                        destination: internal server IP with /32 mask
                        translation: LAN address

                        T 2 Replies Last reply Jan 14, 2024, 5:33 PM Reply Quote 0
                        • T
                          techboot @viragomann
                          last edited by Jan 14, 2024, 5:33 PM

                          @viragomann

                          🔒 Log in to view

                          Cleared States, No Change via Telnet or Port Tool.

                          1 Reply Last reply Reply Quote 0
                          • T
                            techboot @viragomann
                            last edited by techboot Jan 15, 2024, 9:59 PM Jan 15, 2024, 9:56 PM

                            @viragomann

                            Question on this...

                            🔒 Log in to view

                            These are my current OpenVPN Client (towards the VPN Provider) Settings... I was under the impression that I wanted the "Dont Pull Routes" checkbox selected, since that would otherwise set the default gateway for the whole router towards the VPN provider.

                            In my case, I want to only route specific IP's out via the VPN, which DOES currently work.

                            Could this actually be some of my port forward issues?

                            Edit: this is the documentation pertain to port forwarding from the VPN provider: https://airvpn.org/faq/port_forwarding/

                            V 1 Reply Last reply Jan 15, 2024, 10:26 PM Reply Quote 0
                            • V
                              viragomann @techboot
                              last edited by Jan 15, 2024, 10:26 PM

                              @techboot said in Port Forwarding w/ OpenVPN Tunnel - What am I doing wrong?:

                              These are my current OpenVPN Client (towards the VPN Provider) Settings... I was under the impression that I wanted the "Dont Pull Routes" checkbox selected, since that would otherwise set the default gateway for the whole router towards the VPN provider.

                              That's correct. You don't need routes, since you do policy routing for outbound traffic.

                              Edit: this is the documentation pertain to port forwarding from the VPN provider: https://airvpn.org/faq/port_forwarding/

                              There is nothing mentioned, that the provider does masquerading as you stated above.
                              If he doesn't masquerading you need to enable reply-to for proper reply-routing.

                              For a quick test if this is the issue, remove the "Don't pull routes" check, ensure that the VPN is shown as default gateway in Status > Gateway, then test the access.

                              T 1 Reply Last reply Jan 15, 2024, 10:32 PM Reply Quote 0
                              • T
                                techboot @viragomann
                                last edited by Jan 15, 2024, 10:32 PM

                                @viragomann

                                Will try shortly.

                                To clarify, this is the only information that shows how they (provider's port check tool) works.

                                🔒 Log in to view

                                To me, that's public -> pfsense (as VPN client 10.65.138.204) -> LAN client (10.13.31.22)

                                V 1 Reply Last reply Jan 15, 2024, 10:36 PM Reply Quote 0
                                • V
                                  viragomann @techboot
                                  last edited by Jan 15, 2024, 10:36 PM

                                  @techboot
                                  I don't expect, that the provider knows your LAN clients IP.

                                  T 1 Reply Last reply Jan 15, 2024, 10:45 PM Reply Quote 0
                                  • T
                                    techbooties @viragomann
                                    last edited by Jan 15, 2024, 10:45 PM

                                    @viragomann

                                    You make a fair point. I should have been more specific, but I added my LAN client IP for completeness. Apologies there.

                                    However, with the test by disabling the don't pull routes .. success

                                    🔒 Log in to view

                                    🔒 Log in to view

                                    Understandably now my whole LAN is out the VPN, but how would I set reply-to for the proper routing as you mentioned?

                                    V 1 Reply Last reply Jan 15, 2024, 10:51 PM Reply Quote 0
                                    • V
                                      viragomann @techbooties
                                      last edited by Jan 15, 2024, 10:51 PM

                                      @techbooties
                                      You need to remove the pass rule from the OpenVPN tab.

                                      If you are running an OpenVPN server come back with the info to elaborate, how you get access then.

                                      T 1 Reply Last reply Jan 15, 2024, 11:08 PM Reply Quote 0
                                      • T
                                        techbooties @viragomann
                                        last edited by Jan 15, 2024, 11:08 PM

                                        @viragomann

                                        I am using an OpenVPN server. I will try and specify my setup specifically for you.

                                        I have a single LAN. No VLAN's. I have a few machines in my homelab, one is (10.13.31.22).

                                        I have a primary internet connection, which should be used for all of my clients, EXCEPT those that are in the "VPNAccess" alias group. In this case, only 10.13.31.22 is listed.

                                        I have a VPN provider connection with a third party (airVPN) via the pfSense router, that I would like the members of VPNAccess alias group to use as their primary means of internet access. I would also like to use port forwarding with the VPN provider towards specific members of the VPNAccess alias (10.13.31.22 specifically).

                                        I have an OpenVPN Server, which I use for remote access to my home network. (ipad, raspberry pi remote backup, etc.) It is using only my primary internet connection. It's on the pfSense box directly, not via some other machine behind the router.

                                        V 1 Reply Last reply Jan 15, 2024, 11:24 PM Reply Quote 0
                                        • V
                                          viragomann @techbooties
                                          last edited by Jan 15, 2024, 11:24 PM

                                          @techbooties
                                          If it's an OpenVPN access server limit the source in the OpenVPN pass rule to its tunnel network.

                                          T 1 Reply Last reply Jan 15, 2024, 11:40 PM Reply Quote 0
                                          22 out of 35
                                          • First post
                                            22/35
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.