We make a router and NAS on the same processor

I had a “home server” on Linux just a few years after I bought my computer. Now, more than fifteen years have passed since that moment and most of this time I had some kind of second additional computer at home. One day, when it was time to update it, I thought: why do I need a separate router if I already have a free computer? After all, long ago, in the XNUMXs, for many this was the standard configuration.

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

Entry

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

  1. The assembly should consist as much as possible of the most common standard components. This means no motherboards of sizes other than mATX / mini-ITX and low cases that do not fit full-size cards
  2. There should be plenty of space for disks, but the baskets themselves should be 2.5”
  3. Modularity should lead to savings over time - after all, a Wi-Fi card of the old standard 5 can simply be changed to 7
  4. Support for at least some kind of 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 away
  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 “chew” .torrent into several thousand files, or the enabled encryption causes the speed to drop below the disks or network connection.
  7. Visual beauty and neat assembly
  8. Highest compactness. The ideal size is a modern gaming console.

I’ll immediately warn you that if you believe that below in the article I will tell you how to complete all the points, you are very naive and you are better off buying Synology or a place in the cloud.
In fact, I don’t see anything unrealistic in such a solution, it’s just that perhaps I haven’t studied the entire proposal well enough, or perhaps because the market for self-assembled NAS has been in decline for a long time and there are fewer and fewer components for this purpose, and they are more expensive.

A little about the software

I've been so lazy lately that I don't even feel like configuring KVM myself, so I decided to try and see what unRAID is, which LinusTechTips has been touting so much as a handy GUI for configuring KVM and as good NAS software in general. Since I was also too lazy to tinker with mdadm, unRAID killed two birds with one stone.

Assembly

Chassis

Next came the surprisingly difficult part of assembling a homemade NAS using standard components: choosing a case! As I said, the days when cases with a door behind which there are baskets with disks are long gone. And I also really wanted to use 2,5” fifteen-millimeter Seagate drives (at the time of writing, the maximum capacity is 5TB). They are silent and take up little space. For now, 5TB was enough for me.

Obviously, I wanted a miniITX motherboard, 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 “other” cases, where there are already a couple of 3,5 of the corresponding size. There is simply no middle ground. Even for money. There was something on Ali, but it was discontinued (ALWAYS check Ali for unusual things, sometimes the Chinese have already invented everything and put it into mass production). On some small forum I read about the SilverStone CS01B-HS, but the price did not fit into the “budget” category at all. Tired of searching, I ordered it on Amazon through Shipito, which completely failed the third point of the technical specifications.

But now you don’t have to worry about the budget at all!

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

Processor

Of course, I wanted to use AMD as a processor, it’s 2019, it’s only available to those who don’t really delve into it. But, trying to complete step four “Remote control support”, I find only Ryzen DASH from AMD and I understand that in this case I need to choose Intel.

Next, everything is as always: Yandex.market, filters, easy Googling for children's problems and free delivery tomorrow within the Moscow Ring Road.

Motherboard

As for the motherboards, in fact, there is only one choice - Gigabyte GA-Q170TN.

I don’t have the slightest idea why the expansion slot is only x4, but if in the future you want to install a ten-gigabit network card there, there will be enough reserve (but you will no longer be able to connect storage that provides such performance).

One of the big advantages: two miniPCI-E slots. MikroTik produces all of its Wi-Fi cards (and these are the ones we need, because they are the only ones supported in RouterOS) in the miniPCI-E format, and, most likely, will continue to do so for many years, since this is their main standard for expansion cards. For example, you can buy their module LoRaWAN and easily get support for LoRa devices.

Two Ethernet, but 1 Gbit. In 2017, I put forward a law banning the sale of motherboards with Ethernet speeds up to 4 Gbit, but did not have time to collect the required number of signatures to pass the municipal filter.

Discs

We take two STDR5000200 as disks. For some reason they are cheaper than the ST5000LM000 that is actually there. After the purchase, we check it, disassemble it, take out the ST5000LM000 and connect it via SATA. In case of a warranty case, you put it back together and return it, receiving a new disk in exchange (I’m not kidding, I did that).

