Hello!
OpenWRT beginner here. Although I was looking for it, I wasn't able to find my specific problem. I recently set up OpenWRT on a TP-Link Archer C7 v4 device.
My goal is to have three separated network segments:
- Main (my laptops, phones) via WIFI
- Access to internet
- Access to OpenWRT web interface/SSH
- Access to other devices on the same VLAN
- Access to devices on other VLANs (e.g. web interface of robot vacuum)
- IOT-online (IOT devices that need access to the internet) via WIFI and four physical switch ports
- Access to internet
- NO access to OpenWRT web interface/SSH
- NO access to other devices on the same VLAN
- NO access to devices on other VLANs
- IOT-offline (IOT devices that do not need internet) via WIFI
- NO Access to internet
- NO access to OpenWRT web interface/SSH
- NO access to other devices on the same VLAN
- NO access to devices on other VLANs
What I did was:
- Create three VLANs (10: main, 20: iot-online, 30: iot-offline)
- Create three bridges based on these VLANs
- Create three interfaces
- Create three wifi access points
- Do the firewall config
Please see my config files attached.
The main segment and the IOT-offline segment work as intended, however from wireless devices in the IOT-online segment I can access wired IOT devices in the IOT-online segment. Also wired devices in the IOT-online segment can access OpenWRT router web interface and don't seem to be restricted at all.
My questions are:
- How can I get both wireless and wired devices in the IOT-online segment to behave as expected?
- I have the feeling that there is some basic concept I didn't understand yet. What did I miss?
- I am doing this to enhance my network security and to learn. Is there anything in the config you would recommend to improve in order to enhance security? Anything I can safely remove?
Thank you for any insights!
/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 'fd8f:9248:8bf6::/48'
option packet_steering '1'
config device
option name 'eth0.2'
option macaddr '****'
config interface 'wan'
option device 'eth0.2'
option proto 'dhcp'
config interface 'wan6'
option device 'eth0.2'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 1'
option vid '2'
config device
option type '8021q'
option ifname 'eth0'
option vid '10'
option name 'eth0.10'
option ipv6 '0'
config device
option type '8021q'
option ifname 'eth0'
option vid '20'
option name 'eth0.20'
option isolate '1'
config device
option type '8021q'
option ifname 'eth0'
option vid '30'
option name 'eth0.30'
config interface 'main'
option proto 'static'
option device 'br-main'
option ipaddr '192.168.10.1'
option netmask '255.255.255.0'
option type 'bridge'
config interface 'iot_online'
option proto 'static'
option device 'br-iot-online'
option ipaddr '192.168.20.1'
option netmask '255.255.255.0'
option type 'bridge'
config interface 'iot_offline'
option proto 'static'
option device 'br-iot-offline'
option ipaddr '192.168.30.1'
option netmask '255.255.255.0'
option type 'bridge'
config device
option type 'bridge'
option name 'br-main'
list ports 'eth0.10'
config device
option type 'bridge'
option name 'br-iot-online'
list ports 'eth0.20'
config device
option type 'bridge'
option name 'br-iot-offline'
list ports 'eth0.30'
config switch_vlan
option device 'switch0'
option vlan '3'
option ports '0t 2 3 4 5'
option vid '20'
/etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option path 'pci0000:00/0000:00:00.0'
option band '5g'
option channel 'auto'
option htmode 'HT20'
option cell_density '0'
config wifi-device 'radio1'
option type 'mac80211'
option path 'platform/ahb/18100000.wmac'
option band '2g'
option channel 'auto'
option cell_density '0'
option legacy_rates '1'
option htmode 'HT20'
config wifi-iface 'wifinet0'
option device 'radio0'
option mode 'ap'
option ssid 'Main'
option encryption 'psk2'
option key '****'
option network 'main'
config wifi-iface 'wifinet1'
option device 'radio1'
option mode 'ap'
option ssid 'IOT-Offline'
option encryption 'psk2'
option key '****'
option network 'iot_offline'
option isolate '1'
config wifi-iface 'wifinet3'
option device 'radio1'
option mode 'ap'
option ssid 'IOT-Online'
option encryption 'psk2'
option key '****'
option network 'iot_online'
option disassoc_low_ack '0'
option isolate '1'
/etc/config/firewall
config defaults
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wan'
list network 'wan6'
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-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-Main'
option src 'wan'
option dest 'main'
option proto 'esp'
option target 'ACCEPT'
option enabled '0'
config rule
option name 'Allow-ISAKMP-Main'
option src 'wan'
option dest 'main'
option dest_port '500'
option proto 'udp'
option target 'ACCEPT'
option enabled '0'
config zone
option name 'main'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'main'
config forwarding
option src 'main'
option dest 'wan'
config zone
option name 'iot_online'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
list network 'iot_online'
config forwarding
option src 'iot_online'
option dest 'wan'
config zone
option name 'iot_offline'
option input 'REJECT'
option output 'REJECT'
option forward 'REJECT'
list network 'iot_offline'
config rule
option src 'iot_online'
option name 'Allow-DHCP-IOT_online'
list proto 'udp'
option dest_port '67-68'
option target 'ACCEPT'
config rule
option dest 'iot_online'
option name 'Allow-DHCP-IOT-online-Outgoing'
list proto 'udp'
option src_port '67-68'
option target 'ACCEPT'
config rule
option src 'iot_online'
option name 'Allow-DNS-IOT_online'
option dest_port '53'
option target 'ACCEPT'
config rule
option src 'iot_offline'
option name 'Allow-DHCP-IOT_offline'
option dest_port '67-78'
option target 'ACCEPT'
list proto 'udp'
config rule
option dest 'iot_offline'
option name 'Allow-DHCP-IOT-offline-Outgoing'
list proto 'udp'
option src_port '67-68'
option target 'ACCEPT'
config forwarding
option src 'main'
option dest 'iot_offline'
config forwarding
option src 'main'
option dest 'iot_online'
config rule
option src 'iot_online'
option dest 'iot_online'
option name 'Reject-IOT-Online-To-IOT-Online'
option target 'REJECT'