• Stars
    star
    1,859
  • Rank 24,950 (Top 0.5 %)
  • Language
  • Created over 6 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Brad's homelab setup

Brad's Homelab

Hi, I'm Brad, @bradfitz on Twitter, etc.

This page describes my home server & networking setup.

Discussion

Questions welcome!

Goals

The primary goals of this project are...

  • to have a highly-available home Internet setup, with no SPOF (Single Point of Failure)

  • to learn and have fun.

In summary

I have 3 physical machines plugged into 3 switches, with all switches connected to each other. I don't have a physical router/gateway. Instead, a Linux virtual machine handles the IPv4 NAT, IPv6 announcements, DHCP, DNS, etc, and that Linux VM floats between the 3 machines as needed, including live migration during maintenance.

My 4 Wifi APs are PoE-powered from the two switches. I have two ISPs.

I have two UPSes and two PDUs powering separate halves of the gear, and separate ISPs, giving me about 35-45 minutes of runtime (and thus Internet) during a power outage. The whole house might be dark, but the battery-powered wifi will work.

In photos

Higher quality photos at https://photos.app.goo.gl/Y5Ah6AeGekVkf3tY9.

closed

top

switches

bottom

Gear

Servers

  • 3 x Supermicro SYS-5018D-FN8T
    • 64 GB RAM (2 x 32GB DDR4 PC4-19200 2400MHz 288p RDIMM), leaving room to double RAM later
    • boot/OS disk: 64 GB SATA DOM (SSD-DM064-SMCMVN1)
    • SSD 1: Samsung SSD 850 EVO 500GB
    • SSD 2: Samsung SSD 860 EVO 1TB
    • SSD 3: Samsung SSD 970 EVO Plus 2TB (M.2 NVMe)
    • HDD, external: 8000 GB HGST HUH728080ALE600

Switches

  • 2 x UniFi Switch 24 PoE-250W: 24x Power-over-Ethernet 1Gbps ports
  • 1 x UniFi Switch 16 XG: 10Gbps Aggregation Switch, primarily for Ceph (but part of same LAN). I only have one of these, but if it fails the Linux bond fails over to the 1Gbps switches.

Wi-Fi APs

Other

  • Previously used a UniFi Cloud Key to run the Unifi controller, but since moved it to a VM after it had a hardware/SD card failure.
  • misc Raspberry Pis for monitoring

Power

The whole setup including all APs and switches draws about 220 watts idle. Power is pretty cheap in Seattle. Washington State (as of April 2018) has the cheapest electricity in the United States, at $0.0974/kWh.

ISPs

Software

  • Proxmox VE is the Debian-based base OS on the servers, and Proxmox is a nice UI for managing qemu VMs and Ceph. I previously tried VMware for about a year, both are annoying in different ways. Proxmox might be a little rough in places, but I prefer it.
  • Ceph for storage. I love Ceph so much and discovering it makes this whole adventure worth it. Still much to learn, though.
  • ISC DHCP for the DHCP server. I auto-generate its config from a Go program that has a map of most my important devices' MAC addresses.
  • CoreDNS for the DNS server on the gateway VM, which lets me encrypt all upstream DNS so ISPs can't see or mess with it. (even though they can see IPs and SNI)
  • CoreRAD for IPv6 route announcements.
  • tcpproxy that Dave Anderson and I wrote. I use it on an HA VM to route ingress traffic to various VMs & services.
  • WireGuard for site-to-site routing between family member houses, and from devices.

Config

Network config

  • The LAN is 10.0.0.0/16.
  • Untrusted VLAN is 10.2.0.0/16, which the LAN can connect to, but the untrusted machines can't initiate connections back out to.
  • Gateway, DHCP at 10.0.0.1 (and 10.2.0.1 for untrusted)
  • DHCP range is 10.0.100-199.x so they're easy to recognize. Likewise for the untrusted VLAN.
  • Networking gear have static IPs 10.0.6.x (6 is above the letter N on the keyboard, which is how I map letters to numbers usually)
  • ...

Proxmox/host config

...

Device config

...

Firewall config

  • Ferm for simplifying writing iptables rules

