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

    NAT and Port Forwarding

    IT Discussion
    networking nat port forwarding
    5
    22
    2.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.
    • EddieJenningsE
      EddieJennings
      last edited by

      This is from a discussion with @scottalanmiller, and I figured it'd make a good thread for folks to learn.

      Here's the scenario.

      Edge Router Lite (with a /29 block) > Switch > Three web servers (VMs). In this environment there is no reverse proxy server.

      Here's how I had stuff configured (assuming memory is serving me right) to get traffic to the web servers: 1-1 NAT of a public IP to each web server.

      Is there another way to get traffic to go to each web server. Scott mentioned port forwarding, but unless you can make port forwarding rule based off of each IP address, I don't see how that would work. Since the ERL will need to know how to direct traffic from three distinct port 80 requests.

      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        Why do we have three port 80s? There is only one web server that uses port 80.

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

          @scottalanmiller said in NAT and Port Forwarding:

          Why do we have three port 80s? There is only one web server that uses port 80.

          Ah, I misremember then. In that case you'd need to forward three 443s.

          scottalanmillerS Emad RE 2 Replies Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller @EddieJennings
            last edited by

            @eddiejennings said in NAT and Port Forwarding:

            @scottalanmiller said in NAT and Port Forwarding:

            Why do we have three port 80s? There is only one web server that uses port 80.

            Ah, I misremember then. In that case you'd need to forward three 443s.

            Only one of those, too. Only one of anything that I can see.

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

              Well, now I've learned we're talking about two different ERLs. :smiling_face:

              In that case, I imagine that port forwarding uses less resources that NAT; thus, if you can use it, then that's the way to go.

              scottalanmillerS 1 Reply Last reply Reply Quote 1
              • scottalanmillerS
                scottalanmiller @EddieJennings
                last edited by

                @eddiejennings said in NAT and Port Forwarding:

                Well, now I've learned we're talking about two different ERLs. :smiling_face:

                In that case, I imagine that port forwarding uses less resources that NAT; thus, if you can use it, then that's the way to go.

                It's not about resources. It's that one does everything in a single step, the other requires a lot of steps.

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

                  Port forwarding simply does all the magic by itself. It opens the firewall it creates the nap room all behind the scenes.

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

                    To do what you were doing you need a source and destination nat rule for each web server for the open ports only. Then also a firewall rule.

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

                      So you do not need a full 1:1 nat

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

                        The downside to port forwarding is that it only goes to your primary IP

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

                          @jaredbusch said in NAT and Port Forwarding:

                          The downside to port forwarding is that it only goes to your primary IP

                          That's what I thought. Thinking this through further, it looks like in a situation where you have a /30 network, you would just forward 80/443 to you reverse proxy, then that server forwards to the traffic to the appropriate web server.

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

                            @eddiejennings said in NAT and Port Forwarding:

                            @jaredbusch said in NAT and Port Forwarding:

                            The downside to port forwarding is that it only goes to your primary IP

                            That's what I thought. Thinking this through further, it looks like in a situation where you have a /30 network, you would just forward 80/443 to you reverse proxy, then that server forwards to the traffic to the appropriate web server.

                            Correct

                            1 Reply Last reply Reply Quote 0
                            • Emad RE
                              Emad R @EddieJennings
                              last edited by

                              @eddiejennings said in NAT and Port Forwarding:

                              @scottalanmiller said in NAT and Port Forwarding:

                              Why do we have three port 80s? There is only one web server that uses port 80.

                              Ah, I misremember then. In that case you'd need to forward three 443s.

                              @eddiejennings said in NAT and Port Forwarding:

                              @scottalanmiller said in NAT and Port Forwarding:

                              Why do we have three port 80s? There is only one web server that uses port 80.

                              Ah, I misremember then. In that case you'd need to forward three 443s.

                              You can do that and PF 3 ports and use the private IP to distinguish between the servers however note that some cheap network routers dont allow PF the same port twice.

                              Best route is to PF one that will act as proxy/load balancing unless those web servers are not similar in files hosted.

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

                                @emad-r said in NAT and Port Forwarding:

                                @eddiejennings said in NAT and Port Forwarding:

                                @scottalanmiller said in NAT and Port Forwarding:

                                Why do we have three port 80s? There is only one web server that uses port 80.

                                Ah, I misremember then. In that case you'd need to forward three 443s.

                                @eddiejennings said in NAT and Port Forwarding:

                                @scottalanmiller said in NAT and Port Forwarding:

                                Why do we have three port 80s? There is only one web server that uses port 80.

                                Ah, I misremember then. In that case you'd need to forward three 443s.

                                You can do that and PF 3 ports and use the private IP to distinguish between the servers however note that some cheap network routers dont allow PF the same port twice.

                                He is specifically using the EdgeRouter LITE as noted in the first post.

                                The ERL can only port forward from a single inbound IP to. Very few routers have this in the port forwarding section. Actually, no current routers that I am aware of.

                                The ERL, as well as everything else, can do it with a destination NAT rule and matching source NAT rule.

                                1 Reply Last reply Reply Quote 1
                                • JaredBuschJ
                                  JaredBusch @Emad R
                                  last edited by

                                  @emad-r said in NAT and Port Forwarding:

                                  Best route is to PF one that will act as proxy/load balancing unless those web servers are not similar in files hosted.

                                  He has a /29 block and various servers using those IPs. To do this one would have to change the DNS to use a single IP.
                                  Otherwise, even if it was all going to a single internal proxy, you would still need the previiously mentioned destination and source NAT rules.

                                  1 Reply Last reply Reply Quote 0
                                  • scottalanmillerS
                                    scottalanmiller @JaredBusch
                                    last edited by

                                    @jaredbusch said in NAT and Port Forwarding:

                                    The downside to port forwarding is that it only goes to your primary IP

                                    Yeah, that can be very limiting. Seems like that would be easy to expand on their side.

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

                                      @scottalanmiller said in NAT and Port Forwarding:

                                      @jaredbusch said in NAT and Port Forwarding:

                                      The downside to port forwarding is that it only goes to your primary IP

                                      Yeah, that can be very limiting. Seems like that would be easy to expand on their side.

                                      Does VyOS have this feature?

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

                                        @jaredbusch said in NAT and Port Forwarding:

                                        @scottalanmiller said in NAT and Port Forwarding:

                                        @jaredbusch said in NAT and Port Forwarding:

                                        The downside to port forwarding is that it only goes to your primary IP

                                        Yeah, that can be very limiting. Seems like that would be easy to expand on their side.

                                        Does VyOS have this feature?

                                        Glancing over the wiki, it looks like it doesn't. Or rather, they say that Destination NAT is "port forwarding."

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

                                          @eddiejennings said in NAT and Port Forwarding:

                                          @jaredbusch said in NAT and Port Forwarding:

                                          @scottalanmiller said in NAT and Port Forwarding:

                                          @jaredbusch said in NAT and Port Forwarding:

                                          The downside to port forwarding is that it only goes to your primary IP

                                          Yeah, that can be very limiting. Seems like that would be easy to expand on their side.

                                          Does VyOS have this feature?

                                          Glancing over the wiki, it looks like it doesn't. Or rather, they say that Destination NAT is "port forwarding."

                                          Well, that is what port forwarding does int he background anyway.

                                          And port forwarding from multiple inbound IP just doens't make sense. because then you also need to do something for the source NAT.

                                          As I stated previously, I do not know of any router that has this in the "Port Forwarding" section.

                                          1 Reply Last reply Reply Quote 1
                                          • black3dynamiteB
                                            black3dynamite
                                            last edited by

                                            Is it possible to port forwarding using Aliases/Groups?

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