Wednesday, 10 August 2016

My home network

Over the years I have build a network of computers at my house that, when I explain it to others, seems a bit over the top . But please let me share it with you for entertainment and possible inspiration.

At the base of all computers is a TP-Link WDR4300 router running Openwrt. It is the firewall, DNS and DHCP server, and WiFi access point. On the first floor, a TP-Link TL-WR1043ND serves as an additional access point and Ethernet switch. Apart from our home WiFi network they also have a guest network, used by a.o. guests (duh), my employer's laptop and the family Wii. The guest network is shared between the two routers using a separate VLAN, providing isolation at the Ethernet level.

Partnering with the routers for core services is "shoebox", a by now venerable server running Ubuntu. It is based on an Intel D945GCLF2 mainboard with a dual core Atom processor and 1Gb of ram. For storage it has two 3Tb Toshiba/Hitachi drives in raid1 and two USB disks for additional storage.

Shoebox provides a few core functions: it acts as a CUPS server for our printer, it provides general network storage via SAMBA, it is used by duplicity/dejadup for storing backups of other systems, it pretends to be an Apple server so my wife's Macbook can do timemachine backups, it has NFS for netbooting, and it runs mythtv.

Now that we have the likes of Netflix, the added value of mythtv seems limited. And I probably would not bother getting it to work if I would start today. But since it is there, it now records whatever we would like to watch on TV using two dvb-c tuners. In our house, we are all used to watch what we want when we want it, and skip over those annoying commercials. And it has essentially been like that for the past 12 years or so (except that I switched from analog to digital tuners 6 years ago).

For watching TV in the living room, there is an ion2 based mini-ITX system that netboots off shoebox and runs the mythtv front-end on mythbuntu. In the bedroom, a RPi2 with kodi/openelec serves a similar purpose. Also this one stores its data on shoebox. Using NFS for these front-ends makes them far more robust for the kind of power cycling that happens when family members are dissatisfied with performance.

The last part of the infrastructure is my backup machine. That one is where harddisks go to spent their final years. The system runs off a compact flash card in an IDE to flash convertor, and currently has 6 disks providing about 6TB of raid1 btrfs storage (so 12 TB raw). By he way, I have become a believer in Asian brands of harddisks. I have had the same 8 Samsung, Toshiba and Hitachi disks running for many years without problems, while, in my perhaps limited experience, Maxtor, WD and Seagate start having problems after 2-3 years.

The backup machine is normally switched off. All other computers actually make their backups on shoebox. A script on shoebox wakes the backup machine and then uses rsync to backup data from shoebox to the backup system. When done, it again powers down the backup machine, after making a btrfs snapshot. Once I finish the snapshot retiring/removal code that should run on the backup machine, I will put the backup script in a cron job. For now it is manually triggered. And for the future I am also dreaming about making some kind of shared backup over the internet with my brother or parents, so that we all have an off site backup as well.
I could add many more details to this story but I will save that for another day.

No comments: