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

    Port forwarding problems

    Scheduled Pinned Locked Moved NAT
    43 Posts 6 Posters 13.4k 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
      dimkyson
      last edited by

      Did you defined static routes or is there a second router in your network which reaches the other lan networks? What is the client default gateway? Could you ping all the clients defined from the pfsense "ping tool"?

      1 Reply Last reply Reply Quote 0
      • K
        kevindd992002
        last edited by

        @Gloom:

        Well I see incoming traffic for 192.168.1.2 but I'm not seeing an outgoing response.
        Off the top of my head it's a routing issue. Is the LAN interface the default route? Try doing a traceroute from the device 192.168.1.2 and see where it thinks the packet should go.

        So that means that the port forwarding works, right?

        The default gateway is WAN2 as set by pfsense. From the device 192.168.1.2, which IP should I do a traceroute to? By the way, 192.168.1.2 is a switch (switch-configured linksys router) that has a webgui.

        @dimkyson:

        Did you defined static routes or is there a second router in your network which reaches the other lan networks? What is the client default gateway? Could you ping all the clients defined from the pfsense "ping tool"?

        My setup is like this:

        The default gateway is WAN2. If I setup the interface as LAN in the ping tool of pfsense, yes I can ping all the clients.

        1 Reply Last reply Reply Quote 0
        • G
          Gloom
          last edited by

          If you know the address of the person trying to connect try that IP. Otherwise just do a traceroute to something like www.bbc.co.uk or your local google site. Also take a look at your firewall logs just to make sure it's not blocking outgoing traffic.

          I'm assuming the switch is just a standard layer 2 device with no acls or VLANs defined on it but if it has and it won't do a traceroute outside your network maybe post the running conf although that is getting beyond the scope of these forums but we do try to help.

          Yes your port forward appears to be working correctly.

          Never underestimate the power of human stupidity

          1 Reply Last reply Reply Quote 0
          • K
            kevindd992002
            last edited by

            @Gloom:

            If you know the address of the person trying to connect try that IP. Otherwise just do a traceroute to something like www.bbc.co.uk or your local google site. Also take a look at your firewall logs just to make sure it's not blocking outgoing traffic.

            I'm assuming the switch is just a standard layer 2 device with no acls or VLANs defined on it but if it has and it won't do a traceroute outside your network maybe post the running conf although that is getting beyond the scope of these forums but we do try to help.

            Yes your port forward appears to be working correctly.

            Ok. Should I copy here the result of the traceroute and my firewall logs?

            Yes, the switch is a standard non-managed switch, so no worries on that.

            When port forwarding, do you usually specify the source port? Which port would the source use anyway when accessing my devices from outside the network?

            1 Reply Last reply Reply Quote 0
            • G
              Gloom
              last edited by

              It will be a random port for the source. Yes you can post the traceroute just obscure the IP if it's not to a public server.

              Never underestimate the power of human stupidity

              1 Reply Last reply Reply Quote 0
              • K
                kevindd992002
                last edited by

                @Gloom:

                It will be a random port for the source. Yes you can post the traceroute just obscure the IP if it's not to a public server.

                Ok, I'll do that.

                Why will it be a random port? I thought the source port is also, usually, the destination port?

                1 Reply Last reply Reply Quote 0
                • C
                  cmb
                  last edited by

                  @kevindd992002:

                  I thought the source port is also, usually, the destination port?

                  No. Almost never.

                  http://en.wikipedia.org/wiki/Ephemeral_port

                  1 Reply Last reply Reply Quote 0
                  • K
                    kevindd992002
                    last edited by

                    @cmb:

                    @kevindd992002:

                    I thought the source port is also, usually, the destination port?

                    No. Almost never.

                    http://en.wikipedia.org/wiki/Ephemeral_port

                    So it's always random?

                    1 Reply Last reply Reply Quote 0
                    • G
                      Gloom
                      last edited by

                      So it's always random?

                      Short answer yes.
                      Long answer. It is possible to force the use of a specific port or range but unless you understand the full implications of making such changes it's probable safer to just accept the short answer.

                      I'd like to see your issue resolved so any info you could post would help. There is nothing worse than finding a forum post that resembles your problem and after reading through them all finding it just stops with no resolution.

                      Never underestimate the power of human stupidity

                      1 Reply Last reply Reply Quote 0
                      • K
                        kevindd992002
                        last edited by

                        @Gloom:

                        So it's always random?

                        Short answer yes.
                        Long answer. It is possible to force the use of a specific port or range but unless you understand the full implications of making such changes it's probable safer to just accept the short answer.

                        I'd like to see your issue resolved so any info you could post would help. There is nothing worse than finding a forum post that resembles your problem and after reading through them all finding it just stops with no resolution.

                        Ok.

                        Oh no, it won't stop with no answer. I will post the results of the traceroute in a while. I'm actually not inside the firewall network for a few days now and I just remotely access it which is why I didn't post sooner. I will do this now and post back.

                        1 Reply Last reply Reply Quote 0
                        • K
                          kevindd992002
                          last edited by

                          I just tried doing a traceroute from 192.168.1.2 and there were no results. I guess because it's setup as a transparent switch? It's actually setup as a "DHCP Forwarder".

                          1 Reply Last reply Reply Quote 0
                          • G
                            Gloom
                            last edited by

                            No a DHCP forwarder is simple a setting to forwarding bootp traffic from a subnet with no DHCP server to a DHCP server in a different subnet. It's required because bootp does not route across subnets.

                            Are you running the trace from the command line on the switch. My memory of the HP command set is a little rusty as we are a cisco shop these days but it should be something like

                            ip unreachables enable
                            ip ttl-expires enable
                            tracert 91.220.52.1

                            That should trace through to one of our BGP routers.

                            perhaps as a check before you try the traceroute from the cli run show running config you should then be able to identify the default gateway is correctly set to the pfsense box.
                            I'm trying to second guess the issue here so I'd also be checking that the DHCP server is giving out the correct default gateway to the other boxes having an problem.

                            Never underestimate the power of human stupidity

                            1 Reply Last reply Reply Quote 0
                            • K
                              kevindd992002
                              last edited by

                              @Gloom:

                              No a DHCP forwarder is simple a setting to forwarding bootp traffic from a subnet with no DHCP server to a DHCP server in a different subnet. It's required because bootp does not route across subnets.

                              Are you running the trace from the command line on the switch. My memory of the HP command set is a little rusty as we are a cisco shop these days but it should be something like

                              ip unreachables enable
                              ip ttl-expires enable
                              tracert 91.220.52.1

                              That should trace through to one of our BGP routers.

                              perhaps as a check before you try the traceroute from the cli run show running config you should then be able to identify the default gateway is correctly set to the pfsense box.
                              I'm trying to second guess the issue here so I'd also be checking that the DHCP server is giving out the correct default gateway to the other boxes having an problem.

                              Ok. Well, that switch device is running dd-wrt and it is connected to pfsense via its LAN ports. I have another dd-wrt router in another house and I can issue traceroute command in its command line using the syntax "traceroute HOST" and it will return me results because that other router is working really as a router where a modem is connected to its WAN port.

                              The show running config command is not a valid command for dd-wrt.

                              1 Reply Last reply Reply Quote 0
                              • K
                                kevindd992002
                                last edited by

                                Here's a screenshot of the main settings of the dd-wrt switch:

                                I think I know the problem. The gateway and local dns are not specified which is why it cannot respond to outside requests?

                                But this switch is accessible via the LAN side of pfsense.

                                1 Reply Last reply Reply Quote 0
                                • K
                                  kevindd992002
                                  last edited by

                                  I specified 192.168.1.1 for both Gateway and Local DNS and IT WORKED! So this NAT entry is solved.

                                  How about the others?

                                  1 Reply Last reply Reply Quote 0
                                  • G
                                    Gloom
                                    last edited by

                                    lol you want your monies worth  ;)

                                    Again I'm going to guess it's a routing issue. What's the OS of the boxes running Sab?

                                    Never underestimate the power of human stupidity

                                    1 Reply Last reply Reply Quote 0
                                    • K
                                      kevindd992002
                                      last edited by

                                      @Gloom:

                                      lol you want your monies worth  ;)

                                      Again I'm going to guess it's a routing issue. What's the OS of the boxes running Sab?

                                      Lol, sorry about that.

                                      Nope, I already solved the SAB problems. I'm pertaining now to entry numbers 3 and 5.

                                      1 Reply Last reply Reply Quote 0
                                      • G
                                        Gloom
                                        last edited by

                                        Sorry I thought I'd already posted what I thought was wrong with the setup to cause 3 and 5
                                        The packet arriving at the 192.168.103.3 interface has the originating IP address of the request ie the computer on the internet. So it responds back but because it's default route is via wan3 the reply goes back to the sender with a different public IP than the one the request was sent to and the remote PC rejects it because it is not expecting a response from that host.
                                        Can't see a fix for it as the default route for wan3 must be out so all I can suggest is that you move the NAT over to the wan3 IP and come in that way.

                                        Never underestimate the power of human stupidity

                                        1 Reply Last reply Reply Quote 0
                                        • K
                                          kevindd992002
                                          last edited by

                                          @Gloom:

                                          Sorry I thought I'd already posted what I thought was wrong with the setup to cause 3 and 5
                                          The packet arriving at the 192.168.103.3 interface has the originating IP address of the request ie the computer on the internet. So it responds back but because it's default route is via wan3 the reply goes back to the sender with a different public IP than the one the request was sent to and the remote PC rejects it because it is not expecting a response from that host.
                                          Can't see a fix for it as the default route for wan3 must be out so all I can suggest is that you move the NAT over to the wan3 IP and come in that way.

                                          Ah. How do you move the NAT over to the wan3 IP?

                                          1 Reply Last reply Reply Quote 0
                                          • K
                                            kevindd992002
                                            last edited by

                                            BUMP!

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