I'm wondering how I can personalize the access to the LAN zone for each peer. For instance:
Peer A: full access (a kind of LAN admin)
Peer B, Peer C: only 192.168.1.100/32
etc...
I've already configured Allowed IPs for each peer, but that is just a routing policy for clients, not a security restriction. I'd need something at the firewall level. I'm looking for a way to do it in the right (i.e., OpenWrt-onic) way.
Firewall (custom zone + WAN port + 2 traffic rules for peers):
config zone
option name 'My_VPN'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'My_VPN'
config rule 'wg'
option name 'Allow-WireGuard-WAN'
option src 'wan'
option dest_port '...'
option proto 'udp'
option target 'ACCEPT'
config rule
option name 'Allow-All-LAN'
option src 'My_VPN'
list src_ip '10.0.0.2' # All access to the All_LAN_Peer
option target 'ACCEPT'
option dest 'lan'
config rule
option name 'Allow-Restricted-Access'
option src 'My_VPN'
list src_ip '10.0.0.3'
option target 'ACCEPT'
option dest 'lan'
list dest_ip '192.168.1.100'
Working this way I have:
An open port on the WAN to accept incoming Wireguard connections
A dedicated VPN Zone
All_LAN_Peer who can access all the LAN
Restricted_Peer who can access just the host 192.168.1.100 (Since I specified both dest 'lan' and `dest_ip '192.168.1.100')
I'm still trying to allow All_LAN_Peer to reach OpenWrt via 192.168.1.1. Since I have the following settings:
config zone
option name 'My_VPN'
option input 'REJECT'
It looks like the Allow-All-LAN rule is not enough. Even explicit traffic rules (e.g., Allow 192.168.1.1) do not kick in. How those things interact with each other? Please, pardon my poor knowledge of firewalls
A rule that doesn't specify a destination zone will be interpreted as "the router itself is the destination" -- that is to say that it is treating the rule as governing input to the router itself (for admin and/or other services on the router itself).
Yes... because one if accessing the router itself while the other is accessing the lan zone.