Raspberry Pi Ubuntu Server

Ever since the launch of the Raspberry Pi I’ve been a fan. I’ve bought and been gifted many of them over time. It reminds me a little of the NSLU2 (slug), but builds on the amazing hardware advancements driven by smartphones.

I recently bought my first RPi4 – the base model 2Gb version. BuyAPi.ca is local, but I had it shipped. Great prices, and my order was prepped and shipped within 3hrs of submitting it. Even via regular mail, it showed up quickly (days).

What I bought:

I have plenty of micro-sd cards around so there was no need to get another.

The Pi ships in a very cute little box.

The first thing I did was to install the heatsinks. I had to visit the web page to figure out where to put them on the board. Peeling the plastic off the adhesive tape was a little tricky, but a sharp knife blade helped me get under the edge.

There are several choices for the OS to run, and for many of my previous projects I’ve stuck with Raspbian (now known as the Raspberry Pi OS). Since my intended use for this Pi is to run it as a server hosting Pi-hole, I opted to go with Ubuntu server.

Downloading and flashing the image file to the sd-card was straight forward. I connected the Rpi4 to wired ethernet and power, and booted right after the card was flashed. By visiting my main router I could see the DHCP address that the Pi had been given.

By default – the device shows up as hostname ‘ubuntu’ and the default user is ‘ubuntu’. You can ssh directly to the machine, and on first login you are forced to change the password. The password policy requires non-trivial passwords, so it’s not a bad solution to getting going.

At this point I no longer need to access the device physically (or at least very often). I drilled some holes in a bit of wood to accept the brass stand-offs, then mounted the Pi to the stand offs. This let me mount the whole thing to the wall along side my other infrastructure bits (router, modem, voip box, switch).

Based on my server configuration post – I want the new Rpi4 server to be similarly set up.

Stuff I want to do:

  1. Change the username
  2. Change the hostname
  3. Configure automatic updates
  4. Forward email
  5. Fix timezone
  6. Redirect logs
  7. Install Prometheus monitoring

The rest of this post is the details on those steps.

Continue reading “Raspberry Pi Ubuntu Server”

Docker and macvlan networking (IPv4)

Docker is the well known spin on Linux containers (LXC), if you’re not already playing with containers it’s probably time to jump in and get familiar. I’ve been (very slowly) migrating my personal infrastructure over to a container centric setup.

For me, containers are really nice for managing the set of software dependencies needed to run any particular application. It allows me to keep my RSS feed reader up to date, and avoids me breaking something my WordPress install needs or vice versa. Containers are a light weight virtualization.

The default networking model (default bridge) allows you to easily expose (map) a set of ports from the container, onto the host. This makes it easy to host an nginx container as your webserver on port 80.

Docker does some interesting network tricks to keep things more secure, but this gets problematic too. Containers can’t easily see the host they are on, making it difficult for container A to see container B’s port on the host – however, you can put both containers on the same docker network to allow them to see each other. This is a subject for another blog post entirely.

The macvlan support in docker is very cool. It allows you to provision a second IP address on the same network card, giving your docker container a full IP on the local network. In the world of virtual machines, similar macvlan support is available, and when you want to treat a docker container like a mini-VM, this is very useful.

Continue reading “Docker and macvlan networking (IPv4)”

Moar Speed: Faster Internet

When we upgraded to cable internet, we had 30/5 service. At the time this was a nice upgrade from the fastest DSL we could get at our house.

In general, that was plenty. There were of course occasions when Netflix would load slowly, but this was almost always something you could attribute to the internet being poor as a whole vs. the lack of speed. Even web conferences with video were pretty good.

During COVID19 lockdown and many more people working from home, we’ve managed so far with 30/5 – but there have been some issues. Pulling bits down was always pretty ok, but pushing them up was sometimes a challenge. The different web meeting software is quite different in how it handles poor connections. Zoom is one of the better ones, Jitsi tends to really eat up the bits and WebEx is somewhere in the middle.

Teksavvy offers a no-cost upgrade (or downgrade) path for your cable plan. It was a very simple to switch my service speed via the self service portal, which created a change request ticket. They said 48hrs, but the work was done very quickly (within the hour).

I’m getting pretty solid speed tests. My old go-to dslreports has been pretty cranky lately, giving me plenty of time out errors when trying to test. I have started to look at fast.com as an alternative. Still dslreports is one of the few that gives you a bufferbloat rating, something that is important if you want VOIP or any sort of interactive activity to go smoothly.

If you haven’t read up about bufferbloat, it’s worth learning a little about. The short story is that you want to make sure that your home networking equipment (router, etc) has some form of QoS to help make sure that not only are you getting ‘fast’ internet, but responsive internet. It will make all the difference, at any speed. There are certainly people out there with 150Mbps internet who have terrible lag, that’s not a happy place and it’s something you can fix with a little bit of learning – and the right hardware.

In any case – the ~$10 price increase has doubled performance of our internet connection (75/10 plan). This still means we are lagging behind the average, but it’s pretty good. Before I go chasing more ISP speed, I’ll be looking more closely at network / wifi infrastructure I have set up.