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

      Since all servers behind firewall have a public static IP I will do 1:1 NAT

      In that case I will remove the Port Forwarders

      Now - when I setup the rules for the 1:1 Nat servers - I set up the rules on the WAN INT - is the destination address the WAN IP or Internal IP of intended server?

      Thanks,

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

        I already linked this on the other thread! https://doc.pfsense.org/index.php/1:1_NAT

        Read it. NOW.

        Also:
        https://doc.pfsense.org/index.php/Can_I_use_1:1_NAT_on_my_WAN_IP
        https://doc.pfsense.org/index.php/Do_NAT_port_forwards_override_1:1_NAT

        @scopa:

        Since all servers behind firewall have a public static IP I will do 1:1 NAT

        Errr… 192.168.5.220 is NOT a public (routable IP). Neither is 192.168.1.50. Both of those are RFC1918... If you had public IPs on LAN, there'd be no point in doing any NAT. In general, by posting totally misleading and confusing information, you are just wasting everyone's time, not to mention that it prevents people from providing relevant advise.

        :(

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

          ok.ok… so should be mapped to internal port

          But reading this:

          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.

          So dont' use 1:1 NAT for my purpose and use the port forwarding only?

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

            What??? You just told us that "all servers behind firewall have a public static IP".

            Look, as already hinted in my previous post, I have absolutely no clue about your setup. Post some real information.

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

              Here are my settings:

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

                • What's "WAN_email"? Is that the same thing like the "External IP" in 1:1 NAT or not?
                • What's "LAN_email"? It that the same thing like "Internal IP" in the 1:1 NAT or not?
                • What's TCP 40809? Why's it both in antilockout and port forward?!
                • Where have all those other "servers with static public IP" vanished?!

                Looking at the setup and the generic mess, I have some extremely strange feeling I have seen this somewhere. Was about ~10 pages thread full of beep!

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

                  WAN_email is public email ip alias
                  LAN_email same thing

                  40809 is custom ssh port

                  Where have all those other "servers with static public IP" vanished

                  -just trying to get my mail server working right now - once working should be easy to get the others online

                  Thanks,

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

                    @scopa:

                    WAN_email is public email ip alias
                    LAN_email same thing

                    That was not my question.

                    @scopa:

                    40809 is custom ssh port

                    And why's it used both on pfSense and forwarded somewhere else ("email" server)?!

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