Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
virtualisation:pihole_lxc_container [2022/05/23 10:35]
cakir [Install Pi-hole manually]
virtualisation:pihole_lxc_container [2022/05/24 09:28] (current)
cakir [Setup a Pi-hole in LXC container]
Line 1: Line 1:
-====== ​Setup a Pi-hole in LXC container ====== ​+====== Pi-hole in LXC container ====== ​
  
                                                                                                                                                                
Line 26: Line 26:
  
  
-===== Setup virtualization =====                      ​+===== Setup LXC Pi-hole ​virtualization =====                      ​
                                                                                                     ​                                                                                                     ​
 Before we can start please check if virtualization feature is licensed on your system (see SYSTEM -> Licensing on WebGUI). Before we can start please check if virtualization feature is licensed on your system (see SYSTEM -> Licensing on WebGUI).
Line 48: Line 48:
  
  
-===== Setup router =====+===== Setup router ​DHCP/​DNS ​=====
                                                                                                                                            
 We are now back at the router Web-GUI to do the final setup of the DHCP server and DNS settings. ​                           We are now back at the router Web-GUI to do the final setup of the DHCP server and DNS settings. ​                          
                                                                                                     ​                                                                                                     ​
-**Step 1:** Navigate to SERVICES → DHCP Server and click the Edit button. Pick the specify radio button which will make some additional input windows pop up. Here you have to put the address you want the pi-hole to server to have in the Primary DNS field. Note that the address will have to be within the range of the DHCP server settings, for example 192.168.1.111,​ then click Apply. ​+**Step 1:** Navigate to SERVICES → DHCP Server and click the ''​Edit'' ​button. Pick the specify radio button which will make some additional input windows pop up. Here you have to put the address you want the pi-hole to server to have in the Primary DNS field. Note that the address will have to be within the range of the DHCP server settings, for example ​''​192.168.1.111''​, then click Apply. ​
  
 {{:​virtualisation:​01-pihole-dhcp.png}} {{:​virtualisation:​01-pihole-dhcp.png}}
                                                                                                     ​                                                                                                     ​
-**Step 2:** Click the Edit button one more time so we can setup the pi-hole as static host. Once again we click the small plus icon and set IP address to the one you picked earlier (192.168.1.111 in my case) and MAC address to 00:​ff:​aa:​00:​44:​00 (this is the AMC address of eth0 in the virtualization).+**Step 2:** Click the Edit button one more time so we can setup the pi-hole as static host. Once again we click the small plus icon and set IP address to the one you picked earlier (''​192.168.1.111'' ​in my case) and MAC address to ''​00:​ff:​aa:​00:​44:​00'' ​(this is the MAC address of eth0 inside ​the LXC virtualization).
  
 {{:​virtualisation:​02-pihole-static-host.png}} {{:​virtualisation:​02-pihole-static-host.png}}
                                                                                                     ​                                                                                                     ​
-**Step 3:** To finalize the setup do a reboot of the router. You can do this by navigating to SYSTEM → Reboot and the hit the Reboot Now button or alternatively just run the reboot command in terminal.+**Step 3:** To finalize the setup do a reboot of the router. You can do this by navigating to SYSTEM → Reboot and the hit the ''​Reboot Now'' ​button or alternatively just run the ''​reboot'' ​command in terminal.
  
 {{:​virtualisation:​03-pihole-reboot.png}} {{:​virtualisation:​03-pihole-reboot.png}}
                                                                                                     ​                                                                                                     ​
-**Step 4:** To verify that everything is working correctly open then pi-hole web interface by visiting http://​192.168.1.111/​admin/​ with your browser. The default admin password after installation is "​admin01"​. **We strongly recommend to change the password after verifying sucessfull installation.** (see next step)+**Step 4:** To verify that everything is working correctly open then pi-hole web interface ​login page by visiting ​''​http://​192.168.1.111/​admin/​index.php?​login'' ​with your browser. The default admin password after installation is "​admin01"​. **We strongly recommend to change the password after verifying sucessfull installation.** (see next step)
  
 {{:​virtualisation:​04-pihole-gui.png}} {{:​virtualisation:​04-pihole-gui.png}}
  
-**Step 5:** To change the password we need to access the router ​via terminal. Log in via ssh, telnet or serial connection and then run the command "''​lxc-attach guest0''""​ then run the command ​for changing the password ​"''​pihole -a -p''"​. ​+**Step 5:** To change the password we need to access the router ​with command line interface. Log in via ssh, telnet or serial connection and then run the command "''​lxc-attach guest0''"" ​to enter the shell in LXC, then run the command "''​pihole -a -p''" ​for changing the password
  
-**The installation is finished and Pi-hole is now in working condition.** You can access the webgui (192.168.1.111) any time and view the dashboard or login to adjust settings.+{{:​virtualisation:​05-pihole-gui.png}}
  
 +**The installation is finished and Pi-hole is now in working condition.** You can access the webgui on ''​192.168.1.111''​ any time and view the dashboard or login to adjust settings.
  
  
  
  
-===== Get latest debian image (only necessary for manual install) ===== 
  
- 
-To get the latest debian armhf rootfs file please visit https://​uk.lxd.images.canonical.com/​images/​debian/​stretch/​armhf/​default/​. Choose the most recent date and then right click the rootfs.tar.xz file (should be around 56MB size) and pick "copy link". On the router we navigate to the Install tab and paste the link, also check the Install on "​Apply"​ checkbox then hit the Apply button. This should take around 2 minutes. keep in mind that the other steps of the regular guide are still necessary. 
- 
-{{:​virtualisation:​03-1-pihole-debian.png}} 
-{{:​virtualisation:​03-2-pihole-debian.png}} 
-{{:​virtualisation:​03-3-pihole-debian.png}} 
  
                                                                                                     ​                                                                                                     ​