changed acl-list from babel to routing tables

This commit is contained in:
Blackyfff 2021-01-26 22:53:02 +01:00
parent 11c105e6f0
commit 16bc1203f8
2 changed files with 15 additions and 8 deletions

View File

@ -15,6 +15,7 @@ export DNSSCRIPT_SERVER_NAME=dns.herpf.fff.community
UpdateScriptsFolder="/usr/lib/ffdns/" UpdateScriptsFolder="/usr/lib/ffdns/"
ZoneFilesFolder="/etc/bind/fff/" ZoneFilesFolder="/etc/bind/fff/"
BindIncludeFileFolder="/etc/bind/" BindIncludeFileFolder="/etc/bind/"
RoutingTables="10"
# -1 -> disable bind [restart|reload] # -1 -> disable bind [restart|reload]
# 0 -> Debian (and like) systemctl [reload|restart] bind9 # 0 -> Debian (and like) systemctl [reload|restart] bind9
@ -117,7 +118,7 @@ for Hood in $Hoods; do
./update-extzone.sh "$HoodZoneFile" "$ExternFile" "$HoodDomain" "$ExternalView" ./update-extzone.sh "$HoodZoneFile" "$ExternFile" "$HoodDomain" "$ExternalView"
done done
./update-public-acl.sh "$BindIcvpnAclTmp" "$RemoteLocation" ./update-public-acl.sh "$BindIcvpnAclTmp" "$RemoteLocation" "$RoutingTables"
ReConfigBind=1 ReConfigBind=1
UpdateBindConfig() { UpdateBindConfig() {

View File

@ -4,17 +4,23 @@
IncludeFile="$1" IncludeFile="$1"
RemoteLocation="$2" RemoteLocation="$2"
Tables="$3"
rm -f "$IncludeFile" rm -f "$IncludeFile"
InstalledRoutes="$(echo "dump" | nc ::1 33123 | \ Installed4Routes=""
sed -e '/\(add route .* installed yes\|add xroute\)/!d')" Installed6Routes=""
PublicSubs="$(echo "$InstalledRoutes" | \ for Table in $Tables; do
sed -e '/\( from ::\/0\| from 0\.0\.0\.0\/0\)/d;s/.* from \(\S\+\).*/\t\1;/g')" Installed4Routes="$(echo "$Installed4Routes" && ip -4 ro sh ta "$Table")"
Installed6Routes="$(echo "$Installed6Routes" && ip -6 ro sh ta "$Table")"
done
PublicSubs="$(echo "$Installed6Routes" | \
sed -e '/^default from/!d;s/.* from \(\S\+\).*/\t\1;/g')"
PrivatePrefix="\(192\.168\.\|172\.\(1[6-9]\|2[0-9]\|3[01]\)\.\|10\.\|[fF][cCdD][0-9a-fA-F]\{2\}:\)" PrivatePrefix="\(192\.168\.\|172\.\(1[6-9]\|2[0-9]\|3[01]\)\.\|10\.\|[fF][cCdD][0-9a-fA-F]\{2\}:\)"
PublicSingles="$(echo "$InstalledRoutes" | \ PublicSingles="$(echo "$Installed4Routes" | \
sed -e '/\( from ::\/0\| from 0\.0\.0\.0\/0\)/!d;s/.* prefix \(\S\+\) .*/\1/g;'" \ sed -e 's/^\(\S\+\)\s.*/\t\1;/g;/^\t'"$PrivatePrefix"'\|^\t\(default\|0\.\)\|^$/d' \
"'/^'"$PrivatePrefix"'/d;/^\(0\.\|::\|64:ff9b::\)/d;s/^/\t/g;s/$/;/g')" && echo "$Installed6Routes" | \
sed -e 's/^\(\S\+\)\s.*/\t\1;/g;/^\t'"$PrivatePrefix"'\|^\t\(default\|::\|64:ff9b::\)\|^$/d')"
{ {
echo "acl icvpnrange {" echo "acl icvpnrange {"