ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Traffic not flowing for hosts behind NAT - Edge Router Lite

    IT Discussion
    edgerouter lite nat routing troubleshooting shouldvewenttojared
    5
    44
    8.1k
    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.
    • JaredBuschJ
      JaredBusch
      last edited by JaredBusch

      I have a few firewall groups setup

      0_1513050921625_3d22fcc4-3909-4f7d-8c7a-9feae9f24177-image.png

      1 Reply Last reply Reply Quote 0
      • JaredBuschJ
        JaredBusch
        last edited by JaredBusch

        The only LAN firewall rules are to block SMTP.
        0_1513050590309_791de323-eb39-47f7-b3ed-6f58b411a277-image.png

        1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch
          last edited by JaredBusch

          For anything you are going to NAT in to something other than the first IP address on the default masquerade, you have to have both firewall rules and NAT destination rules.

          For anything that you want to go out something other than the default masquerade, you have to have a NAT source rule.

          This is the WAN_IN and is likely part of your problem.
          0_1513051040043_b1f33f73-c93c-4897-84c8-c90c83fd5c96-image.png

          This is the NAT (source and destination) rules that are the other part of your problem.
          0_1513051340820_6a93e582-b7f9-4598-92fb-2f9cfdcdb65f-image.png

          1 Reply Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch
            last edited by

            For the screenshots above, the default NAT traffic will show a "What is my IP" as 12.XXX.XXX.42 as that is the first IP listed in the config of the eth0 port.

            All traffic goes out through the default NAT masquerade (shown as order 4 in the Source NAT section) unless there is a Source NAT rule to override it.

            As I have more than one thing happening here, we will just focus on the Nginx ones as the stuff not going through the default masquerade.

            A Source NAT is used for outbound traffic. You are the source of the traffic.
            A Destination NAT is used for inbound traffic. You are the destination of the traffic.

            So to send traffic from the server with an internal IP address of 10.202.1.16 out the external IP address of 12.XXX.XXX.43 instead of the default masquerade external IP of 12.XXX.XXX.42 we need to make a Source NAT rule.

            Make a rule and fill it out like this. Obviously, there are a lot more options here than I am going over. If you have multiple machines that you need to use this IP outbound, then create a firewall group and select the Src Address Group drop down instead of specifying the IP address as I did here.
            0_1513052200070_28b7cb4c-bc2f-45c4-ae80-58239899fb8c-image.png

            Now if you check your What is my IP from the specified server, it should return the 12.XX.XXX.43

            1 Reply Last reply Reply Quote 0
            • JaredBuschJ
              JaredBusch
              last edited by JaredBusch

              The inbound is harder because you have to setup both a Destination NAT rule as well as allow it on the firewall's WAN_IN rule.

              First make the Destination NAT rule as you are already on this screen from making the Source NAT rule.

              As you can see you simply reverse what you did in the Source NAT rule. This time the local IP goes in the Translation and the WAN IP goes in the Dest Address field. Anything coming in on this destination IP will be translated to this local IP.

              As you can also see, I further restricted this translation to only be TCP/UDP and only ports included in a firewall port group.

              0_1513052577232_ad66034c-d43d-4dce-aebc-072f5dd30be5-image.png
              0_1513052587003_916bd970-31a6-4adc-99eb-097d1d350ce5-image.png

              In case you are curious, here are the ports in that firewall port group.
              0_1513052906915_f6792677-5814-4a5e-9ea8-c8ab22567101-image.png

              1 Reply Last reply Reply Quote 1
              • JaredBuschJ
                JaredBusch
                last edited by JaredBusch

                Now make a firewall rule in the policy assigned to the IN direction of your WAN interface.

                The wizards name this rule WAN_IN by default.

                You want to make the settings match when it comes to the protocol and port settings. But the destination is now the internal IP address as the translation has already happened by the NAT rules before the firewall rules see it.

                0_1513053223292_0979e45b-c587-4b7b-bbff-07bef53a8db9-image.png
                0_1513053240643_e8a1811a-674e-4433-8ada-c2647a8cb0c8-image.png
                0_1513053251218_fe30d4c4-9110-4015-a93e-a12e4e2368f4-image.png
                0_1513053262992_8e208e9c-ec44-44ea-b8d0-f12b79720bd7-image.png
                0_1513053275234_e881ec67-7ce3-477a-ae07-e5e2d3aeb2ed-image.png

                1 Reply Last reply Reply Quote 0
                • JaredBuschJ
                  JaredBusch
                  last edited by JaredBusch

                  Now you should have traffic properly flowing to and from your alternate IP addresses.
                  And yes, I noticed..
                  0_1513053369480_11bd0e28-df55-4e26-bc0e-9524265d64da-image.png

                  EddieJenningsE 1 Reply Last reply Reply Quote 2
                  • Mike DavisM
                    Mike Davis
                    last edited by

                    Well done Jared.

                    1 Reply Last reply Reply Quote 0
                    • DashrenderD
                      Dashrender
                      last edited by

                      When I tried this last night, my new NAT rules were all below the default masquerade one. I tried moving (click and drag) above but it wouldn't actually move.

                      I then added a third rule (just some fake crap), then upon having three rules I was able to move my desired rule above the default one.

                      I'm on firmware v1.9.7-hotfix.4

                      EddieJenningsE 1 Reply Last reply Reply Quote 0
                      • EddieJenningsE
                        EddieJennings @JaredBusch
                        last edited by

                        @jaredbusch said in Traffic not flowing for hosts behind NAT - Edge Router Lite:

                        Now you should have traffic properly flowing to and from your alternate IP addresses.

                        Thanks for the above. I'm comparing that to my configuration now.

                        And yes, I noticed..
                        0_1513053369480_11bd0e28-df55-4e26-bc0e-9524265d64da-image.png

                        Ah, then you know the commercials.

                        1 Reply Last reply Reply Quote 1
                        • EddieJenningsE
                          EddieJennings @Dashrender
                          last edited by

                          @dashrender said in Traffic not flowing for hosts behind NAT - Edge Router Lite:

                          When I tried this last night, my new NAT rules were all below the default masquerade one. I tried moving (click and drag) above but it wouldn't actually move.

                          I then added a third rule (just some fake crap), then upon having three rules I was able to move my desired rule above the default one.

                          I'm on firmware v1.9.7-hotfix.4

                          Even though it didn't move, did the rule order number change?

                          DashrenderD 1 Reply Last reply Reply Quote 0
                          • DashrenderD
                            Dashrender @EddieJennings
                            last edited by

                            @eddiejennings said in Traffic not flowing for hosts behind NAT - Edge Router Lite:

                            @dashrender said in Traffic not flowing for hosts behind NAT - Edge Router Lite:

                            When I tried this last night, my new NAT rules were all below the default masquerade one. I tried moving (click and drag) above but it wouldn't actually move.

                            I then added a third rule (just some fake crap), then upon having three rules I was able to move my desired rule above the default one.

                            I'm on firmware v1.9.7-hotfix.4

                            Even though it didn't move, did the rule order number change?

                            good question - I don't recall. I did see the issue where when making firewall Ruleset changes, when I would drag and drop them, the order on screen would change to some jumble, but the actual numerical value would be the desired change. Saving the rule order would fix the display to display them in numerical order.

                            1 Reply Last reply Reply Quote 0
                            • DashrenderD
                              Dashrender
                              last edited by

                              I just tried it again now
                              https://i.imgur.com/ZmoxUun.png

                              This is what is normally looks like
                              https://i.imgur.com/yi1wL5G.png

                              As you can see in the top image, I can't even see the other line item to move it above or below. I've zoomed the page in and out, no option there allows me to see where I'm placing it.
                              Additionally, after dropping it somewhere, the numerical order does not change.

                              As mentioned above, creating a third entry allowed me to work around this.

                              1 Reply Last reply Reply Quote 0
                              • EddieJenningsE
                                EddieJennings
                                last edited by

                                Below is the GUI for the ERL. I'm going to some firewall groups, as that seems to be a cleaner way to do that.

                                There are the differences I see in Jared's configuration and mine.

                                • Jared's NAT rules include port matching, rather than just matching all traffic
                                • Jared's WAN_IN firewall rules have the "Accept Established / Related" and "Drop invalid" at the the top
                                • Jared's firewall rule example explicitly allows the New state

                                Perhaps I'm being thick, but I'm failing to see the smoking gun as to why my configuration failed.

                                Dashboard
                                0_1513090743171_dash.png

                                NAT Rules
                                0_1513090916362_natrules.PNG

                                IIS Source NAT rule details
                                0_1513090976688_iisSourceNAT.PNG

                                IIS Destination NAT rule details
                                0_1513091011292_iisdestinationNat.PNG

                                Firewall Rules
                                0_1513091071910_firewall-rules.PNG

                                IIS HTTPS Rule detail (all other rules follow this pattern)
                                0_1513091100566_httpsRule1.PNG
                                0_1513091108625_httpsRule2.PNG
                                0_1513091115541_httpsRule3.PNG

                                JaredBuschJ 1 Reply Last reply Reply Quote 0
                                • JaredBuschJ
                                  JaredBusch
                                  last edited by

                                  @EddieJennings
                                  0_1513092680278_26f1a2f9-ce4f-4d8f-9b4b-d800ebe96c30-image.png

                                  EddieJenningsE 1 Reply Last reply Reply Quote 0
                                  • JaredBuschJ
                                    JaredBusch @EddieJennings
                                    last edited by JaredBusch

                                    @eddiejennings said in Traffic not flowing for hosts behind NAT - Edge Router Lite:

                                    Below is the GUI for the ERL. I'm going to some firewall groups, as that seems to be a cleaner way to do that.
                                    There are the differences I see in Jared's configuration and mine.

                                    Jared's NAT rules include port matching, rather than just matching all traffic
                                    Jared's WAN_IN firewall rules have the "Accept Established / Related" and "Drop invalid" at the the top
                                    Jared's firewall rule example explicitly allows the New state

                                    Perhaps I'm being thick, but I'm failing to see the smoking gun as to why my configuration failed.

                                    You always want the most hit firewall rules to be first.

                                    Always. This is not an Ubiquiti thing, this is an always thing.

                                    Firewall rules are processed sequentially and processing stops once a match is made.

                                    Thus you always want the thing that is gong to match the most to be checked first.

                                    In all cases, for standard NAT traffic hitting the inbound firewall, the most hit rule will always be the Established/Related.

                                    Next, you drop in valid because well, it is invalid. This comes second, because most traffic is still Established/Related.

                                    Then you add in your rules.

                                    1 Reply Last reply Reply Quote 3
                                    • EddieJenningsE
                                      EddieJennings @JaredBusch
                                      last edited by

                                      @jaredbusch That make sense, as if I specify nothing, then nothing would match.

                                      It's curious though that the exact same rules (with state unspecified) worked flawlessly with the other ERL.

                                      JaredBuschJ 1 Reply Last reply Reply Quote 0
                                      • JaredBuschJ
                                        JaredBusch @EddieJennings
                                        last edited by

                                        @eddiejennings said in Traffic not flowing for hosts behind NAT - Edge Router Lite:

                                        @jaredbusch That make sense, as if I specify nothing, then nothing would match.

                                        It's curious though that the exact same rules (with state unspecified) worked flawlessly with the other ERL.

                                        No they don't. Something would be different.

                                        EddieJenningsE 1 Reply Last reply Reply Quote 0
                                        • EddieJenningsE
                                          EddieJennings @JaredBusch
                                          last edited by

                                          @jaredbusch I agree. The question is finding what's different.

                                          Toying around, if I were to add a new rule, by default, there is no state specified.

                                          JaredBuschJ 2 Replies Last reply Reply Quote 0
                                          • JaredBuschJ
                                            JaredBusch @EddieJennings
                                            last edited by

                                            @eddiejennings said in Traffic not flowing for hosts behind NAT - Edge Router Lite:

                                            @jaredbusch I agree. The question is finding what's different.

                                            Toying around, if I were to add a new rule, by default, there is no state specified.

                                            Yes, because they don't know what you are trying to allow.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post