usage: netcalc split [-h] NETWORK LENGTH [MAXLENGTH]
netcalc split: error: argument LENGTH: invalid int value: '172.31.16.0/21'
This commit is contained in:
parent
ee80d07fb6
commit
f094a6e4cc
@ -10,3 +10,5 @@
|
||||
|
||||
${tld:-lixo} CNAME rpz-passthru.
|
||||
*.${tld:-lixo} CNAME rpz-passthru.
|
||||
{{ range "$root_reverse_zones" | split "," }}*.{{ . }} CNAME rpz-passthru.
|
||||
{{ end }}
|
||||
|
@ -59,6 +59,14 @@ view "lixonet" {
|
||||
forward only;
|
||||
forwarders { ${bind_forward_address-"${internal_gateway}"}; };
|
||||
};
|
||||
|
||||
# Local reverse zone forwarders
|
||||
{{ if len "${local_reverse_zones:-}" }}{{ range "$local_reverse_zones" | split "," }}zone "{{ . }}" {
|
||||
type forward;
|
||||
forward only;
|
||||
forwarders { ${bind_forward_address-"${internal_gateway}"}; };
|
||||
};
|
||||
{{ end }}{{ end }}
|
||||
|
||||
# Peer forwarding zones
|
||||
{{ range files "bind/peers" }} {{ if ne . "${tinc_peer_name}" }}
|
||||
@ -69,10 +77,10 @@ view "lixonet" {
|
||||
};{{ end }}{{ end }}
|
||||
|
||||
# Custom mesh zones
|
||||
{{ range files "bind/zones" }}
|
||||
zone "{{ . | replace "_" "." }}" {
|
||||
{{ range files "bind/zones" }}zone "{{ . | replace "_" "." }}" {
|
||||
{{ include (print "bind/zones/" .) }}
|
||||
};{{ end }}
|
||||
};
|
||||
{{ end }}
|
||||
};
|
||||
|
||||
view "default" {
|
||||
|
10
build.sh
10
build.sh
@ -7,6 +7,8 @@ process_template ( ) {
|
||||
rm $1
|
||||
}
|
||||
|
||||
function join_by { local IFS="$1"; shift; echo "$*"; }
|
||||
|
||||
process_templates ( ) {
|
||||
for template_filename in `find $1 -type f -name '*.tmpl'`
|
||||
do
|
||||
@ -18,8 +20,6 @@ topdir=`pwd`
|
||||
|
||||
for dir in `find /etc/lixonet/* -type d -maxdepth 0`
|
||||
do
|
||||
echo "Inspecting $dir..."
|
||||
|
||||
dir=${dir%*/} # remove the trailing "/"
|
||||
netname=${dir##*/} # print everything after the final "/"
|
||||
|
||||
@ -29,6 +29,12 @@ do
|
||||
if [ -z "$git" ]; then echo "Missing 'git' variable in $dir/lixonet.conf"; exit 1; fi
|
||||
sigil_vars=$(cat /etc/lixonet/${netname}/lixonet.conf | tr "\\n" " ")
|
||||
|
||||
# Parse subnets into a collection of IP reverse zones
|
||||
root_reverse_zones=$(echo '${network_address}/${global_prefix:-16}' | sigil -p $sigil_vars | xargs -I '{}' netcalc split {} 24 | sed 's/.0\/24$//' | awk 'BEGIN{FS="."}{print $3"."$2"."$1".in-addr.arpa"}' | sed -e ':a;N;$!ba;s/\n/,/g')
|
||||
sigil_vars=$(echo "$sigil_vars root_reverse_zones=$root_reverse_zones")
|
||||
local_reverse_zones=$(echo "$bgp_routes" | tr "," "\n" | xargs -I '{}' netcalc split {} 24 | sed 's/.0\/24$//' | awk 'BEGIN{FS="."}{print $3"."$2"."$1".in-addr.arpa"}' | sed -e ':a;N;$!ba;s/\n/,/g')
|
||||
sigil_vars=$(echo "$sigil_vars local_reverse_zones=$local_reverse_zones")
|
||||
|
||||
echo "Configuring Lixonet3 network $netname from $git..."
|
||||
echo "Variables: $sigil_vars"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user