Try something like this.
Quote from: avanix on May 23, 2022, 07:40:17 amTry something like this.Like when you put together a steering wheel, the wheels go underneath?
I did configure something like that using interface groups. It's not great but it works.
Quote from: defaultuserfoo on May 23, 2022, 12:26:02 amNot excatly ... For simplicity, let's assume that I have a LAN and a guest VLAN. With IPv4, the common way to set it up is to block everything to all private networks and then allow everyhing to anywhere so that devices on the guest VLAN have internet access. That nicely protects your LAN because all devices on the LAN have IP addresses within the private networks which can not be reached from the devices on the guest VLAN.This is a gross oversimplification, IMHO, because e.g. I run several setups where the "internal" networks do not use private but globally routable addresses. Yes, for IPv4 ...
Not excatly ... For simplicity, let's assume that I have a LAN and a guest VLAN. With IPv4, the common way to set it up is to block everything to all private networks and then allow everyhing to anywhere so that devices on the guest VLAN have internet access. That nicely protects your LAN because all devices on the LAN have IP addresses within the private networks which can not be reached from the devices on the guest VLAN.
With IPv6, that doesn't work because suddenly, all the devices on the LAN have not only addresses within private networks but also have public IP addresses; and your LAN is unprotected because the rule on the guest VLAN that allows everything to everywhere also allows access to the devices on your LAN and you can't reasonably block that, especially not when the IP addresses of the devices on the LAN keep chaning all the time.
But I do understand your problem. If you allow "everything" that implies the guest network can reach all other directly connected networks as well as "the Internet".I am not arguing that your requirement is not justified -
there simply is no way in PF to specify "from this interface in only to that interface (WAN) out".
So let's turn back to your simplified example: I was suggesting that you create an outbound rule on the LAN interface that reads "block everything from guest network".You can create group of all directly connected networks and place a "block everything from <group> outbound" on all of the networks, because there will never be traffic coming out of interface X with source address of net X. Unless it's generated by the firewall itself, but that is taken care of by the default "permit everything from the firewall itself" rule.So the additional burden for blocking is reduced to 1 rule per interface and maintaining a group of all networks attached to all the interfaces. Not optimal but the best I could think of. I am going to test this in the coming weeks and if successful put it in production. Currently I have block rules with various destination networks spread "everywhere" and I am just as annoyed by that as you are, that's why I am also looking for a solution.
There will probably be things to consider with respect to rule order and the application of "quick", that's why I don't have an example ready for you.HTH,Patrick
Quote from: defaultuserfoo on May 23, 2022, 11:47:54 amQuote from: avanix on May 23, 2022, 07:40:17 amTry something like this.Like when you put together a steering wheel, the wheels go underneath?That's why I think outbound rules could simplify that a lot. Which remains to be proven, of course. I'll update this thread when I have something actually working.
So how is my argument not justified? What's your argument on this? Maybe I don't need to do what I'm trying to do.
Ok, so what I might want isn't possible. Wouldn't it be a nice feature to have?
No problem ... I still don't understand how a rule on the LAN interface that blocks outbound traffic from the guest network could accomplish anything. Why and how would there be traffic from the guest netwok outbound on the LAN interface?
An outbound rule on the LAN interface that blocks everything from <group> /would block traffic coming out of the firewall before the traffic could enter the LAN interface and go out of the LAN interface/.
Quote from: bimbar on May 23, 2022, 11:13:51 amI did configure something like that using interface groups. It's not great but it works.Could you post an example, please? Is there something like an "<interface group> net" object, which would sum up all the directly connected networks?
Quote from: defaultuserfoo on May 23, 2022, 01:07:49 pmSo how is my argument not justified? What's your argument on this? Maybe I don't need to do what I'm trying to do.I said that your argument is justified - read the sentence again.
Quote from: defaultuserfoo on May 23, 2022, 01:07:49 pmOk, so what I might want isn't possible. Wouldn't it be a nice feature to have?Ironically ipfw, the "native" FreeBSD firewall has got a "via <interface>" clause for ingress and egress. But as far as I know nobody has written a polished firewall appliance product on top of it.
Quote from: defaultuserfoo on May 23, 2022, 01:07:49 pmNo problem ... I still don't understand how a rule on the LAN interface that blocks outbound traffic from the guest network could accomplish anything. Why and how would there be traffic from the guest netwok outbound on the LAN interface?Well, a machine on the guest network sends a packet to a machine on the LAN network. That packet goes in to the firewall on the guest interface and out of the firewall on the LAN interface ...The "inbound/outbound" distinction is strictly from the firewall's point of view.Quote from: defaultuserfoo on May 23, 2022, 01:07:49 pmAn outbound rule on the LAN interface that blocks everything from <group> /would block traffic coming out of the firewall before the traffic could enter the LAN interface and go out of the LAN interface/.Exactly.
Op>Have you tried making rules based on "Nets" ? Under the Source/dest in the rule you create, there should be some built in aliases named "<interface name> net". That should at least cover all devices onthat interface, even if the interface subnet changes.
But there is an alias 'WAN net'. What does that mean? Internet?
Are you sure you still want to make an example?
Quote from: pmhausen on May 23, 2022, 12:02:24 pmQuote from: bimbar on May 23, 2022, 11:13:51 amI did configure something like that using interface groups. It's not great but it works.Could you post an example, please? Is there something like an "<interface group> net" object, which would sum up all the directly connected networks?IIRC when you define an interface group, a net object like that is created and you can work with "deny from any to interface group", "allow from interface group to any" or something similar.I don't have that setup active anymore so I can not look it up.
Quote from: defaultuserfoo on May 24, 2022, 12:33:31 pmBut there is an alias 'WAN net'. What does that mean? Internet?Nope. That's a common misunderstanding."X net" is the network directly connected to interface X. Regardless of which interface, so also for WAN. Some ISP might give you a routed /29 or /30 istead of a point to point link, so that's what "WAN net" ends up being.