Guest/IoT WiFi with VLANs (multple APs)
Time to revisit the Guest WiFi setup.
I'm planning an additional AP for guests and IoT devices.
So let's see if we can get VLANs setup...
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '5 6'
This is confusing: ports 5 and 6 are setup as part of VLAN2 - but aren't used/connected ?
(could be an internal connection for the wifi - but let's go boldly etc.)
add a VLAN3 under switch config
note: I have the CPUport AND port2 tagged. in both VLAN1 and the new VLAN3.
I will be connecting my additional AP on port2. (/etc/config/network)
config switch_vlan
option device 'switch0'
option vlan '3'
option vid '3'
option ports '0t 2t'
then define a new interface 'guest'
attach it to eth0.3 with STATIC IP (/etc/config/network)
config interface 'guest'
option proto 'static'
option ifname 'eth0.3'
option ipaddr '10.0.3.1'
option netmask '255.255.255.0'
and a new wifi attached to 'guest' (/etc/config/wireless)
config wifi-iface
option device 'radio1'
option mode 'ap'
option ssid 'guest'
option network 'guest'
option encryption 'psk2'
option key '<secret>'
!note: I had a dhcp/dns fail when doing this all via LUCI, hence the conf files.
almost there, add a firewall zone, and a allow forwarding to WAN.(/etc/config/firewall)
config zone
option input 'REJECT'
option forward 'REJECT'
option output 'ACCEPT'
option name 'guest'
option network 'guest'
config forwarding
option dest 'wan'
option src 'guest'
finally, give them access to dnsmasq for dhcp and dns (/etc/config/firewall)
restart all the services and that's it.
I'm planning an additional AP for guests and IoT devices.
So let's see if we can get VLANs setup...
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '5 6'
(could be an internal connection for the wifi - but let's go boldly etc.)
add a VLAN3 under switch config
note: I have the CPUport AND port2 tagged. in both VLAN1 and the new VLAN3.
I will be connecting my additional AP on port2. (/etc/config/network)
config switch_vlan
option device 'switch0'
option vlan '3'
option vid '3'
option ports '0t 2t'
then define a new interface 'guest'
attach it to eth0.3 with STATIC IP (/etc/config/network)
config interface 'guest'
option proto 'static'
option ifname 'eth0.3'
option ipaddr '10.0.3.1'
option netmask '255.255.255.0'
config wifi-iface
option device 'radio1'
option mode 'ap'
option ssid 'guest'
option network 'guest'
option encryption 'psk2'
option key '<secret>'
add DHCP for the guest interace (/etc/config/dhcp)
config dhcp 'guest'
option interface 'guest'
option start '100'
option limit '150'
option leasetime '1h'
option dhcpv6 'server'
option ra 'server'
option ra_management '1'
almost there, add a firewall zone, and a allow forwarding to WAN.(/etc/config/firewall)
config zone
option input 'REJECT'
option forward 'REJECT'
option output 'ACCEPT'
option name 'guest'
option network 'guest'
config forwarding
option dest 'wan'
option src 'guest'
restart all the services and that's it.
Comments
Post a Comment