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

    NAT Connection refused

    Scheduled Pinned Locked Moved NAT
    38 Posts 4 Posters 9.6k 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.
    • S
      scopa
      last edited by

      • What's "WAN_email"? Is that the same thing like the "External IP" in 1:1 NAT or not?
      • yes

      What's "LAN_email"? It that the same thing like "Internal IP" in the 1:1 NAT or not?

      • yes

      I use a custom ssh port for the firewall as well. That was auto generated when I modified the default port

      Thanks again for your help

      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by

        @scopa:

        • What's "WAN_email"? Is that the same thing like the "External IP" in 1:1 NAT or not?
        • yes

        What's "LAN_email"? It that the same thing like "Internal IP" in the 1:1 NAT or not?

        • yes

        Then - as already noted multiple times -  either use 1:1 NAT, or port forwards. NOT both!!!

        I use a custom ssh port for the firewall as well. That was auto generated when I modified the default port

        You won't be able to reach your pfSense SSH from WAN at all.

        1 Reply Last reply Reply Quote 0
        • S
          scopa
          last edited by

          That is how I originally had it setup - but one of the links you sent say

          Yes, 1:1 NAT may be used from the WAN IP address to an internal IP address. But be aware that this maps every port and services on the firewall will no longer be reachable from the outside. To reach the firewall from the outside, port forward entries must be added to negate the 1:1 NAT for the specific ports on the firewall to be reached.

          This says that you need to use both WTF?

          Doesn't matter have tried it multiple ways by now - w/ Port Forwarding and NAT, NAT only, Port Forwarding only - nothing works

          If I open up 40809 on wan to firewall why can't I reach my pfsense via SSH?

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            I give up. Get paid support.

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

              Delete it all and start over again.  You don't need 1:1 NAT.  Add the port forwards - one at a time.  Testing all the way to be sure it's doing what you want.  Stop and ask for help at the point you hit a block, not after you've over-complicated it again.

              You are all over the place with this.  Take a step back and add one thing at a time.

              This all just works.

              And, again:

              https://doc.pfsense.org/index.php/How_can_I_forward_ports_with_pfSense
              https://doc.pfsense.org/index.php/Port_Forward_Troubleshooting

              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
              • johnpozJ
                johnpoz LAYER 8 Global Moderator
                last edited by

                So you posted your public IP that 50.x.x.157 IP  Is that your only IP or do you have more than 1?

                I would get your port forwarding with 1 IP working - follow the instructions provided by Derelict.. This really is click click done..  First thing I would do is enable icmp to your wan IP.  We can then validate that we can ping your IP.. You can then validate that traffic is atleast getting to your wan with a sniff, etc.

                You do not need or normally want 1:1 nat.. You only have a few ports you need open, this should be click done all of 10 seconds to setup.

                Once you have cleared up this mess you have.  Please enable icmp to your wan.  And we can validate we can atleast ping you..

                So right now I am pinging that 50.x.x.157 address

                root@ns1:~# ping 50.xx.xx.157
                PING 50.xx.xx.157 (50.xx.xx.157) 56(84) bytes of data.
                64 bytes from 50.xx.xx.157: icmp_seq=1 ttl=49 time=93.2 ms
                64 bytes from 50.xx.xx.157: icmp_seq=2 ttl=49 time=91.2 ms
                64 bytes from 50.xx.xx.157: icmp_seq=3 ttl=49 time=93.1 ms

                But can not get to 25 on that ip

                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.8, 24.11

                1 Reply Last reply Reply Quote 0
                • S
                  scopa
                  last edited by

                  I deleted all the NAT rules and Firewall Rules

                  Created port forwarding rule - to port 40809 and anotther for port 25

                  SSH works behind the firewall and port 25 is listening on the server

                  Since all incoming connections are "connection refused"

                  What else can be causing this to be dropped. Should I disable the NAT settings in System -> Advanced? (attached)

                  Thanks for your help

                  1 Reply Last reply Reply Quote 0
                  • S
                    scopa
                    last edited by

                    I attached a small capture but the firewall is dropping this connection. There has to be someplace on here that is not allowing it through

                    wireshark.pcapng

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

                      Common Problems

                      1. NAT and firewall rules not correctly added (see How can I forward ports with pfSense?)

                      Hint: Do NOT set a source port

                      2. Firewall enabled on client machine

                      3. Client machine is not using pfSense as its default gateway

                      4. Client machine not actually listening on the port being forwarded

                      5. ISP or something upstream of pfSense is blocking the port being forwarded

                      6. Trying to test from inside the local network, need to test from an outside machine

                      7. Incorrect or missing Virtual IP configuration for additional public IP addresses

                      8. The pfSense router is not the border router. If there is something else between pfSense and the ISP, the port forwards and associated rules must be replicated there.

                      9. Forwarding ports to a server behind a Captive Portal. An IP bypass must be added both to and from the server's IP in order for a port forward to work behind a Captive Portal.

                      10. If this is on a WAN that is not the default gateway, make sure there is a gateway chosen on this WAN interface, or the firewall rules for the port forward would not reply back via the correct gateway.

                      11. If this is on a WAN that is not the default gateway, ensure the traffic for the port forward is NOT passed in via Floating Rules or an Interface Group. Only rules present on the WAN's interface tab under Firewall Rules will have the reply-to keyword to ensure the traffic responds properly via the expected gateway.

                      12. If this is on a WAN that is not the default gateway, make sure the firewall rule(s) allowing the traffic in do not have the box checked to disable reply-to.

                      13. If this is on a WAN that is not the default gateway, make sure the master reply-to disable switch is not checked under System > Advanced, on the Firewall/NAT tab.

                      14. WAN rules should NOT have a gateway set, so make sure that the rules for the port forward do NOT have a gateway configured on the actual rule.

                      15. If the traffic appears to be forwarding in to an unexpected device, it may be happening due to UPnP. Check Status > UPnP to see if an internal service has configured a port forward unexpectedly. If so, disable UPnP on either that device or on the firewall.

                      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
                      • S
                        scopa
                        last edited by

                        Thanks for the reply.

                        I am testing from outside - from inside everything works. Source port is not set.

                        Everything works fine with my old firewall/router - with NAT setup for same machines/ports

                        The only thing I am not familiar with is: 7. Incorrect or missing Virtual IP configuration for additional public IP addresses - I do not have any Virtual IP config settings -

                        It is on the WAN that IS the default gateway, not using captive portal.

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

                          That packet trace you sent says otherwise:

                          Internet Protocol Version 4, Src: 192.168.2.87 (192.168.2.87), Dst: 50.X.X.57 (50.X.X.57)

                          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
                          • S
                            scopa
                            last edited by

                            No it doesn't that is the LAN IP on a remote network. Again - I can swap in my old firewall/router (verizon tek) and everything works. And behind the PF sense firewall I can access everything. Server is listening on intended ports.

                            Also - if it was the servers - the PF Sense firewall would have log entries allowing the traffic through - I am not getting any entries in the log for any incoming traffic to the intended servers on their intended ports

                            Since I am not getting any log entries I am stumped. I have logging enabled on the firewall rules for the port forwarding traffic.

                            1 Reply Last reply Reply Quote 0
                            • D
                              doktornotor Banned
                              last edited by

                              Oh, LAN IP on remote network…. ROFL.

                              Dude, draw a fucking network diagram with NO BULLSHIT there. I mean, the REAL one.

                              You've wasted hours of time of multiple people with this crap. It takes about a minute to set up and works out of the box. Post the real thing if you want help. Otherwise, GTFO!

                              :( >:( >:(

                              1 Reply Last reply Reply Quote 0
                              • S
                                scopa
                                last edited by

                                WTF is wrong with you - I have posted all the real thing. No shit it just works. Not my first rodeo chief.

                                This isn't working. its my first PF install.

                                There is not fucking diagram to draw.

                                External Port forward to same Internal Port -traffic getting dropped on firewall. No fucking magic.

                                What other screen shots do I have to post for you to offer some suggestions outside of snide remarks.

                                1 Reply Last reply Reply Quote 0
                                • D
                                  doktornotor Banned
                                  last edited by

                                  I want the REAL thing. No "multiple public IPs on LAN" bullshit and similar crap when you have 192.168.x.x stuff on LAN. Just the REAL thing. Yeah, it isn't working. Because you are asking for help and instead of relevant info, you are posting utterly misleading shit over and over again.

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

                                    So you're testing from private networks outside of WAN? How are we supposed to know that? Did you uncheck "Block private networks" on the WAN interface? Uncheck block bogons while you're in there.

                                    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
                                    • S
                                      scopa
                                      last edited by

                                      yes tried that and rebooted just to make sure changes were applied - does not work.

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

                                        You keep saying when you put the other firewall in place it works.  pfSense and that firewall have the same inside IP address right?  And the default gateway of your server is pointed at that ONE address right?

                                        Post CURRENT screen shots of:

                                        Firewall > NAT, Port Forward tab

                                        Firewall > NAT, 1:1 tab

                                        Firewall > Rules, WAN tab

                                        Don't make any changes, just post them.

                                        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
                                        • First post
                                          Last post
                                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.