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

    TCP full address transparency

    Scheduled Pinned Locked Moved Firewalling
    11 Posts 6 Posters 1.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.
    • R Offline
      rahul11
      last edited by

      [client aa.bb.cc.dd: z]<–->[pfsense[192.168.3.1]]<–-->[src client aa.bb.cc.dd: z, dest:192.168.3.2]

      How to achieve it?
      Problem: port z  required

      1 Reply Last reply Reply Quote 0
      • JKnottJ Online
        JKnott
        last edited by

        What do you mean by "full address transparency"?  Normally, addresses are not changed when passing through a router, unless NAT is used.  The address you list for pfSense is in a range that's often used for NAT.  What is it you're trying to do?

        PfSense running on Qotom mini PC
        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel 1 Gb Ethernet ports.
        UniFi AC-Lite access point

        I haven't lost my mind. It's around here...somewhere...

        1 Reply Last reply Reply Quote 0
        • K Offline
          kpa
          last edited by

          You can't avoid the "extra" ports as long as NAT is used. Get a routed subnet from your ISP or use bridging if you must.

          1 Reply Last reply Reply Quote 0
          • johnpozJ Offline
            johnpoz LAYER 8 Global Moderator
            last edited by

            Your talking about inbound traffic from public IP to your port forward.. And your saying the source port is being changed?

            so you want this.

            client [publicIP:[b]z] –--- internet ---- [publicIP] pfsense [192.168.3.1] –-- [publicIP:[b]z –-> 192.1683.2] Server..

            But your saying your getting this?

            client [publicIP:[b]z] –--- internet ---- [publicIP] pfsense [192.168.3.1] –-- [publicIP:[u]Y –-> 192.1683.2] Server..

            Or are you talking about traffic from behind pfsense to something outside (wan).

            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 25.07.1 | Lab VMs 2.8.1, 25.07.1

            1 Reply Last reply Reply Quote 0
            • R Offline
              rahul11
              last edited by

              @johnpoz:

              Your talking about inbound traffic from public IP to your port forward.. And your saying the source port is being changed?

              so you want this.

              client [publicIP:[b]z] –--- internet ---- [publicIP] pfsense [192.168.3.1] –-- [publicIP:[b]z –-> 192.1683.2] Server..

              But your saying your getting this?

              client [publicIP:[b]z] –--- internet ---- [publicIP] pfsense [192.168.3.1] –-- [publicIP:[u]Y –-> 192.1683.2] Server..

              Or are you talking about traffic from behind pfsense to something outside (wan).

              Yeah you got it,
              I am using haproxy, I need IP and port(imp) received at front end, to be forwarded  to backend server
              haproxy changing port z->y. I need the port receive at front end

              1 Reply Last reply Reply Quote 0
              • R Offline
                rahul11
                last edited by

                @JKnott:

                What do you mean by "full address transparency"?  Normally, addresses are not changed when passing through a router, unless NAT is used.  The address you list for pfSense is in a range that's often used for NAT.  What is it you're trying to do?

                I want the port receive at front-end to be forwarded to backend

                1. pfsense running haproxy with nat directing to itself at port 54545
                2. source 168.122.33.10:8222 to destination hoho.com(whatever 197.116.22.10:54545 as frontend )
                3. front end spoof source using 168.122.33.10:8222 to backend server 192.168.3.2:4322

                now problem is haproxy changing port 8222  to 3432

                I need 8222

                1 Reply Last reply Reply Quote 0
                • johnpozJ Offline
                  johnpoz LAYER 8 Global Moderator
                  last edited by

                  "haproxy changing port z->y. I need the port receive at front end"

                  Well that is on HA proxy, not pfsense.. Yeah kind of needs to do that to keep the sessions straight

                  If you don't mind me asking, what are you doing that the source port makes any difference.. Why should it matter.. Its just going to be some random high port…

                  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 25.07.1 | Lab VMs 2.8.1, 25.07.1

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Harvy66
                    last edited by

                    now problem is haproxy changing port 8222  to 3432

                    I would expect it to do this. What if you had two clients that connected to haproxy, both on ports 12345? Do you expect haproxy to magically share the same port for two connections?

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

                      HA Proxy makes a new connection to the inside host. It is unavoidable.

                      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
                      • R Offline
                        rahul11
                        last edited by

                        @Harvy66:

                        now problem is haproxy changing port 8222  to 3432

                        I would expect it to do this. What if you had two clients that connected to haproxy, both on ports 12345? Do you expect haproxy to magically share the same port for two connections?

                        load balancer will use Client IP and Client port for server side connection

                        1 Reply Last reply Reply Quote 0
                        • H Offline
                          Harvy66
                          last edited by

                          @rahul11:

                          @Harvy66:

                          now problem is haproxy changing port 8222  to 3432

                          I would expect it to do this. What if you had two clients that connected to haproxy, both on ports 12345? Do you expect haproxy to magically share the same port for two connections?

                          load balancer will use Client IP and Client port for server side connection

                          That sounds like a security nightmare waiting to happen. Do you have all unknown IP addresses getting routed your haproxy? How could you router know which public IPs haproxy is claiming to temporarily own?

                          I'm afraid to google this topic because it just sounds like a horrible idea.

                          Never mind, had to look. "Transparent mode requires that the haproxy be the default gateway of the backend servers.". I guess that answers my question.

                          We just have our reverse proxies add a header to indicate what client it's coming from. I just really really hate the idea of an internal server attempting to communicate with an external public IP over an unsecured channel.

                          But good luck with getting this to work.

                          I know the NAT rewrites source ports, not sure if scrub does anything like this.

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