Showing posts with label kabini. Show all posts
Showing posts with label kabini. Show all posts

Pi-hole with LXD - Installation and Setup

Pi-hole is wrapper of your DNS server that block all advertisements and trackers. We're using it at our home network to block all those unnecessary bandwidth wasting contents. Setting up for any of your devices is quite straightforward, just make sure your router point to it as DNS server.

While there is a Docker image existed, we have installed it within a LXD container since we have a LXD host exists in our small homelab server, Kabini (more on this in coming posts).

First we setup the container based on Ubuntu 18.04.
$ lxc launch ubuntu:18.04 pihole
$ lxc list -c=ns4Pt
+--------+---------+----------------------+----------+------------+
|  NAME  |  STATE  |         IPV4         | PROFILES |    TYPE    |
+--------+---------+----------------------+----------+------------+
| pihole | RUNNING | 10.53.105.102 (eth0) | default  | PERSISTENT |
+--------+---------+----------------------+----------+------------+

Looking at the table above, notice that container created based on the default profile, the IP we obtained is within the 10.x.x.x range. What we need to do is to change to create a new profile which will enable the container accessible to other in the LAN network. Hence, we need to switch from bridge to macvlan.

The `eth0` network adapter links to your host's network adapter, which can have different naming. For example, `enp1s0` (LAN). However, you can't bridge a Wifi interface to ethernet interface as Wifi by default, only accept a single MAC address from a client.
$ lxc profile copy default macvlan
$ lxc profile device set macvlan eth0 parent enp1s0
$ lxc profile device set macvlan eth0 nictype macvlan

Stop the `pihole` container so we can switch the profile to `macvlan`.
$ lxc stop pihole
$ lxc profile apply pihole macvlan
Profiles macvlan applied to pihole
$ lxc start pihole
$ lxc list
$ lxc list -c=ns4Pt
+--------+---------+----------------------+----------+------------+
|  NAME  |  STATE  |         IPV4         | PROFILES |    TYPE    |
+--------+---------+----------------------+----------+------------+
| pihole | RUNNING | 192.168.0.108 (eth0) | macvlan  | PERSISTENT |
+--------+---------+----------------------+----------+------------+

Next, enter the container and install Pi-hole.
$ lxc exec pihole bash
[email protected]:~# curl -sSL https://install.pi-hole.net | bash

This Week I Learned - 2016 Week 23

Last week write-up or you might want to read the whole series.

Calculate the power supply needed for your Power Supply Unit (PSU). It seems that my HP Proliant ML110 G6's PSU of 300 watt seems sufficient enough. Maybe the issue is with the power socket or adapter? Next step, install different operating system to test it out. Or maybe I should proceed on building a HTPC instead? But find the required parts is quite an frustrating process. I've never realize that quite a lot of product, for example, casing is not available in MY.

AMD Athlon 5350 Kabini Quad-Core 2.05 GHz is my favourite CPU processor (or APU to be exact) right now besides the XEON X-series. This is a very unique processor that sits between 5150 and 5370 but that supports virtualization extension (AMD-V). Hence, this processor is suitable for building your own homelab which fully utilizes the quad-cores for virtualization. Furthermore, the power consumption is 25 Watt TDP. However, the motherboard choices for AM1l is quite limited but so far only Asus AM1l-A seems to support ECC Ram or not?

One good example of using this processor is building a pfSense firewall. Why one want to build and setup a homelab? Well, if you want to be a full stack engineer or just having some fun building a machine.

As it's very hard to find a single 5350 in MY. The next best option to go for A4 5000, which have similar features to Athlon 5350 but lower clock speed. The only available APU option right now here is BioStar A68N 5000. While having higher TDP, it's still a preferable choice when compare to Celeron J1800 or J1900 for its AES encryption support and less painful VMWare's ESXi installation.

How to teach yourself programming. Learning a new programming language is never hard, you just have to use it on daily basis and experienced the whole eco-system.

Something more about Perl. The official Perl's Docker image is up (via Reddit). So right now, we can have an isolated Perl environment for customization and development. So many things I want to try out, for examples, Moo (Minimalist Object Orientation), DNSMadeEasy Webservices API, and try to figure out how to define and use constant properly in Perl.

While we're on Docker, it seems the default Docker installation in my Ubuntu 16.04 cannot be executed by non-root user. To enable this,
$ sudo groupadd docker
$ sudo gpasswd -a ${USER} docker
$ sudo systemctl restart docker
$ sudo systemctl status docker
$ newgrp docker # no need to logout and login again
$ docker version

Chromiun OS for Single Board Computers (SOCs). Is time to use back the shelved Raspberry Pi 2.