I am trying to use a Linksys WHW03v2 router and AP to act as the main router for my home LAN. The main problem is that it has just a single lan port and a single wan port. Therefore I am trying to get the network, firewall, wireless and dhcp config files right in one shot!
I will admit that I had this working briefly and then a very minor change to the openwrt (related to avahi) basically bricked the configuration and I had to reset to defaults and start again. After another frustrating day I've decided to throw myself on the mercy of this forum.
config interface 'loopback'
option device 'lo'
option proto 'static'
list ipaddr '127.0.0.1/8'
config globals 'globals'
option dhcp_default_duid '000407ea4406edd645e2a2d44fa778fafcb6'
option ula_prefix 'fd77:4dea:55af::/48'
option packet_steering '1'
# Trunk bridge - lan port only
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan'
# Home bridge - home wireless interfaces
config device
option name 'br-home'
option type 'bridge'
list ports 'phy1-ap0'
list ports 'phy2-ap0'
# Guest bridge - guest wireless interfaces
config device
option name 'br-guest'
option type 'bridge'
list ports 'phy1-ap1'
list ports 'phy2-ap1'
# IoT bridge - iot wireless interfaces
config device
option name 'br-iot'
option type 'bridge'
list ports 'phy1-ap2'
list ports 'phy2-ap2'
# VLAN 10 - home trunk
config bridge-vlan
option device 'br-lan'
option vlan '10'
list ports 'lan:t'
# VLAN 20 - guest trunk
config bridge-vlan
option device 'br-lan'
option vlan '20'
list ports 'lan:t'
# VLAN 30 - iot trunk
config bridge-vlan
option device 'br-lan'
option vlan '30'
list ports 'lan:t'
# Home interface - VLAN 10 trunk + wireless bridge
config interface 'home'
option proto 'static'
option ipaddr '192.168.10.254'
option netmask '255.255.255.0'
option device 'br-lan.10'
option bridge_empty '1'
# Guest interface - VLAN 20 trunk + wireless bridge
config interface 'guest'
option proto 'static'
option ipaddr '192.168.20.254'
option netmask '255.255.255.0'
option device 'br-lan.20'
option bridge_empty '1'
# IoT interface - VLAN 30 trunk + wireless bridge
config interface 'iot'
option proto 'static'
option ipaddr '192.168.30.254'
option netmask '255.255.255.0'
option device 'br-lan.30'
option bridge_empty '1'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
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 'home'
option interface 'home'
option start '100'
option limit '150'
option leasetime '12h'
config dhcp 'guest'
option interface 'guest'
option start '100'
option limit '50'
option leasetime '1h'
config dhcp 'iot'
option interface 'iot'
option start '100'
option limit '100'
option leasetime '24h'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/odhcpd.leases'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
option piodir '/tmp/odhcpd-piodir'
option hostsdir '/tmp/hosts'
wireless (with passwords removed)
config wifi-device 'radio0'
option type 'mac80211'
option path 'soc/40000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
option band '5g'
option channel '100'
option htmode 'VHT80'
config wifi-iface 'home_radio0'
option device 'radio0'
option network 'home'
option mode 'ap'
option ssid 'hlan'
option encryption 'psk2'
option key 'YOUR_HOME_PASSWORD'
config wifi-iface 'guest_radio0'
option device 'radio0'
option network 'guest'
option mode 'ap'
option ssid 'hstead'
option encryption 'psk2'
option key 'YOUR_GUEST_PASSWORD'
config wifi-iface 'iot_radio0'
option device 'radio0'
option network 'iot'
option mode 'ap'
option ssid 'sloth'
option encryption 'psk2'
option key 'YOUR_IOT_PASSWORD'
config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/soc/a000000.wifi'
option band '2g'
option channel '1'
option htmode 'VHT20'
config wifi-iface 'home_radio1'
option device 'radio1'
option network 'home'
option mode 'ap'
option ssid 'hlan'
option encryption 'psk2'
option key 'YOUR_HOME_PASSWORD'
config wifi-iface 'guest_radio1'
option device 'radio1'
option network 'guest'
option mode 'ap'
option ssid 'hstead'
option encryption 'psk2'
option key 'YOUR_GUEST_PASSWORD'
config wifi-iface 'iot_radio1'
option device 'radio1'
option network 'iot'
option mode 'ap'
option ssid 'sloth'
option encryption 'psk2'
option key 'YOUR_IOT_PASSWORD'
config wifi-device 'radio2'
option type 'mac80211'
option path 'platform/soc/a800000.wifi'
option band '5g'
option channel '36'
option htmode 'VHT80'
config wifi-iface 'home_radio2'
option device 'radio2'
option network 'home'
option mode 'ap'
option ssid 'hlan'
option encryption 'psk2'
option key 'YOUR_HOME_PASSWORD'
config wifi-iface 'guest_radio2'
option device 'radio2'
option network 'guest'
option mode 'ap'
option ssid 'hstead'
option encryption 'psk2'
option key 'YOUR_GUEST_PASSWORD'
config wifi-iface 'iot_radio2'
option device 'radio2'
option network 'iot'
option mode 'ap'
option ssid 'sloth'
option encryption 'psk2'
option key 'YOUR_IOT_PASSWORD'
and finally firewall - note that the last rule is an attempt to keep access to the router while the wan port is plugged into my existing, minimal home lan. This is currently working but I will of course remove the rule before connecting it to my ISP!
config defaults
option syn_flood 1
option input REJECT
option output ACCEPT
option forward REJECT
# Home zone - full access
config zone
option name home
list network 'lan'
option input ACCEPT
option output ACCEPT
option forward ACCEPT
# Guest zone - internet only
config zone
option name guest
list network 'guest'
option input REJECT
option output ACCEPT
option forward REJECT
# IoT zone - LAN only, no internet
config zone
option name iot
list network 'iot'
option input REJECT
option output ACCEPT
option forward REJECT
# WAN zone
config zone
option name wan
list network 'wan'
list network 'wan6'
option input REJECT
option output ACCEPT
option forward DROP
option masq 1
option mtu_fix 1
# Forwarding rules
config forwarding
option src home
option dest wan
config forwarding
option src guest
option dest wan
# Block inter-network traffic
config rule
option name block-guest-to-home
option src guest
option dest home
option target REJECT
config rule
option name block-guest-to-iot
option src guest
option dest iot
option target REJECT
config rule
option name block-iot-to-home
option src iot
option dest home
option target REJECT
config rule
option name block-iot-to-guest
option src iot
option dest guest
option target REJECT
# Allow DHCP on all internal zones
config rule
option name Allow-DHCP-home
option src home
option proto udp
option dest_port 67-68
option target ACCEPT
config rule
option name Allow-DHCP-guest
option src guest
option proto udp
option dest_port 67-68
option target ACCEPT
config rule
option name Allow-DHCP-iot
option src iot
option proto udp
option dest_port 67-68
option target ACCEPT
# Standard WAN rules
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 dest_port 546
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
####### WARNING! MUST BE REMOVED BEFORE CONNECTING TO ISP ######
config rule
option name 'Allow-SSH-wan'
option target 'ACCEPT'
option src 'wan'
option dest_port '22'
option proto 'tcp'
option family 'ipv4'
################################################################
I can connect to the wifi network "hlan" and ping an external IP address but not the 192.168.10.254 gateway. There are minor problems with the "hstead" network too.
My primary question is, am I doing this right? Are there any glaring errors? particularly in the "network" and "wireless" files where I am least confident.
Many thanks for any and all advice/pointers.
G