Upload PiHole HA Scripts and Configurations
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# Place under /etc/dnsmasq.d/99-dns-vip.conf
|
||||
# This will propagate the DNS VIP of keepalived as DNS Server over DHCP
|
||||
dhcp-option=option:dns-server,192.168.1.4
|
||||
@@ -0,0 +1,37 @@
|
||||
# Place under /etc/keepalived/keepalived.conf on BACKUP pihole
|
||||
global_defs {
|
||||
router_id pihole-dns-02
|
||||
script_user root
|
||||
enable_script_security
|
||||
}
|
||||
|
||||
vrrp_script chk_ftl {
|
||||
script "/etc/scripts/chk_ftl"
|
||||
interval 1
|
||||
weight -10
|
||||
}
|
||||
|
||||
vrrp_instance PIHOLE {
|
||||
state BACKUP
|
||||
interface eth0
|
||||
virtual_router_id 55
|
||||
priority 145
|
||||
advert_int 1
|
||||
unicast_src_ip 192.168.1.3
|
||||
unicast_peer {
|
||||
192.168.1.2
|
||||
}
|
||||
|
||||
authentication {
|
||||
auth_type PASS
|
||||
auth_pass secret
|
||||
}
|
||||
|
||||
virtual_ipaddress {
|
||||
192.168.1.4/24
|
||||
}
|
||||
|
||||
track_script {
|
||||
chk_ftl
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
# Place under /etc/keepalived/keepalived.conf on MASTER pihole
|
||||
global_defs {
|
||||
router_id pihole-dns-01
|
||||
script_user root
|
||||
enable_script_security
|
||||
}
|
||||
|
||||
vrrp_script chk_ftl {
|
||||
script "/usr/local/scripts/chk_ftl"
|
||||
interval 1
|
||||
weight -10
|
||||
}
|
||||
|
||||
vrrp_instance PIHOLE {
|
||||
state MASTER
|
||||
interface eth0
|
||||
virtual_router_id 55
|
||||
priority 150
|
||||
advert_int 1
|
||||
unicast_src_ip 192.168.2.2
|
||||
unicast_peer {
|
||||
192.168.2.3
|
||||
}
|
||||
|
||||
authentication {
|
||||
auth_type PASS
|
||||
auth_pass secret
|
||||
}
|
||||
|
||||
virtual_ipaddress {
|
||||
192.168.2.4/24
|
||||
}
|
||||
|
||||
track_script {
|
||||
chk_ftl
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Place under /etc/scripts for FTL Status check of keepalived
|
||||
|
||||
STATUS=$(ps ax | grep -v grep | grep pihole-FTL)
|
||||
|
||||
if [ "$STATUS" != "" ]
|
||||
then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user