Adding OpenWrt support for QNAP QHora-301W

Hi,

That might sound like a stupid question but how do I achieve that ? I found this page about aliases but that's all. Nothing in the webGui allows to change name either.
Is that as simple as changing names in /etc/config/network (and maybe references in others config files) ?

Yes, basically what you should do, going from a non-official build to official:

  1. Install luci-app-attendedsysupgrade, nano, and enable Advanced mode on the Attended Sysupgrade settings page on the web interface.
  2. Manually edit /etc/config/network and rename the interfaces as per @kirdes' comment
  3. This is important, DO NOT restart the network or apply the configuration - just save the changes (best to do the edit with nano)
  4. Use the Attended Sysupgrade page on the web interface to upgrade to the official build. Make sure that luci is selected for installation into the image (i.e. it's on the list when you search for an update - this is why we enabled Advanced mode in step 1). ASU should pick luci up (as well as any other packages you've installed), but I've seen it fail to do so, so just double check the list, and add luci (and anything else you might need, e.g. I added luci-app-pbr for some advanced routing)
  5. Install the upgrade once ASU finished generating it for you.
  6. Wait for the router to reboot
  7. ???
  8. Profit Enjoy!

Basically, by not reloading the network service, you're storing the configuration for the next reload of the service - which will happen after the upgrade. You have to make sure you don't accidentally reboot before upgrading, as that would kill pretty much all networking (except for WiFi).

@fonix232 Alright thanks a lot for this detailed procedure. I'll give a try tonight after work.

I'm a bit surprised that in my case, while upgrading to the official build I did not edit /etc/config/network and still managed to get the official build up and running

Are you sure everything is working and the network config didn't change? Also are you absolutely sure your first build wasn't after @robimarko renamed the interfaces?

Yes, works really nicely. Note that I built the image myself and could connect to the LAN ports after flashing.

I logged into LUCI and observed that the LAN ports had changed to lan1-lan4, 10g-1 and 10g-2

I took the risk and attempted to restore my existing backup file since I wanted to save the time required to configure, but I ended up in some issues and concluded that the new ports enumeration could have caused the issue. I had to reset the router, logged in and reconfigure afresh to get my setup up and running again.

That's interesting, since there's no migration script present to automagically rename the interfaces. My guess is, your build of the image was after robimarko's changes to the interface naming.

Yes, I initially built and flashed from Robimarko's repo, then noticed that the device has become officially supported after @Kirdes replied to my questions about the correct branch to build from.

I proceeded to build and flashed from OpenWrt master afterwards.

Has anyone managed to get VLANs working on the latest build?

My current configuration, which used to work on the Belkin RT3200:

config device
	option name 'switch'
	option type 'bridge'
	option stp '1'
	option igmp_snooping '1'

config bridge-vlan 'vlan_lan'
	option device 'switch'
	option vlan '1'
	option ports '10g-1 10g-2 lan2 lan3 lan4'

config bridge-vlan 'vlan_guest'
	option device 'switch'
	option vlan '2'
	option ports '10g-1:t 10g-2:t lan2:t lan3:t lan4:t'

config bridge-vlan 'vlan_iot'
	option device 'switch'
	option vlan '3'
	option ports '10g-1:t 10g-2:t lan2:t lan3:t lan4:t'

config interface 'lan'
	option device 'switch.1'
	option proto 'static'
	option ip6assign '60'
	option ipaddr '10.0.0.1'
	option netmask '255.255.254.0'
	option ip6ifaceid '::1'
	list dns '1.1.1.1'
	list dns '1.0.0.1'

config interface 'guest'
	option proto 'static'
	option device 'switch.2'
	option ipaddr '10.0.2.1'
	option netmask '255.255.255.0'

config interface 'iot'
	option proto 'static'
	option device 'switch.3'
	option ipaddr '10.0.3.1'
	option netmask '255.255.255.0'

config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option localservice '1'
	option ednspacket_max '1232'

config dhcp 'lan'
	option interface 'lan'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'
	option start '255'
	option limit '254'
	option leasetime '5m'
	option force '1'
	list dhcp_option '6,1.1.1.1,1.0.0.1'

config dhcp 'guest'
	option interface 'guest'
	option start '10'
	option leasetime '2m'
	option limit '200'

config dhcp 'iot'
	option interface 'iot'
	option leasetime '12h'
	option start '10'
	option limit '200'

The lan network works just fine, however the other subnets (guest and iot for now, I plan on adding a few more for VPN based routing) simply don't work - not even DHCP requests seem to happen properly, as my APs receive no response. The following is all the DHCP-related requests on my wireless APs:

Sun Jan 29 18:05:24 2023 daemon.notice netifd: iot (4743): udhcpc: started, v1.36.0
Sun Jan 29 18:05:24 2023 daemon.notice netifd: iot (4743): udhcpc: broadcasting discover
Sun Jan 29 18:05:27 2023 daemon.notice netifd: iot (4743): udhcpc: broadcasting discover
Sun Jan 29 18:05:30 2023 daemon.notice netifd: iot (4743): udhcpc: broadcasting discover

The 301w doesn't even show the DHCP requests being received, however.

EDIT: Looks like luci-app-opkg was also removed from the default packaging, but manually installing it will return the Software page (just needed a restart).

Vlans working. The vlan config of QNAP is DSA compliant. Good video VLANs in OpenWrt 21 - YouTube

The above config is also DSA compliant, on the Belkin RT3200 it was working just fine. Even the first configured VLAN works fine. It's only the other networks defined (the tagged ones) that stopped functioning.