Moving the rule isn't the solution. What you call "WAN rule" would allow access from addresses in the address range of the particular LAN to anywhere, and you don't need an extra rule to allow access to a particular device somewhere after that rule.
If you configure the direction of the rule from IN to OUT, OUT means traffic that goes into OPNsense. OUT does not mean traffic that goes out of the interface to something that is plugged into it, and it does not mean traffic that comes out of OPNsense into the interface. Traffic coming out of OPNsense goes IN to the interface.
Quote from: defaultuserfoo on June 07, 2022, 12:38:36 amMoving the rule isn't the solution. What you call "WAN rule" would allow access from addresses in the address range of the particular LAN to anywhere, and you don't need an extra rule to allow access to a particular device somewhere after that rule.That is not correct. I restrict that rule to WAN Gateway. It would mean all other traffics that won't match the other rules will automatically to be passed to WAN interface out to the internet.
Quote from: defaultuserfoo on June 07, 2022, 12:38:36 amIf you configure the direction of the rule from IN to OUT, OUT means traffic that goes into OPNsense. OUT does not mean traffic that goes out of the interface to something that is plugged into it, and it does not mean traffic that comes out of OPNsense into the interface. Traffic coming out of OPNsense goes IN to the interface.Initially, I thought I understand it wrong, but I just finish watching this video tutorial and I discover that I understand this correctly. IN are all traffics coming into the OPNsense firewall and OUT are all traffics coming out of the OPNsense. By default, everything IN are blocked and everything OUT are passed. Thus, you would mainly need IN rules. The time you would need an OUT rule is when you need to filter packets going out of the firewall.
You need to create routes to be able to allow traffic from 2 different networks to communicate with eachother.First add your LAN IP 192.168.1.1 to gateways.After that create rule where network is 192.168.0.0/16 and gateway is 192.168.1.1 (or whatever is LAN IP of any LAN interface your opnsense has. IP MUST BE LAN gateway in use and within same same IP block.)Voïla, now all traffic between IPs 192.168.0.1 - 192.168.255.254 goes to 192.168.1.1 (or whichever LAN interface you use as route gateway) and can talk with eachother.Basic network stuff. Deviceses which belong to different networks can't communicate with eachother
Quote from: Ice_Drake1 on June 10, 2022, 02:54:34 amQuote from: defaultuserfoo on June 07, 2022, 12:38:36 amMoving the rule isn't the solution. What you call "WAN rule" would allow access from addresses in the address range of the particular LAN to anywhere, and you don't need an extra rule to allow access to a particular device somewhere after that rule.That is not correct. I restrict that rule to WAN Gateway. It would mean all other traffics that won't match the other rules will automatically to be passed to WAN interface out to the internet.Sorry, I think I have missed the restriction to the gateway because the screenshot was too wide to show in the browser window.So it would seem that you have rules which allow everything to anywhere on the same LAN (which is ineffective because devices on the same network will communicate directly with each other); after that, you force all traffic from the LAN through the WAN_DHCP gateway, and it the last rule, you're trying to allow everything to everywhere from a particular IP address. The last rule is also ineffective because the 2nd rule already matches. So yes, when you switch the 2nd and 3rd rule, it would make a difference. And you can delete the first rule.
Quote from: Ice_Drake1 on June 10, 2022, 02:54:34 amQuote from: defaultuserfoo on June 07, 2022, 12:38:36 amIf you configure the direction of the rule from IN to OUT, OUT means traffic that goes into OPNsense. OUT does not mean traffic that goes out of the interface to something that is plugged into it, and it does not mean traffic that comes out of OPNsense into the interface. Traffic coming out of OPNsense goes IN to the interface.Initially, I thought I understand it wrong, but I just finish watching this video tutorial and I discover that I understand this correctly. IN are all traffics coming into the OPNsense firewall and OUT are all traffics coming out of the OPNsense. By default, everything IN are blocked and everything OUT are passed. Thus, you would mainly need IN rules. The time you would need an OUT rule is when you need to filter packets going out of the firewall.Not long ago I was told on this forum that OUT means traffic going out of the interface into OPNsense, as opposed to going out of OPNsense. I do not know which version is true. Since there can be multiple interfaces through which traffic can go out of OPNsense, the first version makes sense while the other version doesn't. Otherwise you would have to be able to specify multiple interfaces OUT of which traffic is supposed to go out of OPNsense when creating a rule for the OUT direction.And what about traffic going IN to OPNsense and traffic coming OUT of OPNsense? How would you create rules for that?See here: https://forum.opnsense.org/index.php?topic=28447.msg138236#msg138236
Quote from: Vilhonator on June 10, 2022, 07:01:53 pmYou need to create routes to be able to allow traffic from 2 different networks to communicate with eachother.First add your LAN IP 192.168.1.1 to gateways.After that create rule where network is 192.168.0.0/16 and gateway is 192.168.1.1 (or whatever is LAN IP of any LAN interface your opnsense has. IP MUST BE LAN gateway in use and within same same IP block.)Voïla, now all traffic between IPs 192.168.0.1 - 192.168.255.254 goes to 192.168.1.1 (or whichever LAN interface you use as route gateway) and can talk with eachother.Basic network stuff. Deviceses which belong to different networks can't communicate with eachotherWell, I am configuring my OPNsense to be the gateway for both LANs. To be more precise, it is the gateway for all 4 LANs, so I don't need a gateway for that. The person in the tutorial video did the same thing. He was able to get communication working between the two LANs.
Oh, really? Devices on the same network will communicate directly with each other? I was using the same two devices for all my testing and I thought I would need that rule for them to communicate.