We make a router and NAS on one processor

This article has a sequel .







I got a ā€œhome serverā€ on Linux just a few years after I bought a computer. Now, from that moment more than fifteen years have passed and most of this time I had some kind of second additional computer at home. Once, when it came time to update it, I thought: why do I need a separate router, if I already have a free computer? After all, then for a long time, in the zero, for many it was a standard configuration.







Indeed: today, for this, you can create a separate virtual machine and forward a USB or PCI Wi-Fi card there. And as an OS, you can use MikroTik RouterOS in one fell swoop, getting enterprise-level software for little money.







Introduction



I will outline my goals and objectives at the time when I was just starting the project:







  1. The assembly should consist of the most common standard components. This means that there are no motherboards of sizes other than mATX / mini-ITX and low cases in which full-size cards do not fit
  2. There should be plenty of disk space, but the baskets themselves are under 2.5 ā€
  3. Modularity should lead to savings after a while - after all, the Wi-Fi card of the old standard 5 can simply be changed to 7
  4. Support for at least some remote control, so that you can understand why the system does not rise, without physically connecting the monitor and keyboard to something standing high and far
  5. Complete freedom in choosing an OS and their support for all critical components in any OS
  6. High performance. Tired of waiting for Deluge to ā€œliveā€ .torrent into several thousand files or the encryption turned on, it leads to a drop in speed below disks or network connection.
  7. Visual beauty and accuracy of assembly
  8. The highest compactness. The ideal size is a modern game console.


Iā€™ll immediately warn you that if you believe that in the article below I will tell you how to complete all the points, you are very naive and you better buy Synology or a place in the cloud.

In fact, I donā€™t see anything unrealistic in such a decision, itā€™s just that I probably didnā€™t study the whole offer well enough, and maybe because the market for self-assembled NAS has long been in decline and components for this purpose are getting smaller and cheaper.







A bit about software



Recently, I became so lazy that I didnā€™t even want to configure KVM myself, so I decided to try to see what unRAID is, which LinusTechTips advertised so much as a convenient GUI for configuring KVM and as good software for the NAS as a whole. Since I was also too lazy to poke around with mdadm - unRAID killed two birds with one stone.







Assembly



Body



Next came, surprisingly, the hardest part of assembling a makeshift NAS on standard components: choosing a case! As I said, the times when the case with the door, behind which there are baskets with disks are long gone. And I still really wanted to use fifteen-millimeter Seagate as disks (at the time of writing, the maximum capacity is 5TB). They are silent and take up little space. While 5TB was enough for me.







Obviously, the motherboard wanted miniITX, since it seemed that one expansion slot was enough.







It turned out that there are compact cases the size of a netbook, but there is only one place for 2.5 and the ā€œotherā€ cases, where there are already a couple of 3.5 of the appropriate size. The middle simply does not exist. Even for the money. There was something on Ali, but it was discontinued (ALWAYS check Ali in search of unusual things, sometimes the Chinese have already invented everything and put it into mass production). In some small forum, I read about SilverStone CS01B-HS, but the price did not fit into the budget category at all. Tired of the search, I ordered it on Amazon through Shipito, which completely failed the third point of the technical task.







But now you could not worry about the budget at all!







I advise you to immediately make a 3D model of your Dream housing and turn it on a real aluminum CNC machine. It will be a little more expensive than silverstone, but a thousand times more pleasant. Just share it later on the github!







CPU



Of course, I wanted to take AMD as the processor, 2019 is in the yard, only those who do not delve deeply into shtud. But, trying to fulfill point four ā€œSupport for remote controlā€, I find AMD only Ryzen DASH and understand that in this case you need to choose Intel.







Further, everything is as always: Yandex.Market, filters, easy googling for children's problems and delivery tomorrow inside the MKAD for free.







Motherboard



From motherboards, in fact, the choice from one is Gigabyte GA-Q170TN.







I have no idea why the expansion slot is only x4, but if in the future you want to put a ten-gigabyte network card there, there will be enough stock (but you can no longer connect the storage providing such performance).







Of the big pluses: two miniPCI-E slots. MikroTik is releasing all of its Wi-Fi cards (and we need them, because they are only supported by RouterOS) in miniPCI-E format, and most likely will be releasing for many more years, as this is their main standard for expansion cards. For example, you can buy their LoRaWAN module and easily get support for devices with LoRa.







Two Ethernet but 1 Gbps. In 2017, I put forward a law banning the sale of motherboards with Ethernet speeds of up to 4 Gbps, but did not manage to collect the required number of signatures for the passage of the municipal filter.







Disks



