I just installed openWRT onto my UniFi 6+ but I am running into some issues that I don't really understand.
Note that I've followed the steps in this guide to make it a "dumb ap".
I do have a pfSense firewall running at 192.168.120.1 and I have configured five different VLANs in pfSense and I've setup the rules as I want.
My firewall also has a port that I dedicated to the interface at 192.168.122.1 (the gateway) and I've set my UniFi 6+ to have the static IP of 192.168.122.2.
However, when trying to configure the device I am doing as follows:
Creating a new "bridge device" and I have my only port selected in the "Bridge ports" list.
Setting up the VLANs as I want them (10 for IoT, 40 for guest and so on), then I save and I save and apply.
I then configure the newly created bridge by selecting all of the created VLANs in the "Bridge port" list and under the "Bridge VLAN filtering" option, I set "t" on all of the VLANS under "eth0" as well as themselves since I don't want a VLAN to know about another VLAN.
Now I create an interface called "Guest" and I assign it a static IPv4 (192.168.4) and I set the IPv4 gateway to be 192.168.40.1
(Note that the gateway IP is what I've set in pfSense)
Let's see the current status of the config in text form to understand what is going on.
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
You can use the reset button on the UniFi 6+ to instruct OpenWrt to do a hard reset. This will erase the faulty configuration and put the flash back to what it was when you installed OpenWrt. From the wiki:
On devices with a physical reset button, OpenWrt can be reset to default settings without serial or SSH access.
Power on the device and wait for the status led to stop flashing (or go into failsafe mode, as described above).
Press and hold the reset button for 10 seconds.
Release the reset button.
The device will do a hard factory reset (see below) and then reboot. This operation can be slow on some devices, so wait a few minutes before connecting again.
Then try to configure your device again, but do not click "Save & Apply" at any point. Instead, click on "unsaved changes" near the upper-right corner of LuCI to show us exactly what configuration changes you're about to make.
// cat /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
### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
# option src lan
# option src_ip 192.168.45.2
# option dest wan
# option proto tcp
# option target REJECT
# block a specific mac on wan
#config rule
# option dest wan
# option src_mac 00:11:22:33:44:66
# option target REJECT
# block incoming ICMP traffic on a zone
#config rule
# option src lan
# option proto ICMP
# option target DROP
# port redirect port coming in on wan to lan
#config redirect
# option src wan
# option src_dport 80
# option dest lan
# option dest_ip 192.168.16.230
# option dest_port 80
# option proto tcp
# port redirect of remapped ssh port (22001) on wan
#config redirect
# option src wan
# option src_dport 22001
# option dest lan
# option dest_port 22
# option proto tcp
### FULL CONFIG SECTIONS
#config rule
# option src lan
# option src_ip 192.168.45.2
# option src_mac 00:11:22:33:44:55
# option src_port 80
# option dest wan
# option dest_ip 194.25.2.129
# option dest_port 120
# option proto tcp
# option target REJECT
#config redirect
# option src lan
# option src_ip 192.168.45.2
# option src_mac 00:11:22:33:44:55
# option src_port 1024
# option src_dport 80
# option dest_ip 194.25.2.129
# option dest_port 120
# option proto tcp
That is not how to do it at all. I suggest starting over at least with the network part.
Since this hardware has its single Ethernet port directly connected to the CPU (there is no hardware switch and multiple ports) there are two ways to configure a VLANd AP.
The first way is the one that only works here and will not work on a device with a switch. Use a separate bridge for each VLAN.
config device
option type 'bridge'
option name 'br-lan'
list ports 'eth0.1'
config device
option type 'bridge'
option name 'br-vlan10'
list ports 'eth0.10'
config interface 'lan'
option device 'br-lan'
...
config interface 'vlan10'
option device 'br-vlan10'
option proto 'none'
etc
Note that all bridges tag packets onto eth0, and the device at the other end of the cable must be configured for the same numbers. Conventionally VLAN number 1 is used for the trusted LAN.
The other way is to use DSA type syntax. There is only one bridge, with all (one) of the hardware ports included in it. Then bridge-vlans exist inside that bridge. This configuration is portable to DSA switched hardware though the port names will likely need to be changed.
config device
option name 'br-eth'
option type 'bridge'
list ports 'eth0'
config bridge-vlan
option device 'br-eth'
option vlan 1
list ports 'eth0:t'
config bridge-vlan
option device 'br-eth'
option vlan '10'
list ports 'eth0:t'
config interface 'lan'
option device 'br-eth.1'
...
config interface 'vlan10'
option device 'br-eth.10'
etc.
To attach wifi APs to the bridge, use option network with the interface name in /etc/config/wireless. This will be resolved back to the underlying bridge or bridge-vlan in either scenario.
In both cases every VLAN needs an Interface attached to it even if it is proto none (Unmanaged in the GUI) or the bridge will not be created.
// cat /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 'fdb8:a057:f91e::/48'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.122.2'
option netmask '255.255.255.0'
option ip6assign '60'
option gateway '192.168.122.1'
config device
option type 'bridge'
option name 'Guest'
list ports 'eth0.40'
config interface 'VLAN_Guest'
option proto 'none'
option device 'Guest'
option defaultroute '0'
And when I connect a device to that SSID, I do indeed get an IP from the DHCP server I have in pfSense (192.168.40.100 in this case).
I do however think something might be miss configured since I can't reach anything from the WIFI even though I haven't set any blocking rules for the VLAN in the firewall rules as of yet.
I tried pinging 8.8.8.8 and I get a 100% packet loss.
If I however look in my firewalls system logs, I can see that it has passed.
Any idea on what can cause this and how I could troubleshoot this?
The last line (default route) is not required... delete it:
Have you verified that your main router is properly configured for this network? Specifically, do you have the ability to creat an access port on this VLAN such that you can connect a computer directly (via ethernet) and verify the behavior of this network?