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

    How to block devices from LAN access?

    Scheduled Pinned Locked Moved Firewalling
    9 Posts 5 Posters 2.8k 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.
    • S
      Skiny
      last edited by

      Hopefully someone can help me...

      I would like to know how to block certain devices on my network from either LAN or WAN access (depending upon the device).

      I was testing this with my phone, which I have assigned a static IP address and tried to block it from having WAN and LAN access. However, whilst blocking Internet access works, blocking LAN access fails.

      My Pfsense router connects to a switch, which has a variety of hardwired devices connected to it, one of which is an old Asus router in Access Point mode. Via that Access Point, my phone connects.

      First I created an alias for my phone and then set a LAN firewall rule to block that device.
      All protocols selected.
      I set the 'Source' to the alias and the "Destination" to any (also tried selecting 'LAN net').

      Plenty of time has been given to allow settings to take effect, both phone and router have been restarted - no effect.

      Can anyone see anything I'm doing wrong?

      Bob.DigB S 2 Replies Last reply Reply Quote 0
      • Bob.DigB
        Bob.Dig LAYER 8 @Skiny
        last edited by

        @skiny Sure, you can not block on the same LAN.

        1 Reply Last reply Reply Quote 1
        • S
          Skiny
          last edited by

          So it has to be done via a VLAN?

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

            @skiny said in How to block devices from LAN access?:

            So it has to be done via a VLAN?

            Yes if the traffic between devices would be routed over pfsense, then you could block it. Devices on the same network do not talk to pfsense to talk to each other. When a device wants to talk to another device and the IP is on the same network as device A, it just arps for the mac and then sends the traffic to the mac address. So pfsense is not involved in that conversation. Traffic only gets sent to the gateway (pfsense) when the destination IP is not on the same network.. The device then arps for the mac of the IP of the gateway, and send the traffic to (pfsense).

            So be that a vlan, or some other native network - the traffic would need to be routed via pfsense for pfsense to block it.

            For devices on the same network, you could look to see if your switch supports what is commonly called a private vlan, this allows the switch to prevent access between devices on the same network. In the wifi world this is either called AP or Client isolation.

            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.7.2, 24.11

            S 1 Reply Last reply Reply Quote 2
            • S
              SteveITS Galactic Empire @Skiny
              last edited by

              @skiny Some wireless access points have a guest SSID that isolates the guest devices. I have eero which does this even though the APs are on LAN and eero is in bridge mode. Other APs may be able to do this if they are also the router, you'd have to check the capability of yours. Of course that only works for wireless devices using the guest SSID.

              Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
              When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
              Upvote ๐Ÿ‘ helpful posts!

              1 Reply Last reply Reply Quote 0
              • Dobby_D
                Dobby_
                last edited by

                Could a LDAP server and/or Radius server help here out?

                #~. @Dobby

                Turris Omnia - 4 Ports - 2 GB RAM / TurrisOS 7 Release (Btrfs)
                PC Engines APU4D4 - 4 Ports - 4 GB RAM / pfSense CE 2.7.2 Release (ZFS)
                PC Engines APU6B4 - 4 Ports - 4 GB RAM / pfSense+ (Plus) 24.03_1 Release (ZFS)

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

                  @dobby_ said in How to block devices from LAN access?:

                  Radius server help here out?

                  If you were doing something with NAC maybe, and place them in a private vlan once they auth to the network.. Would still be outside the scope of pfsense, unless you were running the radius server on pfsense. Your switches would still need to support the ability to limit the devices.

                  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.7.2, 24.11

                  1 Reply Last reply Reply Quote 0
                  • S
                    Skiny @johnpoz
                    last edited by

                    @johnpoz said in How to block devices from LAN access?:

                    @skiny said in How to block devices from LAN access?:

                    So it has to be done via a VLAN?
                    

                    Yes if the traffic between devices would be routed over pfsense, then you could block it. Devices on the same network do not talk to pfsense to talk to each other. When a device wants to talk to another device and the IP is on the same network as device A, it just arps for the mac and then sends the traffic to the mac address. So pfsense is not involved in that conversation. Traffic only gets sent to the gateway (pfsense) when the destination IP is not on the same network.. The device then arps for the mac of the IP of the gateway, and send the traffic to (pfsense).

                    So be that a vlan, or some other native network - the traffic would need to be routed via pfsense for pfsense to block it.

                    For devices on the same network, you could look to see if your switch supports what is commonly called a private vlan, this allows the switch to prevent access between devices on the same network. In the wifi world this is either called AP or Client isolation.

                    That makes perfect sense and I have no idea why I didn't consider it at the time ๐Ÿ˜

                    Thanks for the helpful explanation and to everyone else for their replies too!

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

                      @skiny said in How to block devices from LAN access?:

                      why I didn't consider it at the time

                      Don't feel bad - this same question comes up all the time.. Why is lan to lan rules not working ;)

                      The only way pfsense can filter traffic between devices on the same network - is if you bridge, then pfsense could filter traffic between devices that are on different sides of the bridge..

                      But bridges should be the last possible choice almost always.. But if you were bridging with pfsense, then it would be possible to filter traffic between devices that were on side A of the bridge to side B of the bridge. But if devices were on the same side then no pfsense again would never see the traffic.

                      The take away here is if you have devices that you want to filter from talking to other devices - put them on different networks, that get routed over pfsense. Then it is childs play to filter who can talk to who in the different networks.

                      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.7.2, 24.11

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