diff --git a/contrib/keepalived-2.conf b/contrib/keepalived-2.conf new file mode 100644 index 0000000..456dcc8 --- /dev/null +++ b/contrib/keepalived-2.conf @@ -0,0 +1,24 @@ +! Configuration File for keepalived + +global_defs { + notification_email { + acassen@firewall.loc + failover@firewall.loc + sysadmin@firewall.loc + } +} + +vrrp_instance VI_1 { + state BACKUP + interface enp6s18 + virtual_router_id 51 + priority 50 + advert_int 1 + authentication { + auth_type PASS + auth_pass 1111 + } + virtual_ipaddress { + 192.168.10.1 + } +} diff --git a/contrib/keepalived.conf b/contrib/keepalived.conf new file mode 100644 index 0000000..d808931 --- /dev/null +++ b/contrib/keepalived.conf @@ -0,0 +1,35 @@ +! Configuration File for keepalived +! Firewall: +! firewall-cmd --add-rich-rule='rule protocol value="vrrp" accept' --permanent + +global_defs { + notification_email { + acassen@firewall.loc + failover@firewall.loc + sysadmin@firewall.loc + } +} + +vrrp_script chk_dns { + script "/usr/bin/nc -z -u 127.0.0.1 53" + interval 5 + weight -60 +} + +vrrp_instance VI_1 { + state MASTER + interface enp6s18 + virtual_router_id 51 + priority 100 + advert_int 1 + authentication { + auth_type PASS + auth_pass 1111 + } + virtual_ipaddress { + 192.168.10.1 + } + track_script { + chk_dns + } +} diff --git a/contrib/technitium_add b/contrib/technitium_add new file mode 100755 index 0000000..7c60d97 --- /dev/null +++ b/contrib/technitium_add @@ -0,0 +1,24 @@ +#!/bin/bash + +API_KEY= +URL=https://phantom1.lan:53443 + +#while IFS=, read -r domain ipaddr; do +# echo -n $ipaddr +# curl --insecure --silent --header "Authorization: Bearer $API_KEY" "$URL/api/zones/records/add?domain=$domain&type=A&ipAddress=$ipaddr&ptr=true" +# echo +#done < ~/bin/dns_hosts.csv + +while IFS=, read -r domain cname; do + echo -n $domain + curl --insecure --silent --header "Authorization: Bearer $API_KEY" "$URL/api/zones/records/add?domain=$domain&type=CNAME&cname=$cname" + echo +done < ~/bin/dns_alias.csv + + +# "https://phantom1.lan:53443/api/zones/records/add?domain=api.phantom1.lan&type=CNAME&cname=backend.phantom1.lan&ttl=300&overwrite=true" | jq + + +# curl --insecure --silent --header "Authorization: Bearer $API_KEY" "$URL/api/zones/records/add?domain=$domain&type=A&ipAddress=$ipaddr&ptr=true" +echo + # &ttl=300&overwrite=true" diff --git a/contrib/technitium_backup b/contrib/technitium_backup new file mode 100755 index 0000000..b6125d4 --- /dev/null +++ b/contrib/technitium_backup @@ -0,0 +1,9 @@ +#!/bin/bash + +API_KEY= +URL1=https://phantom1.lan:53443 +URL2=https://phantom2.lan:53443 + +curl --insecure --header "Authorization: Bearer $API_KEY" "$URL1/api/settings/backup?scopes=true&stats=true&zones=true&allowedZones=true&blockedZones=true&dnsSettings=true&logSettings=true&authConfig=true" -o technitium_1_backup.zip +curl --insecure --header "Authorization: Bearer $API_KEY" "$URL2/api/settings/backup?scopes=true&stats=true&zones=true&allowedZones=true&blockedZones=true&dnsSettings=true&logSettings=true&authConfig=true" -o technitium_2_backup.zip + diff --git a/contrib/technitium_mac b/contrib/technitium_mac new file mode 100755 index 0000000..c10916f --- /dev/null +++ b/contrib/technitium_mac @@ -0,0 +1,12 @@ +#!/bin/bash + +API_KEY= +URL=https://phantom1.lan:53443 + +awk '{print $2,$6,$8}' dhcp.static | tr -d \; | grep '192.168.2\.' | while read -r domain mac ipaddr; do + echo -n "$domain|$mac|$ipaddr" + curl --insecure --silent --header "Authorization: Bearer $API_KEY" "$URL/api/dhcp/scopes/addReservedLease?name=dhcp2&hardwareAddress=$mac&ipAddress=$ipaddr&hostName=$domain" + echo +done + +