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

    Allowing only LAN users while blocking all others.

    Scheduled Pinned Locked Moved Cache/Proxy
    8 Posts 3 Posters 808 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.
    • T
      tomasenskede
      last edited by

      I'm looking to configure my HAproxy to only allow access to specific services for local LAN users. Despite trying various ACL configurations, I haven't been able to achieve the desired outcome. Does anyone have a sample configuration to restrict site access exclusively to users within the 192.168.0 network?

      I assume this should be implemented within the backend configuration, particularly in the Access Control Lists and Actions section. Is my understanding correct?
      4b6b5ca9-0720-4708-85ba-78309264782b-image.png

      I'm grateful for all the suggestions, tips, and ideas that have been shared to help me work towards a solution. Thank you!

      M johnpozJ 2 Replies Last reply Reply Quote 0
      • M
        michmoor LAYER 8 Rebel Alliance @tomasenskede
        last edited by

        @tomasenskede quite simple. There’s an option to use an Alias when building the ACL. I utilize this when wanting to keep certain resources available only to my net admin vlan

        Firewall: NetGate,Palo Alto-VM,Juniper SRX
        Routing: Juniper, Arista, Cisco
        Switching: Juniper, Arista, Cisco
        Wireless: Unifi, Aruba IAP
        JNCIP,CCNP Enterprise

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

          @tomasenskede who are you wanting to block exactly? For example if you don't want public to get to it, why would you even have it listen on your wan, or why would you create the firewall.

          If you don't want some other local network to use it, just block that network or IP from talking to the frontend IP and 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 24.11 | Lab VMs 2.8, 24.11

          M 1 Reply Last reply Reply Quote 0
          • M
            michmoor LAYER 8 Rebel Alliance @johnpoz
            last edited by

            @johnpoz I think it all depends on what the network looks like if a firewall ACL is practical.
            So for example my HA Proxy listen IP on the LAN is 192.168.50.250. All my internal services sit behind that VIP. That means if i have lets say dns.example.com and password.example.com there is no way to block users to the specific service using pf rules (actually as im writing this you could by putting the hostname in the source field). Another way is to use the built in feature to use an Alias within HA Proxy which would be my preference as you dont need to update multiple interfaces (assuming a routed network or vlans) and just update the Alias.
            Different ways to cut up an onion i suppose

            Firewall: NetGate,Palo Alto-VM,Juniper SRX
            Routing: Juniper, Arista, Cisco
            Switching: Juniper, Arista, Cisco
            Wireless: Unifi, Aruba IAP
            JNCIP,CCNP Enterprise

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

              @michmoor Yeah I agree there would be times where you would want/need to use the acls in a specific setup, and even limit or allow on source IPs, etc.. Not saying its not a viable tool to use when circumstance warrants it.

              I am just curious in this scenario.. If I only want locals networks or IPs to use my haproxy - why would I even allow public to talk to it in the first place. Or if only want specific locals to access it, then again its quite possible could just be done with firewall rules..

              Different ways to cut up an onion i suppose

              Or skin the cat for sure - but if you don't know the breed of the cat, you can't actually determine all the ways to skin it.. Or which way might be the easiest ;)

              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

              T 1 Reply Last reply Reply Quote 0
              • T
                tomasenskede @michmoor
                last edited by

                @michmoor

                Alias here?
                b69c05e6-af25-4b91-939b-5b17aeecb181-image.png

                1 Reply Last reply Reply Quote 0
                • T
                  tomasenskede @johnpoz
                  last edited by tomasenskede

                  @johnpoz said in Allowing only LAN users while blocking all others.:

                  @michmoor Yeah I agree there would be times where you would want/need to use the acls in a specific setup, and even limit or allow on source IPs, etc.. Not saying its not a viable tool to use when circumstance warrants it.

                  I am just curious in this scenario.. If I only want locals networks or IPs to use my haproxy - why would I even allow public to talk to it in the first place. Or if only want specific locals to access it, then again its quite possible could just be done with firewall rules..

                  Different ways to cut up an onion i suppose

                  Or skin the cat for sure - but if you don't know the breed of the cat, you can't actually determine all the ways to skin it.. Or which way might be the easiest ;)

                  I have multiple services that I make accessible through HAproxy, and they function well. However, there are several services that I prefer not to make public, and I'd like to restrict access to them to only the LAN-side, rather than the WAN-side.

                  1 Reply Last reply Reply Quote 0
                  • T
                    tomasenskede
                    last edited by

                    6cf0e84c-91b7-4081-b7f1-b828b07fd80c-image.png
                    This isn't functioning correctly. Am I heading in the right direction?

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