I have a main router and a dumb AP configured with 3 vlans (and corresponding wifi ssids), one the main lan with access to internet and internal resources, a IOT lan for iot devices that can communicate among them and lan devices but not to internet, and a guest lan that should only be able to access internet and connect only to their own wifi ssid.
I have configured dhcp ipv4 for guest network and the firewall rules in the main router as advised in the wiki guest configuration.
This are the firewall settings in the main router:
The problem is that with that recommended rules when I try to connect to the guest wifi in the main router I cannot because DHCP does not serve an IP address.
If I change input from reject to accept (in the guest->wan rule) I can connect and all seems to work OK, but may be there are security risks, as the recommended setting is reject.
What am I doing wrong?
Trying to connect to the dumb AP gives me same results.
These are the firewall settings in it (in case that matters, but I think the problem is in the main router)
Okay they are not missing, but they are located somewhere in the middle of the file. And the second rule was mixed with an existing rule for ipv6, so it will not work for ipv4.
Thanks a lot for pointing that.
I don't know what happened, I had deleted what you said, and added the rules at the end of the firewall file.
But hat not rebooted and use the luci interface (refreshed) to see the results. I think I used save and apply in luci.
Might be that what messed things up.
I have restored previous configuration, and reedited firewall file. This time I rebooted the router and it seems to be correct now.
It seems to work and be correct now.
This is the result of uci export firewall command:
package firewall
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
config zone 'lan'
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'lan'
list network 'wgVPN'
config zone 'wan'
option name 'wan'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wan'
option input 'REJECT'
config forwarding 'lan_wan'
option src 'lan'
option dest 'wan'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
option src_ip 'fc00::/6'
option dest_ip 'fc00::/6'
option dest_port '546'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-MLD'
option src 'wan'
option proto 'icmp'
option src_ip 'fe80::/10'
list icmp_type '130/0'
list icmp_type '131/0'
list icmp_type '132/0'
list icmp_type '143/0'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Input'
option src 'wan'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
list icmp_type 'router-solicitation'
list icmp_type 'neighbour-solicitation'
list icmp_type 'router-advertisement'
list icmp_type 'neighbour-advertisement'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Forward'
option src 'wan'
option dest '*'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-IPSec-ESP'
option src 'wan'
option dest 'lan'
option proto 'esp'
option target 'ACCEPT'
config rule
option name 'Allow-ISAKMP'
option src 'wan'
option dest 'lan'
option dest_port '500'
option proto 'udp'
option target 'ACCEPT'
config rule
option name 'Support-UDP-Traceroute'
option src 'wan'
option dest_port '33434:33689'
option proto 'udp'
option family 'ipv4'
option target 'REJECT'
option enabled '0'
config include
option path '/etc/firewall.user'
config zone
option name 'iot'
option output 'ACCEPT'
option forward 'REJECT'
option input 'ACCEPT'
list network 'iot'
config forwarding
option src 'iot'
option dest 'lan'
config forwarding
option src 'lan'
option dest 'iot'
config redirect
option target 'DNAT'
option name 'https al servidor'
list proto 'tcp'
option src 'wan'
option src_dport '443'
option dest 'lan'
option dest_ip '10.100.101.1'
option dest_port '443'
config redirect
option target 'DNAT'
option name 'QBelt al servidor'
list proto 'udp'
option src 'wan'
option src_dport '443'
option dest 'lan'
option dest_ip '10.100.101.1'
option dest_port '443'
config redirect
option target 'DNAT'
option name 'WireGuard hacia servidor QNAP'
list proto 'udp'
option src 'wan'
option dest 'lan'
option dest_ip '10.100.101.1'
option src_dport '51821'
option dest_port '51820'
config rule 'wg'
option name 'Allow-WireGuard'
option proto 'udp'
option target 'ACCEPT'
option dest_port '51820'
option src 'wan'
config zone
option name 'guest'
option input 'REJECT'
option output 'ACCEPT'
option forward 'ACCEPT'
list network 'guest'
config forwarding
option src 'guest'
option dest 'wan'
config rule
option dest_port '53'
option src 'guest'
option name 'Allow DNS guest'
option target 'ACCEPT'
list proto 'udp'
config rule
option target 'ACCEPT'
option proto 'udp'
option src 'guest'
option src_port '68'
option dest_port '67'
option family 'ipv4'
option name 'Allow DHCP guest'