I did not use an NVMe SSD, perhaps in the future if the need arises.

Intel, in its best traditions, has made a mistake: 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 you need at least an i5-7500. But since there was no longer a limit on the budget, I resigned myself.

I don’t 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
Quantity
Price
Price

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
1
$159 + $17 (shipping from Amazon) + $80 (shipping to Russia) = $256
16 830

PCI-E controller Espada FG-EST14A-1-BU01
1
2 850
2 850

Power supply SFX 300 W Be quiet SFX POWER 2 BN226
1
4160
4160

Kingston SSD 240GB SUV500MS/240G {mSATA}
1
2 770
2 770

Intel Core i5-7500
1
10 000
10 000

GIGABYTE GA-Q170TN
1
9 720
9 720

MikroTik R11e-5HacT
1
3 588
3 588

Antennas
3
358
1 074

RouterOS license level 4
1
$45
2 925

unRAID Basic license
1
$59
3 835

Total 66 rubles. Point three about the economic part of the question has been destroyed to pieces, but it warms the soul that in ten years this hardware will still be able to perform the task.

Setting up the software was quite easy, fortunately, it has the ability to do so: 95% can be clicked with the mouse in one evening. I can describe this in a separate article if there is interest, since not everything was perfect, but there were no unsolvable problems that could not be solved. For example, it was not so easy to install wired Ethernet adapters in RouterOS, because its list of supported equipment is quite meager.

Conclusions after crossing the border in one hundred days uptime

  1. vPro is not needed for this purpose. This greatly narrows the choice of motherboards and processors, and for home use you will get by with a wireless HDMI extender and a wireless keyboard. As a last resort (the server is located in the basement under a reinforced concrete slab), use a twisted pair extension cord.
  2. 10 gigabits were needed yesterday. The average hard drive reads faster than 120 megabytes per second.
  3. The building consumed a quarter of the budget. It is unacceptable.
  4. A fast processor in a NAS/router is more necessary than it initially seemed
  5. unRAID is really good software, it has everything you need and nothing you don’t need. You pay once, if you need more disks, they only ask for the difference in the cost of licenses.

My former hap ac produced about 20 megabits with VPN tunnel encryption enabled. Now just one i5-7500 core is enough to deliver a gigabit.

We make a router and NAS on the same processor

PS

I am very glad if you read to the end and found it interesting! Please ask questions if anything is unclear. I could well have forgotten.

I'll answer the obvious right away:

- Why all this, can you just buy Synology?
- Yes, and I advise you to do so. It's easier, faster, cheaper and more reliable. This article is for enthusiasts who know why they need additional features.

— Why not FreeNAS, it has everything that is in unRAID, but for free?
— Alas, open source is completely different. FreeNAS is written by exactly the same programmers on a salary. And if you get their labor for free, then the end product is you. Or the investor will soon stop paying them.

— You can do everything on pure Linux and still save money!
- Yes. Once upon a time I did this too. But why? Setting up networking in Linux has always been a problem for me. Let it remain Computer Janitors. And RouterOS completely solves this class of problems. It’s the same with MD RAID: despite the fact that mdadm prevents me from making stupid mistakes, I still lost data. And unRAID simply prevents you from pressing the wrong button. Again, your time is not worth wasting on manually setting up storage.

- But you still installed regular Ubuntu in the virtual machine!
“That’s what it all started for.” Now you have your own personal AWS with maximum connection speed to your storage system, home network and the Internet at the same time, which no one can give you. It’s up to you to decide which services to run in this virtual machine.

- Any problem and there is immediately no Wi-Fi, no Internet, or storage in the house.
— There’s a spare router lying around for 1 rubles, but nothing is going anywhere from the disks. During all this time, except for disks and coolers, nothing broke. Even an ordinary nettop worked 000/24 for almost ten years and feels great now. Survived two discs.

Only registered users can participate in the survey. Sign in, you are welcome.

Should I write a second part about software configuration?

  • 60%Yes99

  • 18.1%I'm not interested, but write30

  • 21.8%No need36

165 users voted. 19 users abstained.

Source: habr.com

Add a comment