Hi all,
I'm running OpenWrt 24.10.1 on my Flint 2 and am looking for some guidance with my VLAN/network design.
The Flint 2 has 1 WAN port and 5 LAN ports.
I'd like to create a VLAN per LAN port, so that anything plugged in to a port gets added to that VLAN and DHCP assigns it an IP from a corresponding CIDR. I'd also like the following routing:
-
Lan 1 port: VLAN 10 (media)
- CIDR: 192.168.10.0/24
- Egress to WAN
- Egress to VLAN 20
- Egress to VLAN 120
- Ingress from VLAN 20
- Ingress from VLAN 110
- There will be a 4-port unmanaged switch connected to this port
- DNS resolver A
-
Lan 2 port: VLAN 20 (iot)
- CIDR: 192.168.20.0/24
- No egress to WAN
- Egress to VLAN 10
- Ingress from VLAN 10
- DNS resolver B
-
Lan 3 port: VLAN 30 (dmz)
- CIDR: 192.168.30.0/24
- Network isolation
- Egress to WAN
- No egress to LAN
- DNS resolver C
-
Lan 4 port: VLAN 40 (work)
- CIDR: 192.168.40.0/24
- Egress to WAN
- Egress to VLAN 120
- DNS resolver D
-
Lan 5 port: VLAN 50 (mgmt)
- CIDR: 192.168.50.0/24
- I would like to restrict access to LUCI/SSH to this port, and this port would only be used for this.
Out of scope for this topic, but included for completeness, I also plan to create the following 3 wireless SSIDS, each with their own VLANs.:
-
VLAN 110 (wireless media):
- CIDR: 192.168.110.0/24
- Egress to VLAN 10
- Egress to VLAN 120
- DNS resolver A
-
VLAN 120 (wireless iot):
- CIDR: 192.168.120.0/24
- No egress to WAN
- Ingress from VLAN 10
- Ingress from VLAN 40
- Ingress from VLAN 110
- DNS resolver B
- mDNS needed for wifi speakers
-
VLAN 130 (guest):
- CIDR: 192.168.130.0/24
- No egress to LAN
- Network Isolation
- DNS resolver C
Question 1: Does this make sense to folks? Does anyone see any glaring issues with this design?
Question 2: Can I get some help with the VLAN config?
Here's my current configs:
/etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd14:d070:8843::/48'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
list ports 'lan5'
config device
option name 'lan1'
config device
option name 'lan2'
config device
option name 'lan3'
config device
option name 'lan4'
config device
option name 'lan5'
config interface 'lan'
option device 'br-lan.1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'eth1.201'
option proto 'pppoe'
option username ''
option password ''
option ipv6 'auto'
config bridge-vlan
option device 'br-lan'
option vlan '1'
list ports 'lan1:t'
list ports 'lan2:t'
list ports 'lan3:t'
list ports 'lan4:t'
list ports 'lan5:u*'
config bridge-vlan
option device 'br-lan'
option vlan '10'
list ports 'lan1:t'
list ports 'lan2:t'
list ports 'lan3:t'
list ports 'lan4:t'
config bridge-vlan
option device 'br-lan'
option vlan '20'
list ports 'lan1:t'
list ports 'lan2:t'
list ports 'lan3:t'
list ports 'lan4:t'
list ports 'lan5:t'
config bridge-vlan
option device 'br-lan'
option vlan '30'
list ports 'lan1:t'
list ports 'lan2:t'
list ports 'lan3:t'
list ports 'lan4:t'
list ports 'lan5:t'
config bridge-vlan
option device 'br-lan'
option vlan '40'
list ports 'lan1:t'
list ports 'lan2:t'
list ports 'lan3:t'
list ports 'lan4:t'
list ports 'lan5:t'
config bridge-vlan
option device 'br-lan'
option vlan '50'
list ports 'lan1:t'
list ports 'lan2:t'
list ports 'lan3:t'
list ports 'lan4:t'
list ports 'lan5:t'
config bridge-vlan
option device 'br-lan'
option vlan '110'
list ports 'lan1:t'
list ports 'lan2:t'
list ports 'lan3:t'
list ports 'lan4:t'
list ports 'lan5:t'
config bridge-vlan
option device 'br-lan'
option vlan '120'
list ports 'lan1:t'
list ports 'lan2:t'
list ports 'lan3:t'
list ports 'lan4:t'
list ports 'lan5:t'
config bridge-vlan
option device 'br-lan'
option vlan '130'
list ports 'lan1:t'
list ports 'lan2:t'
list ports 'lan3:t'
list ports 'lan4:t'
list ports 'lan5:t'
config interface 'home'
option device 'br-lan.10'
option proto 'static'
option ipaddr '192.168.10.0'
option netmask '255.255.255.0'
config interface 'solo'
option device 'br-lan.20'
option proto 'static'
option ipaddr '192.168.20.0'
option netmask '255.255.255.0'
config interface 'dmz'
option device 'br-lan.30'
option proto 'static'
option ipaddr '192.168.30.0'
option netmask '255.255.255.0'
config interface 'lair'
option device 'br-lan.40'
option proto 'static'
option ipaddr '192.168.40.0'
option netmask '255.255.255.0'
config interface 'mgmt'
option device 'br-lan.50'
option proto 'none'
config interface 'wihome'
option device 'br-lan.110'
option proto 'static'
option ipaddr '192.168.110.0'
option netmask '255.255.255.0'
config interface 'wiiot'
option device 'br-lan.120'
option proto 'static'
option ipaddr '192.168.120.0'
option netmask '255.255.255.0'
config interface 'wiguest'
option device 'br-lan.130'
option proto 'static'
option ipaddr '192.168.130.0'
option netmask '255.255.255.0'
/etc/config/dhcp
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option cachesize '1000'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option ednspacket_max '1232'
option filter_aaaa '0'
option filter_a '0'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
option ra_slaac '1'
list ra_flags 'managed-config'
list ra_flags 'other-config'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
config dhcp 'home'
option interface 'home'
option start '100'
option limit '150'
option leasetime '12h'
config dhcp 'solo'
option interface 'solo'
option start '100'
option limit '150'
option leasetime '12h'
config dhcp 'dmz'
option interface 'dmz'
option start '100'
option limit '150'
option leasetime '12h'
config dhcp 'lair'
option interface 'lair'
option start '100'
option limit '150'
option leasetime '12h'
config dhcp 'wiguest'
option interface 'wiguest'
option start '100'
option limit '150'
option leasetime '12h'
config dhcp 'wihome'
option interface 'wihome'
option start '100'
option limit '150'
option leasetime '12h'
config dhcp 'wiiot'
option interface 'wiiot'
option start '100'
option limit '150'
option leasetime '12h'
/etc/config/firewall
config defaults
option syn_flood 1
option input REJECT
option output ACCEPT
option forward REJECT
# Uncomment this line to disable ipv6 rules
# option disable_ipv6 1
config zone
option name lan
list network 'lan'
option input ACCEPT
option output ACCEPT
option forward ACCEPT
config zone
option name wan
list network 'wan'
list network 'wan6'
option input REJECT
option output ACCEPT
option forward REJECT
option masq 1
option mtu_fix 1
config forwarding
option src lan
option dest wan
# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
option name Allow-DHCP-Renew
option src wan
option proto udp
option dest_port 68
option target ACCEPT
option family ipv4
# Allow IPv4 ping
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
# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
option name Allow-DHCPv6
option src wan
option proto udp
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
# Allow essential incoming IPv6 ICMP traffic
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
# Allow essential forwarded IPv6 ICMP traffic
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
/etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/soc/18000000.wifi'
option band '2g'
option channel '1'
option htmode 'HE20'
option disabled '1'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'
config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/soc/18000000.wifi+1'
option band '5g'
option channel '36'
option htmode 'HE80'
option disabled '1'
config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'OpenWrt'
option encryption 'none'