Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Block off-LAN access for hosts
« previous
next »
Print
Pages: [
1
]
Author
Topic: Block off-LAN access for hosts (Read 2329 times)
Ted
Newbie
Posts: 13
Karma: 0
Block off-LAN access for hosts
«
on:
November 17, 2021, 11:44:08 pm »
I need to block off-LAN access for a few hosts. I've reviewed the forum for this - it seems to come up now and then. I've read all of the related threads, and I don't think I've missed anything. That said, the following rule does not seem to be working.
Action: Reject
Interface: LAN
Direction: In
TCP/IP Version: IPv4+IPv6
Protocol: Any
Source Address: Alias for the four host addresses
Source Port: Any
Destination Address: ! LAN net
Destination Port: Any
I'm running OPNsense 21.7.5. The only rule preceding this rule is the automatically generated anti-lockout rule.
This seems like it ought to be a simple thing, but it's not working, and I would really appreciate any help.
Thanks
Logged
pankaj
Full Member
Posts: 117
Karma: 5
Re: Block off-LAN access for hosts
«
Reply #1 on:
November 18, 2021, 03:20:19 am »
From your post it seems that you would like to stop four hosts that are on the LAN subnet from communicating with rest of the LAN network.
If this is correct then OPNSense cannot stop the traffic between two hosts on the same subnet because this traffic is not routed via OPNSense.
«
Last Edit: November 18, 2021, 03:22:47 am by pankaj
»
Logged
Ted
Newbie
Posts: 13
Karma: 0
Re: Block off-LAN access for hosts
«
Reply #2 on:
November 18, 2021, 04:51:55 pm »
Thanks for your quick response. The intent is to block four hosts behind the LAN interface from communicating with any destination that is NOT behind the LAN interface (note the !). If I'm wrong about the use of invert in setting up the rule, could you explain in more detail? Thanks.
Logged
Ted
Newbie
Posts: 13
Karma: 0
Re: Block off-LAN access for hosts
«
Reply #3 on:
November 19, 2021, 04:21:02 pm »
On occasion I've had a bit of trouble with aliases. Replacing the alias with an actual IP address avoided the trouble. I tried that on the rule above (expanding one rule with an alias to four rules each with an IP address). Unfortunately, it didn't make any difference.
Some additional information: IPv6 is disabled on the firewall (Firewall | Settings | Advanced). After each rule change, I reboot OPNsense.
Next step: I know there are link local addresses on the host interfaces of the systems I'm trying to block. I will include rules to block traffic from those addresses. Not sure where to go after that.
I would really appreciate any help.
Logged
pankaj
Full Member
Posts: 117
Karma: 5
Re: Block off-LAN access for hosts
«
Reply #4 on:
November 21, 2021, 06:19:56 am »
Few pointers:
1. Change "Destination Address: ! LAN net" to "Destination Address: any" - this should block whatever is specified in the source (a host, alias or a subnet) from going anywhere outside.
2. You don't need to restart OPNSense after each rule change, it not needed and seems excessive
3. For the new rule enable logging (its an option in the firewall rules UI) and then start a new window and go to "Firewall > Log Files > Live View" and then set filter as "src" to one of the LAN IP address that you are trying to block.
4. Do something on the machine that you are trying to block and you should see log (in real time) with info that can point you in the right direction. If the host is not getting blocked you will see the rule that is allowing the traffic outside.
Here is a good video explaining OPNSense firewall rules -
Destination Address: ! LAN net
«
Last Edit: November 21, 2021, 06:31:42 am by pankaj
»
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Block off-LAN access for hosts