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

Port forwarding to Docker server

Scheduled Pinned Locked Moved General pfSense Questions
20 Posts 3 Posters 3.0k 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.
  • D
    dridhas
    last edited by Oct 18, 2021, 7:37 PM

    Hello,

    Recently got pfsense running and the only thing im missing is to configure the access to my docker server using my subdomains.
    if i enter my external ip address i get the pfsense web gui.
    This is what i have for the port forwarding rule:
    45942312-1b10-431e-84b1-d1840f0b92e9-image.png

    and with this i get a certificate error which i can tell its the selfcert from pfsense.

    now, within docker i have Nginx proxy manager that handles the accesses to the different containers via their own subdomain.
    with the ISP modem it was just Modem > port 443 to 4443 > container.

    the LAN firewall rule has no blocks.

    would you be able to guide me on being able to reach the nginx proxy manager using
    port forwarding?

    Thanks in advance!

    V 1 Reply Last reply Oct 18, 2021, 7:42 PM Reply Quote 0
    • V
      viragomann @dridhas
      last edited by Oct 18, 2021, 7:42 PM

      @dridhas said in Port forwarding to Docker server:

      if i enter my external ip address i get the pfsense web gui

      Set the web configurator to listen on any other port in the advanced settings > admin page.

      D 1 Reply Last reply Oct 18, 2021, 7:54 PM Reply Quote 0
      • D
        dridhas @viragomann
        last edited by Oct 18, 2021, 7:54 PM

        @viragomann ok, webconfigurator's port has been updated to something else.
        now when i enter the external ip, nothing happens which is good... 😊

        next step is to be able to enter my subdomain to reach the container server 😃

        J V 2 Replies Last reply Oct 18, 2021, 7:58 PM Reply Quote 0
        • J
          johnpoz LAYER 8 Global Moderator @dridhas
          last edited by Oct 18, 2021, 7:58 PM

          @dridhas said in Port forwarding to Docker server:

          next step is to be able to enter my subdomain to reach the container server

          You really need to test this from outside your network... If your trying to hit your wan IP from something internal, you would need to do split dns to resolve to the local IP or you would need to setup nat reflection.

          https://docs.netgate.com/pfsense/en/latest/recipes/port-forwards-from-local-networks.html

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.7.2, 24.11

          D 1 Reply Last reply Oct 18, 2021, 8:19 PM Reply Quote 0
          • V
            viragomann @dridhas
            last edited by Oct 18, 2021, 7:59 PM

            @dridhas
            And the source in the port forwarding should be "any".

            1 Reply Last reply Reply Quote 0
            • D
              dridhas @johnpoz
              last edited by Oct 18, 2021, 8:19 PM

              @johnpoz im testing this outside my home network (cellphone on LTE)

              J 1 Reply Last reply Oct 18, 2021, 8:22 PM Reply Quote 0
              • J
                johnpoz LAYER 8 Global Moderator @dridhas
                last edited by johnpoz Oct 18, 2021, 8:25 PM Oct 18, 2021, 8:22 PM

                @dridhas as @viragomann mentions - this is wrong

                broke.jpg

                While it doesn't actually have to be "any" it sure can not be your wan address. Would your phone coming from your LTE connection be using your wan address ;) heheh as its IP..

                I have many of my port forwards locked down to certain source IP ranges, my son's IP for example for one. I use pfblocker alias to limit to say US IPs for other, etc. But yeah wan address as source is never going to work ;)

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                D 1 Reply Last reply Oct 18, 2021, 8:55 PM Reply Quote 0
                • D
                  dridhas @johnpoz
                  last edited by Oct 18, 2021, 8:55 PM

                  @johnpoz i updated the PortForwarding rule to this:
                  5c33fe3d-aedc-431d-b526-7bf5cbadb957-image.png
                  and now im getting a 502 Bad gateway.
                  which i would say its an improvement... 😃

                  V 1 Reply Last reply Oct 18, 2021, 9:14 PM Reply Quote 0
                  • V
                    viragomann @dridhas
                    last edited by Oct 18, 2021, 9:14 PM

                    @dridhas
                    The destination has to be "WAN address". This is the IP you are accessing from outside. Only the source cannot be WAN address.

                    D 1 Reply Last reply Oct 18, 2021, 9:50 PM Reply Quote 0
                    • D
                      dridhas @viragomann
                      last edited by Oct 18, 2021, 9:50 PM

                      @viragomann got that updated and still cant access the server from outside... 😞

                      V 1 Reply Last reply Oct 18, 2021, 9:57 PM Reply Quote 0
                      • V
                        viragomann @dridhas
                        last edited by Oct 18, 2021, 9:57 PM

                        @dridhas
                        And what do you get now?

                        Is there any state or traffic shown at the associated rule in Firewall > Rules > WAN?

                        D 1 Reply Last reply Oct 18, 2021, 10:01 PM Reply Quote 0
                        • D
                          dridhas @viragomann
                          last edited by Oct 18, 2021, 10:01 PM

                          @viragomann this is what ive got:

                          c2f03070-3143-410d-819d-19d3bc6b6ee3-image.png

                          V 1 Reply Last reply Oct 18, 2021, 10:09 PM Reply Quote 0
                          • V
                            viragomann @dridhas
                            last edited by Oct 18, 2021, 10:09 PM

                            @dridhas
                            So it shows some traffic already.

                            Are the gateway settings correct on the destination device?

                            To investigate take a packet capture (in Diagnostic menu) on the internal interface facing to the destination device. Specify the port 4443 for filtering. Start the capture and try an access from outside.

                            If you network settings are correct you should see request and response packets. Post what you get, please.

                            D 1 Reply Last reply Oct 18, 2021, 10:18 PM Reply Quote 0
                            • D
                              dridhas @viragomann
                              last edited by Oct 18, 2021, 10:18 PM

                              @viragomann i dont see any packets being captured, it shows blank 48665b11-c12c-4ff5-97f9-6a04fe408b7e-image.png

                              V J 2 Replies Last reply Oct 18, 2021, 10:22 PM Reply Quote 0
                              • V
                                viragomann @dridhas
                                last edited by Oct 18, 2021, 10:22 PM

                                @dridhas
                                Dude, you NAT rule is wrong again!
                                The source port has to be "any", as well as the source IP!
                                The destination is "WAN address", destination port "443"!
                                At redirect target port you can enter your internal destination port, which might be 4443.

                                1 Reply Last reply Reply Quote 0
                                • J
                                  johnpoz LAYER 8 Global Moderator @dridhas
                                  last edited by johnpoz Oct 18, 2021, 10:57 PM Oct 18, 2021, 10:54 PM

                                  @dridhas Here is example port forward to different port external to what the port this is sent to the server port.. With the associated firewall rule.

                                  Just where mine is locked down to a specific pfblocker alias - yours should be any.

                                  rules.jpg

                                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                                  If you get confused: Listen to the Music Play
                                  Please don't Chat/PM me for help, unless mod related
                                  SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                                  D 1 Reply Last reply Oct 18, 2021, 10:57 PM Reply Quote 0
                                  • D
                                    dridhas @johnpoz
                                    last edited by Oct 18, 2021, 10:57 PM

                                    @johnpoz @viragomann sooooo... i got frustrated and decided to nuke pfsense and start fresh.
                                    now, a few minutes after and following the advice provided above, i got able to do the port forwarding successfully. 😃

                                    i can now access my docker server from outside my network. 🍾

                                    now its turn for the internal access, but first, i need to reconfigure the wifi... 😃

                                    this is how the WAN rules look so far:
                                    50392387-a2d4-4d16-89ec-f9b8da451498-image.png

                                    and as you can see, there is more traffic now flowing thru. 😃

                                    J 1 Reply Last reply Oct 18, 2021, 10:58 PM Reply Quote 0
                                    • J
                                      johnpoz LAYER 8 Global Moderator @dridhas
                                      last edited by Oct 18, 2021, 10:58 PM

                                      @dridhas said in Port forwarding to Docker server:

                                      now its turn for the internal access

                                      huh? Why would you do that?

                                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                                      If you get confused: Listen to the Music Play
                                      Please don't Chat/PM me for help, unless mod related
                                      SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                                      D 2 Replies Last reply Oct 18, 2021, 11:04 PM Reply Quote 0
                                      • D
                                        dridhas @johnpoz
                                        last edited by Oct 18, 2021, 11:04 PM

                                        @johnpoz i started the pfsense project a couple of days ago when i upgraded the home network, i didnt have much configs to worry about.
                                        now that i have this setup and running correctly, i can create a backup just in the event i need to nuke it once again... 😃

                                        1 Reply Last reply Reply Quote 0
                                        • D
                                          dridhas @johnpoz
                                          last edited by Oct 19, 2021, 2:54 AM

                                          @johnpoz so, after a hiccup, somehow i forgot to assign static dhcp address to the server and the access to docker server stopped working.
                                          Once the DHCP static ip was set, everything went back to normal.. 😃

                                          1 Reply Last reply Reply Quote 0
                                          20 out of 20
                                          • First post
                                            20/20
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received