We take two STDR5000200 as disks. For some reason, they cost less than the ST5000LM000, which are actually there. After the purchase, we check, disassemble, get the ST5000LM000 and connect via SATA. In the case of a warranty, you collect it and hand it over, receiving a new disc in exchange (Iā€™m not joking, I did it).







I did not use the NVMe SSD, perhaps in the future, if necessary.







Intel in its best traditions laid out a rake: there is not enough support in the motherboard, vPro support is also needed in the processor, and you will get tired of looking for a compatibility table. By some miracle, I found out that I need a minimum of i5-7500. But since there was no longer a limit on the budget, I reconciled.







I do not see anything interesting in the remaining components, they can be replaced with any analogues, so here is a general table with prices at the time of purchase:







Name number Price Cost
Crucial DDR4 SO-DIMM 2400MHz PC4-19200 CL17 - 4Gb CT4G4SFS624A 2 1,259 2,518
Seagate STDR5000200 2 8 330 16 660
SilverStone CS01B-HS one $ 159 + $ 17 (shipping from Amazon) + $ 80 (shipping to Russia) = $ 256 16,830
Controller PCI-E Espada FG-EST14A-1-BU01 one 2 850 2 850
Power supply unit SFX 300 W Be quiet SFX POWER 2 BN226 one 4160 4160
Kingston SSD 240GB SUV500MS / 240G {mSATA} one 2,770 2,770
Intel Core i5-7500 one 10,000 10,000
GIGABYTE GA-Q170TN one 9 720 9 720
MikroTik R11e-5HacT one 3,588 3,588
Antennas 3 358 1,074
RouterOS Level 4 License one $ 45 2 925
UnRAID Basic License one $ 59 3 835


Total 66 930 rubles. Point three about the economic part of the issue has been shattered, but the idea that in ten years this iron will still be able to fulfill its task warms up the soul.







Setting up the software was quite easy, good, he has it: 95% can be clicked with the mouse in one evening. I can describe this in a separate article if it is interesting, since not everything was perfect, but there were no unsolvable non-google problems. For example, it wasnā€™t so easy to get rid of wired Ethernet adapters in RouterOS, because its list of supported equipment is rather scarce.







Conclusions after crossing the border of a hundred days uptime



  1. vPro is not needed for this purpose. This greatly reduces the choice of motherboards and processors, and for home use you will need a wireless HDMI extension cable and a wireless keyboard. In extreme cases (the server is in the basement under a reinforced concrete slab) - use a twisted pair extension cable.
  2. 10 gigabits were needed yesterday. The average hard drive from the 2010s reads faster than 120 megabytes per second, for which a gigabit network is not enough. And we will also put the SSD cache, for which 1.25 GB / s may become a limitation.
  3. The corps ate a quarter of the budget. It is unacceptable.
  4. Fast processor in NAS / router - more needed than it seemed initially
  5. unRAID is really good software, there is everything that is needed and there is nothing that is not needed. You pay once, if you need more disks - they ask only for the difference in the cost of licenses.


My former hap ac was giving out about 20 megabits with VPN tunnel encryption enabled. Now just one core i5-7500 is enough to give out gigabits.









PS



I am very glad if you read to the end and it was interesting to you! Please ask questions if something remains unclear. I could have completely forgotten.







I will immediately answer the obvious:







- Why all this, you can just buy Synology?

ā€œYes, and I advise you to do so.ā€ It is simpler, faster, cheaper and more reliable. An article for enthusiasts who know why they need additional features.







- Why not FreeNAS, is there everything that is in unRAID, but for free?

- Alas, open source is already completely different. FreeNAS is written by exactly the same programmers on a paycheck. And if you get their labor for free, then the final product is you. Or they will soon stop paying the investor.







- You can do everything on pure Linux and save more!

- Yes. Once I did it. But why? For me, setting up a network on Linux has always been a problem. Let that remain Computer Janitors. And RouterOS completely solves this class of problems. The same is with MD RAID: despite the fact that mdadm does not allow you to make stupid errors, I still lost the data. And unRAID just doesn't let you press the wrong button. Again, you should not waste your time manually configuring the repository.







- But you still installed the usual ubuntu in a virtual machine!

- For the sake of this, everything was started. Now you have your personal AWS with the maximum speed of connecting to your storage, home network and the Internet at the same time, which no one can give you. And what services to run in this virtual machine is up to you.







- Any problem in the house immediately there is no Wi-Fi, no internet, no storage.

- A spare router is lying for 1,000 rubles, and nothing will go from the drives. For all the time, apart from disks and coolers, nothing itself broke. Even a regular nettop has worked 24/7 for almost ten years and feels great right now. Survived two disks.








All Articles