OrangePi SBC, Armbian, Pihole – quick and dirty
Preamble (just skip it or click and read it, whatever)
A quick way to get yourself your LAN – well not ad-free but way ad-less.
This blog post will be some weird mix between this existing post here, updates for it and less verbiage.
Just a side note: Browser-based ad blocking is way more efficient rather than filtering using DNS filter lists. The reason for this is that those in-browsing scripts can adjust the appearance of a website directly while DNS based blocking simply does not allow content from specific domains to be loaded. Depending on the used browser the result may vary.
So why wasting time and money to set something up like this? Three reasons:
- Especially on mobile devices you cannot simply install ad filtering software without enhanced access to your device (like ‘rooting’). Yes, there are apps like Block This! but maybe you need your VPN capabilities elsewhere
- Other apps do not depend on browsers and sideload their ads other way, like the YouTube app on Android or any ad-funded app. If you cannot attack the enemy from within you have to surround him.
- You have lots of devices and/or share your LAN/WiFi with others and want to serve your legacy of ad-free browsing with just being connected to the network
To be clear: This tutorial is way not bulletproof nor it is dedicated to total newbies and there will probably be tons of room for improvements. Some basic knowledge about Linux, especially Debian and networking is highly recommended. Though if you have questions do not hesitate to get in touch with me on Twitter. I may do a kind of bulletproof tutorial from scratch if someone sponsors me a new OrangePi One SBC or any other more expensive board :-P.
This is the hardware you need:
- An OrangePi One
- A 5V 2A DC power source
- A microUSB cable
- A microSD card with at least 8GB space. The faster/higher the quality the better.
- A microSD card reading/writing device for your PC
- A common patch cable
- A UART USB-TTL adapter like this (optional, only for troubleshooting)
- A HDMI monitor (optional, only for troubleshooting)
SD card preparation
Get a tool to write sd card images to sd cards like Etcher. The portable version will do it perfectly fine.
Grab the latest Armbian Debian-based image for OrangePi One and write it to the SD card. Etcher is pretty self explaining. Start the tool, insert SD, select it, select the unpacked image and go. Linux users should know how to write an image to a SD card by themselves.
Wiring it up and boot
Insert the SD card. Connect ethernet and power last. Then wait.
The first boot will take a while as the filesystem will expand itself across the whole SD card. Depending on its size this may take a while. So help yourself to a cup of tea. As there is no visible indicator like a flashing LED when the boot process is finished you may connect either your serial connector or HDMI monitor to get console output if you are interested. If not just give the system up to 15 minutes to do the first boot.
Armbian will try to acquire IP addresses from a DHCP server. So for this scenario you need a DHCP server in your local network. This is most likely the case if you have something like cable- or DSL-router.
Go for your DHCPs (to say router) interface and check the connected devices in your LAN to find out which IP has been allocated to your board.
Connect through SSH with the user root and password 1234.
To get a good base to start with I recommend updating the whole system by running
apt update && apt upgrade.
Then we have to give your board static IP addresses. You can skip this, but then be prepared to being blamed for doing so by Pi-Hole installer. Edit your /etc/network/interfaces file to something like this:
iface eth0 inet static
iface eth0 inet6 static
When done restart networking (or the entire board if you did a kernel update before) and check ifconfig if everything is set up correctly.
The installation of Pihole is pretty simple as their installer script does most of the work for you. Simply run this command:
curl -sSL https://install.pi-hole.net | bash as root.
After a while you should be greeted with the link to your web interface as well as the admin password.
The rest like adding more or custom filter lists is up to you.
Use it in your LAN
Go as me questions below here:
— Ben Zucker 🍰 (@DieZuckerbude) December 31, 2018