Configuring a home router + NAS on unRAID (part 2)

In the first part, I briefly talked about the assembly itself, which allows you to make a computer on which you can run unRAID to create NAS and MikroTik RouterOS in the KVM virtual machine as a replacement for a regular router.







The comments turned out to be quite useful discussions, the results of which need to correct errors in the original assembly and write the third part! I’ll try some of the suggestions on myself and, I hope, I will write the third part.







For the initial installation, you will have to connect a monitor, keyboard and mouse to the server.







Install unRAID



We go to the site and install unRAID on the USB stick (which I forgot to add to the table). Recommendations for flash drives are standard: a normal brand and a larger physical size (for better cooling). UnRAID will boot from this flash drive, so your SSDs will go completely cacheless. More official information here .







Do not forget to include VT-d and VT-x support in the BIOS!







We connect the USB flash drive to the server and run it in the GUI mode.







Standard username and password: root without password.







Version at time of writing: 6.7.2







After starting the OS, make sure that all connected hardware is detected. The system should see all of your drives (the drives are displayed on the Main tab), two Ethernet controllers and a Wi-Fi card (which is convenient to see in Tools -> System Devices).







Problem with Marvell SATA controllers



Due to some kind of bug in the Marvell controller driver, they do not work after enabling VT-d in unRAID version 6.7.x.







I chose the simplest solution: added iommu=pt



to the parameter string passed to the Linux kernel at boot time. This is done on the Main tab (then click on the "Flash" device). Also, you can initially change the config on the USB flash drive: boot/syslinux/syslinux.cfg

















About Intel vPro



I do not recommend looking for hardware that supports vPro / AMT.







Firstly, for the remote desktop to work properly, you need to connect an HDMI-dummy or DP-dummy plug, otherwise the integrated video card will not initialize without a connected monitor.







Secondly, the quality of Intel client software is extremely low.







Thirdly, you will achieve the same functionality for home use with a wireless or wired HDMI / DP extension cable and at the same time you will not be limited in any way in choosing iron.







Network configuration



Go Settings -> Network Settings. As you may have guessed, one of the interfaces will look at the local network, the second at the Internet. To get started, decide which one will be connected to your local network. There are stickers with MAC addresses on my motherboard on the connectors, that's how I understood who is who.







In a nutshell, what you need to do: assign each interface as a member of two separate L2 bridges and set a static IP address on the one that is connected to the local network. An IP address is not needed on the Internet-looking interface; RouterOS will handle it.







Here's what you should get:

















You can leave the address assignment for eth0 via DHCP, but then for any problems in RouterOS we will not be able to access unRAID and we will need to connect the monitor and keyboard to the server.







After setting up the network, you can go to the remote configuration by manually setting the IP address of the LAN client.







Storage Setup



To start the virtual machine, you need storage, so it's time to configure it. I will not describe in detail, since it is quite simple: you need to assign roles to hard drives - one Disk 1, the other - Parity.







In the first part I wrote that one SSD is enough, but in fact it is not so: it is better to take two identical ones and create a cache-pool from them, so the data on them will be protected in case of failure of one. Also, in unRAID there is no mechanism for backing up data from the cache. Everything is described in more detail here .







It should turn out like this (sorry, I have not bought a second SSD yet):















Also, you can immediately configure the schedule for parity and data transfer from the cache. This is done on the Settings -> Scheduler page.







It is enough to check the parity once every two months, and transfer data from the cache daily at night.







You can immediately configure the resources available over the network in the Shares tab:















Due to the fact that I have only one disk for the cache, domains is unprotected. Everything should be green for you.







Install RouterOS



First you need to download the installation iso image from here (select x86 Stable CD Image) and put it in \\Tower\isos



.







Now it's time to create a virtual machine.







Enable support in Settings -> VM Manager. After that, a new tab will appear - VMs, go to it.







Click Add VM, then Linux.









Remember which MAC addresses which interfaces will receive in order to further match them in RouterOS.







For some reason, automatic port assignment for different VMs didn’t always work for me, so open the resulting XML config and correct the line with VNC settings for something like this:







 <graphics type='vnc' port='5900' autoport='no' websocket='5700' listen='0.0.0.0' keymap='en-us'> <listen type='address' address='0.0.0.0'/> </graphics>
      
      





If you, like me, did not have a Wi-Fi adapter in Other PCI Devices, enter it manually. To do this, find out its address on the PCI bus. The easiest way to do this is in Tools -> System Devices, there will be a line:







 IOMMU group 23: [168c:003c] 0b:00.0 Network controller: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter
      
      





Which in my case turns into:









(Sorry, the MD parser at the hubr is somehow buggy on this passage, I had to insert a picture)







You can start the VM and connect to it via VNC. Installing RouterOS is very easy! After the invitation to select packages, the easiest way is to select everything with the a



key and end the installation with the i



key, refusing to save the old configuration and agreeing to the formatting of the disk.















After the reboot, enter admin as the login, the password is empty.







Type /interface print



and make sure that the system sees all three of your network interfaces (I took a screenshot from an already configured system where the names are different from the default ones):















At this stage, you can download winbox , connect to RouterOS by MAC address and perform further configuration via the GUI.







I believe that the detailed configuration of RouterOS is beyond the scope of this article, especially since there are a lot of manuals on the Internet, so I suggest you start with the standard Quick Setup:















You can connect the cable with the Internet to a free port and switch the LAN client to automatically obtain an IP address, as well as check the Wi-Fi functionality. After making sure that everything works, you can buy and enter the RouterOS license key.







Adding a VM with Linux



To work in a more familiar environment, create another virtual machine on which we will run your favorite% distro_name%







Still download the ISO image and put it in isos









Go to the already familiar tab VMs, then Add VM, the vast majority of settings can now be left default.









All the same, in the config, we configure the VNC server:







 <graphics type='vnc' port='5901' autoport='no' websocket='5701' listen='0.0.0.0' keymap='en-us'> <listen type='address' address='0.0.0.0'/> </graphics>
      
      





Install the system, it should get IP over DHCP and have access to the Internet.







To make the FS directory available on the host, add the following line to /etc/fstab



:







 shared /mnt/shared 9p trans=virtio,version=9p2000.L 0 0
      
      





Now you can use the usual services on a familiar Linux-machine, which will be easily portable to other hardware!







If everything works fine and turns on and off correctly, then you can buy and enter the key for unRAID. Do not forget that it binds to the GUID of the flash drive (although it can be ported). Also, without a license, the automatic start of the VM will not work.







The final



Thank you for reading to the end!







I tried not to write a lot, but still, in my opinion, it turned out to be quite long. The rest of the features of unRAID are quite simple to configure in my opinion, especially since everything is configured with a mouse.







Good ideas that can be installed on the VM are here . I think that everyone has their own needs and it’s impossible to list some universal list. Although, pi.hole, of course, you can advise absolutely everyone :)







I hope I have enough to continue!








All Articles