Testing Pi-Hole using a VM (Part II)

Part 2

In the last post, I demonstrated the setup of Virtual Box to get a test environment ready for a Pi-Hole service running on a CentOS 7 VM.  I discussed Pi-Hole in an earlier post, and a few scenarios that might make it an interesting configuration to use if you intend to block ads for your home or small business network.  The larger your network, the more likely you would be to want to run this on a dedicated piece of hardware like a PFSense Firewall, but even for small networks this software can be run off a $35 Raspberry Pi making it a very interesting project for a networking hobbyist or security enthusiast.  Hopefully with my guide, even an entry level enthusiast can follow along and get some positive results on their own.  Be sure to let me know in the comments if you try this out and what sort of experience you had!

Installing Cent OS 7

CentOS 7
Cent OS 7 has a minimal distribution which we will be using for this demonstration.  I'll be running the 64-bit version of the 18.04 release, which is the current release at the time of this writing.  Even if you are running a newer release, most of the steps are going to be the same as this is a very straightforward install and configuration, perfect for a beginner networking project with lots of options if you wish to dive deeper as you learn more.

In the last post, we prepared the VM and mounted the ISO, so now we just need to boot the VM for the first time.  Click start and you should be greeted with a text menu asking you to test the media or install Cent OS.  Click in the window to move the highlight up and down and press Enter select Install Cent OS 7.  You may lose control of your mouse pointer, but don't panic.  You can always get your mouse control back by pressing the Right Control button by default.  You can return control to the VM again by clicking in the window.

The OS will load into the installer, which gives you a graphical interface with mouse control.  The first question you will need to answer is your language selection. This is up to you, but I chose English with a U.S. Keyboard layout.  If you are in another country, this will be different,so just choose what makes sense for your location and click Continue.


Now you will see the installation summary, which allows you to customize your install.  Here you can optionally set your Time Zone, Keyboard Layout, Language, as well as your software source and software selection.  Since we are booting off a minimal distribution, we can only choose minimal, but this would give us a lot more options if we were to use the standard or "Everything" distribution.  We only really care about two things for this test however, the destination and the networking.  Click on the Installation Destination first.


Here we should automatically get a default disk configuration set up for us, which we will accept.  This screen allows us to customize our own partitions or enable disk level encryption, but the default simply uses all available space and is perfectly fine for most cases.  Click Done at the top left to continue and return to the Installation Summary.


Now select Network and Hostname to give your VM an identity on your network. Remember, in the last post we configured the network adapter as a bridged interface, so it will share the primary interface your host computer is using and appear on the very same network with its own unique MAC address and IP address.  This step requires a little bit of networking knowledge, since every home router is going to present a slightly different network to the hosts.  My network in this example is on the 192.168.1.0/24 network.  The slash-24 refers to the subnet mask, meaning all computers that wish to communicate on this network are going to have the same first three numbers, and only the last number will be unique. This is also called a Type-C subnet (sometimes expressed as 255.255.255.0) and is the most common configuration you will see in a home.  My router is the Internet gateway and DNS server as well, and it resides at 192.168.1.1.  My DHCP Scope goes from 100-240, so any device on my network will automatically get assigned an IP address between those two values.  Any number between 1 and 254 is going to be valid on the network however, so we an use anything from 2-99 as a static IP address without running the risk of duplicating someone else's IP address. Remember, they all have to be unique.  Given this information, I'm going to use 192.168.1.99 as the address of my Pi-Hole test server, since I know nothing is using 99 right now, and nothing is ever going to be accidentally assigned that address by the DHCP Server running on the Router.*  You will need to take a look at your own IP address and settings to determine the values for your specific network.


*To be clear, I keep referring to the Router, but I'm using it in a colloquial sense as this is how most people refer to that all-in-one device that connects to your broadband modem in a typical home network.  The Router in this case does route traffic, but also provides a DNS service, DHCP service, Network Address Translation (NAT), maybe a firewall, and this can be confusing to a beginner who only sees one device.  In a larger network this functionality is separated across many physical devices though, so the use of a Router in a larger network is specifically to route traffic, not to do all this other stuff.


Now, after you give the machine a hostname, (I chose pihole.local, but you can call it whatever you like) click Done you can return to the installation summary page.  We are done configuring the settings, so now click Begin Installation and the OS will be installed in the background.  While we wait, we get the option to add users and set a root password.  Do the root password and feel free to skip the user creation for now as this is just a test machine.  Users can be added later if desired to limit the rights of logon accounts, which is a best practice for any production system in a home or business.  Just keep that in mind, since anyone logging in with root will have full, unlimited access to the system. Once the install is complete, click reboot and you are done installing Cent OS 7.


After the system reboots, you will have a login prompt. Login with root and type the password you set during install.  Type ping google.com and make sure you get a response. This verifies the internet connection is working.  Press control-C to stop the ping.  Type ip addr and verify your IP address is accurate.  Type hostname to get your systems fully qualified domain name (FQDN).  Type exit and you will be returned to your login prompt.

Comments

Popular posts from this blog

How to Test Pi-Hole on a VM (Part I)

Testing Pi-Hole on a VM (Part III - Conclusion)