Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Firewall: OPT1<>LAN
« previous
next »
Print
Pages: [
1
]
Author
Topic: Firewall: OPT1<>LAN (Read 2187 times)
m11r
Newbie
Posts: 4
Karma: 0
Firewall: OPT1<>LAN
«
on:
October 28, 2023, 09:16:07 am »
Hi,
maybe a general question.
Following basic setup, fresh installation:
LAN interface, 192.168.1.1/24
OPT1 interface, 10.0.0.1/24
Only Firewall Rules on Both:
automatically generated rules
IPv4+IPv6, source [
interface
], destination *, action pass
(Default allow LAN to any rule)
Now a client from LAN can reach any IP from OPT1. But
why
? Don't I need to create a rule to allow that - e.g. ~"allow all incoming on opt1 from LAN"?
I'm planning to create multiple interfaces (VLANs) for clients, guests, dmz, printers, cameras, ... - what is the way to go for example if I want to block guests to access LAN - create a rule in Guest with LAN as target or create a rule in LAN with Guest as Source? And repeat that for other isolated networks? Or am I missing something?
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1554
Karma: 172
Re: Firewall: OPT1<>LAN
«
Reply #1 on:
October 28, 2023, 09:21:23 am »
https://forum.opnsense.org/index.php?topic=36285.msg176938#msg176938
Just ignore the things about the gateway. Im sure this will help you.
Logged
Hardware:
DEC740
m11r
Newbie
Posts: 4
Karma: 0
Re: Firewall: OPT1<>LAN
«
Reply #2 on:
October 28, 2023, 09:47:29 am »
Thanks! I get that i can create an inverted rule to allow anything but RFC1918. This works as expected.
But why does LAN allow incoming from OPT1? Which rule does apply here (specifically by the LAN side?)
Wouldn't it be safer to deny all incoming on LAN than deny outgoing from OPT1?
The GUI says
"Everything that is not explicitly passed is blocked by default."
- Sorry for my confusion, I don't understand which rule explicitly passes incoming traffic on LAN1...
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1554
Karma: 172
Re: Firewall: OPT1<>LAN
«
Reply #3 on:
October 28, 2023, 09:49:14 am »
LAN allows incoming from OPT1 because you probably created a rule in OPT1 allowing "any destination." If you create the inverted rules as allow rules to the internet, (on each interface), they don't include your other subnets connected to the firewall.
Thus the last matching default deny rule will match (which the GUI references as default block rule) and OPT1 cant reach LAN anymore.
«
Last Edit: October 28, 2023, 09:52:03 am by Monviech
»
Logged
Hardware:
DEC740
m11r
Newbie
Posts: 4
Karma: 0
Re: Firewall: OPT1<>LAN
«
Reply #4 on:
October 28, 2023, 09:56:39 am »
Yes, I allow OPT1
to
any destination. But where does it say (in LAN): "allow LAN
from
any destination"? Or am i completely misunderstanding a basic concept?
Both Interfaces just have "allow to any" as the only rule - I'm missing the origin of the "allow from" rule, which I thought would have to be applied.
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1554
Karma: 172
Re: Firewall: OPT1<>LAN
«
Reply #5 on:
October 28, 2023, 10:02:22 am »
You are misunderstanding the concept. If you allow Direction "in" on OPT1 to "destination any" the packet is delivered directly to the destination without passing through the "LAN" interface and matching additional rules. It just goes straight to the destination.
https://forum.opnsense.org/index.php?topic=36326.0
The traffic would go "in" the OPT1 interface, and "out" of the LAN interface. But the general concept is not to use out rules because they mess with the states. You just filter everything ingress.
«
Last Edit: October 28, 2023, 10:06:13 am by Monviech
»
Logged
Hardware:
DEC740
m11r
Newbie
Posts: 4
Karma: 0
Re: Firewall: OPT1<>LAN
«
Reply #6 on:
October 28, 2023, 10:12:14 am »
… it clicked, thank you very much! Finally it makes sense to me.
Logged
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1554
Karma: 172
Re: Firewall: OPT1<>LAN
«
Reply #7 on:
October 28, 2023, 10:14:29 am »
Great, happy I could help.
Logged
Hardware:
DEC740
Seimus
Hero Member
Posts: 598
Karma: 58
Re: Firewall: OPT1<>LAN
«
Reply #8 on:
October 28, 2023, 11:58:09 am »
To add on the invert rules, its a fancy way to do allow certain things. For example if you have a VLAN/Network that you want only allow for internet yet block from accessing your LAN you can do something like this:
1. Create an allias with the Private subnet space
2. Create a rule put that alias as destination
3. Click the invert in the destination section "Use this option to invert the sense of the match. "
You can see in my example - the VLAN net is a GROUP of several interfaces, this way I can push one rule onto multiple interfaces without the need to configure on each interface separately.
Also if not aware is good to undersdant the flowe and order or rules.
https://docs.opnsense.org/manual/firewall.html#processing-order
System > Floading > Interface group > Interface
Regards,
S.
«
Last Edit: October 28, 2023, 12:03:18 pm by Seimus
»
Logged
Networking is love. You may hate it, but in the end, you always come back to it.
OPNSense HW
APU2D2 - deceased
N5105 - i226-V | Patriot 2x8G 3200 DDR4 | L 790 512G -
VM HA(SOON)
N100 - i226-V | Crucial 16G 4800 DDR5 | S 980 500G -
PROD
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Firewall: OPT1<>LAN