Monitoring

  • Not enough yet. WIP. Plan is to use Prometheus more.
  • A Raspberry Pi has USB connections to the two UPSes.

Home Automation

Testing

TODO: link to program with dependency graph of all devices, services, and connections, and to simulate failures to validate there are no hidden SPOFs.

Past failures

  • I used to use a Soekris net6501 as my home gateway, but its CPU maxes out NAT'ing about 300 Mbps, sadly, so I started looking at alternatives when I got Centurylink fiber.
  • A truck once clipped the fiber running to our house. It's nice having a second WAN link.
  • I used to use a UniFi Security Gateway Pro but it failed one day and wouldn't power on any more. Dave had a backup for me handy, but the Unifi controller software wedged itself and wouldn't let me remove the old (dead) one and thus I couldn't add the new replacement, since you can only have one gateway in a site at a time. I was not amused, and that was the final straw that made me realize I wanted a highly-available setup.
  • I used to use VMware with highly-available vCenter setup, but the whole thing was felt bloated and slow and enterprisey, and I couldn't stand the Flash UI, which was still required for many operations. That's increasingly going away and being replaced with HTML5, but I also couldn't stand the VMware enterprise-targeted documentation. And I wanted to use something Open Source, too.

Thanks

Much thanks to Dave Anderson for helping with a lot of this. He has a very similar setup at his home and we enjoy watching each other both succeed and fail at trying new things.

More Repositories

1

http2

old repo for HTTP/2 support for Go (see README for new home)
Go
1,721
star
2

gomemcache

Go Memcached client library #golang
Go
1,638
star
3

goimports

(old repo) Tool to fix (add, remove) your Go imports automatically.
Go
1,031
star
4

talk-yapc-asia-2015

talk-yapc-asia-2015
Go
709
star
5

shotizam

Shotizam analyzes the size of Go binaries
Go
577
star
6

exp-httpclient

experimental new HTTP client API for #golang (WIP)
Go
576
star
7

embiggen-disk

embiggden-disk live-resizes a filesystem after first live-resizing any necessary layers below it: an optional LVM LV and PV, and an MBR or GPT partition table
Go
469
star
8

gitbrute

brute-force a git commit hash
Go
375
star
9

latlong

The latlong package maps from a latitude and longitude to a timezone.
Go
374
star
10

iter

Range over integers [0,n). Seriously, that's it.
Go
293
star
11

jndi

a irresponsibly bad logging library
Go
265
star
12

autocertdelegate

Get LetsEncrypt TLS certs for internal-only TLS servers via a delegated golang.org/x/crypto/acme/autocert server.
Go
243
star
13

runsit

THIS IS OLD. DO NOT USE THIS. Just use systemd these days.
Go
217
star
14

go-smtpd

SMTP server library for Go
Go
209
star
15

scanningcabinet

Document Management System (scanner -> appengine blobs)
Python
144
star
16

campher

Embed Perl in Go. This works, but was a joke for a presentation. Don't use.
Go
134
star
17

go-sql-test

test ALL the databases
Go
131
star
18

websomtep

[joke] combination SMTP / WebSocket server
Go
125
star
19

deadbeef

Gimmicky commit hash made using bradfitz/gitbrute
111
star
20

slice

The slice package sorts Go slices.
Go
111
star
21

snake

a #golang Snake game in webassembly running at http://snake.126.49.198.in-addr.arpa/
Go
96
star
22

webfist

WebFist implements WebFinger delegation for providers who don't support WebFinger natively.
Go
84
star
23

android-garage-opener

Android Garage Door Opener
Java
82
star
24

lesser

Go
79
star
25

rfbgo

