Commit cf150e8c authored by Deac Karns's avatar Deac Karns

initial commit

parents
*.log
.vagrant/
\ No newline at end of file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network "public_network"
config.vbguest.auto_update = false
config.vm.provision "file", source: "./setupVars.conf", destination: "/home/vagrant/setupVars.conf"
class Renew
def to_s
print "\n\nDo you want to renew your DHCP settings (y/n): "
STDIN.gets.chomp
end
end
config.vm.provision "shell", env: {"IPADDRESS" => Renew.new}, inline: <<-SHELL
if [ $IPADDRESS == "y" ]; then
echo "Fetching new DHCP"
rm /var/lib/dhcp/dhclient*
systemctl restart networking
fi
SHELL
class Install
def to_s
print "\n\nDo you want to Install and configure pihole with the current network settings(y/n): "
STDIN.gets.chomp
end
end
# need to get the ip address of the box and write it to the setupVars.conf file before install happens
config.vm.provision "shell", env: {"INSTALL" => Install.new}, inline: <<-SHELL
if [ $INSTALL == "y" ]; then
mkdir -p /etc/pihole
IP=`/sbin/ifconfig enp0s8 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}'`
sed -i "/IPV4_ADDRESS=/c\IPV4_ADDRESS=$IP" /home/vagrant/setupVars.conf
cp /home/vagrant/setupVars.conf /etc/pihole/setupVars.conf
curl -sSL https://install.pi-hole.net | bash /dev/stdin --unattended
pihole -a -p secret
fi
SHELL
config.vm.provision "shell", run: "always", inline: <<-SHELL
echo -n "\n\n\npihole can be reached at the following ip:\n"
/sbin/ifconfig enp0s8 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}'
SHELL
end
\ No newline at end of file
# Vagrant PiHole
Clone this repository
Navigate to the cloned directory
```
cd pihole-local
```
Start the vagrant box
```
vagrant up
```
## Network configuration
You will be prompted by vagrant and asked what network interface you would like to bridge
your connection to. This is important because the vagrant box needs to get an ip address from
your connected network.
>Select the network interface that connects to your local network that is serving DHCP
## Switching Networks
Lets face it, you use more than one network if you use a laptop. In order to get the pihole
box to be on the same network as your laptop you will need to reconfigure the application each
time you switch networks.
This can be cumbersome and repetitive so it has been abstracted into a provisioning step. At any point,
you can re-provision the box to set up pihole and the vagrant box with the appropriate network settings.
```
vagrant provision
```
## Begin Using PiHole
Before you can take advantage of the pihole vagrant box you will need to tell your computer to use it as your DNS server.
macOs:
Open `System Preferences` -> `Network`
click the `Advanced` button
add the ip address to the DNS section
\ No newline at end of file
DNSMASQ_LISTENING=single
DNS_FQDN_REQUIRED=true
DNS_BOGUS_PRIV=true
DNSSEC=true
TEMPERATUREUNIT=C
WEBUIBOXEDLAYOUT=traditional
API_EXCLUDE_DOMAINS=
API_EXCLUDE_CLIENTS=
API_QUERY_LOG_SHOW=all
BLOCKING_ENABLED=true
PIHOLE_INTERFACE=enp0s8
PIHOLE_DNS_1=8.8.8.8
PIHOLE_DNS_2=8.8.4.4
QUERY_LOGGING=true
INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true
LIGHTTPD_ENABLED=true
IPV4_ADDRESS=
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment