Post

My NAS - Part 1

Installation and Setup

My NAS - Part 1

I STRONGLY recommend making a backup of the entire EMMC onto a USB stick or drive before proceeding further!! This way, if something goes wrong, you can restore the factory OS so there is no question about whether your warranty is still intact!

Installation of OpenWRT

Let’s start by downloading and unpacking our OpenWRT install. I’m using 24.10.8 instead of 25.12.5, since it doesn’t support Docker at the time of this writing. Once 25.12.5 supports Docker, then I would consider upgrading to it.

1
2
wget https://downloads.openwrt.org/releases/24.10.8/targets/x86/64/openwrt-24.10.8-x86-64-generic-squashfs-combined-efi.img.gz
gunzip openwrt-24.10.8-x86-64-generic-squashfs-combined-efi.img.gz

Next, we need to write the image to the EMMC. I used my Ubuntu installation on the NVMe that I installed, but you may want to use a Ubuntu install image written to USB to do this.

1
dd if=openwrt-24.10.8-x86-64-generic-squashfs-combined-efi.img.gz of=/dev/mmcblk0 status=progress

Now, reboot the system. We need to get into the BIOS or UEFI with Ctrl+F12 and deactivate the watchdog under Advanced, which would reboot the NAS every 180 seconds if there was no software feedback. /assets/img/nas/watchdog.webp

Save the settings and reboot again. The NAS should boot into OpenWRT now.


Let’s Get Started

Our OpenWRT install is currently what I would call “router mode”, meaning it tries to be DHCP and DNS server for the network. We actually don’t need this configuration, as it seems to block internet access throughout my network. To fix this, we need to execute the following commands so that the NAS gets its IP address from our router.

1
2
3
4
5
uci set network.lan.proto='dhcp'
uci -q del network.lan.ipaddr
uci -q del network.lan.netmask
uci commit
service network restart

Next, we need to stop it from advertising itself as the ONLY DHCP server on the network.

1
2
3
4
5
6
uci -q del dhcp.@dnsmasq[0].authoritative
uci add_list dhcp.@dnsmasq[0].notinterface='lan'
uci set network.lan.proto='dhcp'
uci set dhcp.lan.force='1'
uci commit
service dnsmasq restart

Yay! We’ve fixed the networking problems that installing OpenWRT on the NAS created! (Eye roll)


Upgrading to OpenSSH

We can now start installing packages. However, there is a message in 24.10.8 that annoys me when I log in:

1
2
3
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html

Now, I could add a DropBear SSH configuration directive to disable the warning, however, upgrading to OpenSSH seems to be the better choice for me, as it seems to actually FIX the issue. So let’s do so:

1
2
3
4
5
6
7
8
9
10
# Move Dropbear to port 2222:
uci set dropbear.@dropbear[0].Port=2222
uci commit dropbear
/etc/init.d/dropbear restart

# Install and configure OpenSSH:
opkg update
opkg install openssh-server openssh-sftp-server 
sed -i 's/^#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
/etc/init.d/sshd restart

Set the Root password

Setting the root password prevents unauthorized access. I’m going to set my root password to MoeLarryCurly. Obviously, DON’T use this password for your machine.

1
(echo MoeLarryCurly; echo MoeLarryCurly) | passwd

Other Small Settings

We need to enable dropping invalid packets and enable software and hardware flow offloading:

1
2
3
4
5
uci set firewall.@defaults[0].drop_invalid='1'
uci set firewall.@defaults[0].flow_offloading='1'
uci set firewall.@defaults[0].flow_offloading_hw='1'
uci commit
service firewall restart

Setting Host Name and Time Zone

We need to change our hostname and set the time zone. I’m choosing “HomeLab” for the host name and I live in the “America/Chicago” timezone. Change your timezone to where you live.

1
2
3
4
5
uci set system.@system[0].hostname="HomeLab"
uci set system.@system[0].zonename="America/Chicago"
uci set system.@system[0].timezone='CST6CDT,M3.2.0,M11.1.0'
uci commit
service system restart

Install XPtsp IPK repository

We will need files from the XPtsp IPK repository, so let’s add it now.

1
2
3
4
echo "src/gz xptsp https://xptsp.github.io/openwrt-repo" >> /etc/opkg/customfeeds.conf
wget http://xptsp.github.io/openwrt-repo/openWrtUsign.pub
opkg-key add openWrtUsign.pub
opkg update

Fan Control

We need to install some packages to have control over the fans in LUCI:

1
2
opkg update
opkg install kmod-hwmon-it87 lm-sensors luci-app-fancontrol

Summary

Additional Information

This post is licensed under CC BY 4.0 by the author.

Trending Tags