Toy RFB (VNC) Server in Go (#golang)
Go
73
star
26

go-tool-cache

Go
59
star
27

inboxfewer

archive gmail threads when github or gerrit issues are closed
Go
56
star
28

art

Allotment Routing Table
Go
56
star
29

shipit

Software Release Tool
Perl
55
star
30

gitutil

Utilities for working with git and Gerrit
Go
49
star
31

contributing

(DEAD, SHUT DOWN) a repository of information on how to contribute to open source projects
Python
45
star
32

android-squeezer

Android SqueezeCenter / SqueezeBox remote control client.
Java
35
star
33

undent

unindent stuff
Go
35
star
34

h2slam

slam an HTTP/2 server a lot of concurrent load over a single TCP connection (for debugging something)
Go
28
star
35

zippy-android-talk

Code to accompany my Zippy Android talk at Google I/O 2010
Java
27
star
36

go-issue-mirror

[old] precursor to golang.org/x/build/maintner/godata
24
star
37

goman

Gearman Client for Go
Go
24
star
38

minimal-qemu-linux

experimenting with a minimal Linux kernel under qemu-system for testing
Go
20
star
39

litecmp

Go
19
star
40

ip2asn

parser for iptoasn.com data
Go
18
star
41

hubbub-hub

A PubSubHubbub hub implementation
Perl
18
star
42

sixmap

tool to visualize the SIX (Seattle Internet Exchange) route server coverage
Go
17
star
43

qopher

Gopher Queue
Go
17
star
44

gotsync

parallel tree sync
Go
15
star
45

qemu-guest-kragent

a minimal qemu-guest-agent in Go for gokrazy + Proxmox (qemu)
Go
15
star
46

powerview

Control Hunter Douglas PowerView shades & blinds
Go
14
star
47

grpc-go16-demo

Demonstrating using Go 1.6's http2 to do grpc
Protocol Buffer
14
star
48

go-get-proxy

http proxy for the "go get" subcommand
Go
13
star
49

gce

Go package for for Google Compute Engine (GCE)
Go
13
star
50

sonden

If Sonos is playing audio, turn on my Denon amps.
Go
12
star
51

go-runas

Wrapper around go's rpc pkg to drop root and run RPCs as another user
Go
12
star
52

talk-http2go

HTTP/2 Go Talk
Go
11
star
53

candysim

when will Candyland be over?
Go
11
star
54

morskoyboy

Bored on a bus with no Internet? Play ะœะพั€ัะบะพะน ะ‘ะพะน (Sea Battle), similar to Battleship.
Go
10
star
55

batt

build ALL the things
Go
7
star
56

set-consistenthash-perl

consistent hashing library for Perl
Perl
7
star
57

issue-tracker-behaviors

7
star
58

lingobingo

lingo bingo lightning talk
Go
7
star
59

brackup-gae-server

Brackup server for Google App Engine
Python
6
star
60

eight22er

[joke] Twitter Direct Message POP3 gateway
Go
6
star
61

remserial-mirror

git mirror of remserial
C
5
star
62

talk-2016-08-16-seattle-go-1.7

Go
5
star
63

aoc

advent of code helpers to reuse between tasks
Go
5
star
64

perl-denon-avr-4806

Perl code to control a Denon AVR-4806
4
star
65

unicode-checkutf8

Perl module Unicode::CheckUTF8
Perl
4
star
66

go-mod-archiver-test

Go
4
star
67

perl-net-openid

Perl Net::OpenID::* modules
4
star
68

issuemirror

Code for mirroring Github issues to local files, and reading them.
Go
4
star
69

issue735583

Demo for Chrome issue issue 735583
Go
3
star
70

talk-2014-04-gophercon

Gophercon 2014 Talk
Go
3
star
71

sys-syscall

Sys::Syscall -- access system calls that Perl doesn't normally provide access to
Perl
3
star
72

k9sms

K-9 SMS
3
star
73

barlogalights

little program I use to run the LED strips in my home bar
Go
3
star
74

talk-2012-08-23-square-go

Talk about Go at Square
JavaScript
2
star
75

fotobilder-spiegel

Mirror photos & galleries from FotoBilder / LiveJournal
Go
2
star
76

democgoalloc

Go
2
star
77

fw-test-agent

Go
1
star
78

go-test-bug-repro

Go
1
star
79

wintun-go

dev fork of golang.zx2c4.com/wintun
Go
1
star
80

talk-gluecon-2010

Slides & code samples from my Gluecon 2010 talk
Perl
1
star