Commit c45bb610 authored by Jan Moskyto Matejka's avatar Jan Moskyto Matejka

Birdlab: Adjusting old-script to reworked rc.local; bgp@ipv6 enabled

parent c302172d
......@@ -2,13 +2,13 @@
REV=$1
cd /var/lib/virt/nfs
rm -f net/misc-at{d1,o1,f1,n1,d2}-{4,6}-conf
touch net/misc-at{d1,o1,f1,n1,d2}-{4,6}-conf
rm -f rc/misc-at{d1,o1,f1,n1,d2}-{4,6}-conf
touch rc/misc-at{d1,o1,f1,n1,d2}-{4,6}-conf
declare -a MACH=( d1 o1 f1 n1 d2 )
declare -a TOK=( {d1,o1,f1,n1,d2}-{4,6} )
declare -A IPA=( [d1]=10.55.0.1 [o1]=10.55.0.2 [f1]=10.55.0.3 [n1]=10.55.0.4 [d2]=10.55.0.5 )
declare -A SR=( [d1-4]="10.56.1.0/24 via 10.55.1.2" [o1-4]="10.56.2.0/24 via 10.55.1.6" [f1-4]="10.56.3.0/24 via 10.55.1.10" [n1-4]="10.56.4.0/24 via 10.55.1.14" [d2-4]="10.56.5.0/24 via 10.55.1.18" [d1-6]="fd01:56:0::/64 via fd01:55::1" [o1-6]="fd01:56:2::/64 via fd01:55::3" [f1-6]="fd01:56:4::/64 via fd01:55::5" [n1-6]="fd01:56:6::/64 via fd01:55::7" [d2-6]="fd01:56:8::/64 via fd01:55::9" )
declare -A SR=( [d1-4]="10.56.1.0/24 via 10.55.1.2" [o1-4]="10.56.2.0/24 via 10.55.1.6" [f1-4]="10.56.3.0/24 via 10.55.1.10" [n1-4]="10.56.4.0/24 via 10.55.1.14" [d2-4]="10.56.5.0/24 via 10.55.1.18" [d1-6]="fd01:56:0::/64 via fd01:55::2" [o1-6]="fd01:56:2::/64 via fd01:55::6" [f1-6]="fd01:56:4::/64 via fd01:55::10" [n1-6]="fd01:56:6::/64 via fd01:55::14" [d2-6]="fd01:56:8::/64 via fd01:55::18" )
function cf() {
local -a AR
......@@ -23,7 +23,7 @@ function cf() {
shift
(echo "# marker $@"; "$@") | tee -a $( for F in ${AR[@]}; do echo net/misc-at$F-conf; done ) #> /dev/null
(echo "# marker $@"; "$@") | tee -a $( for F in ${AR[@]}; do echo rc/misc-at$F-conf; done ) #> /dev/null
}
function cfe() {
......@@ -96,19 +96,49 @@ protocol bgp {
neighbor 10.55.1.17 as 65123;
export all;
table b4;
multihop;
}
EOF
cf d1-6 -- cat <<EOF
table b6;
protocol bgp {
local 2001:1488:a001::225:162 as 65123;
neighbor 2001:1488:a001::1 as 65534;
import all;
table b6;
}
protocol bgp {
local fd01:55::1 as 65123;
neighbor fd01:55::17 as 65123;
export all;
table b6;
multihop;
}
EOF
cf d2-4 -- cat <<EOF
protocol bgp {
local 10.55.1.17 as 65123;
neighbor 10.55.1.1 as 65123;
import filter { if net ~ 64.0.0.0/7 then accept; reject; };
multihop;
}
EOF
cf d2-6 -- cat <<EOF
protocol bgp {
local fd01:55::17 as 65123;
neighbor fd01:55::1 as 65123;
import all;
multihop;
}
EOF
for T in ${MACH[@]}; do
cat <<'EOF' > net/rc-at$T
cat <<'EOF' > rc/rc-loc-at$T
OSPF_INAME_SED="x;"
echo "Interface list:" ${INTERFACES[@]}
......@@ -125,15 +155,15 @@ OSPF_INAME_SED="$OSPF_INAME_SED x; s/.*//; x;"
SED_PATTERN="$SED_PATTERN /INAME/ { $OSPF_INAME_SED };"
echo "Sed pattern: $SED_PATTERN"
CF4="/mnt/nfs/net/misc-$HOSTNAME-4-conf"
CF6="/mnt/nfs/net/misc-$HOSTNAME-6-conf"
CF4="/mnt/nfs/rc/misc-$HOSTNAME-4-conf"
CF6="/mnt/nfs/rc/misc-$HOSTNAME-6-conf"
sed "$SED_PATTERN" $CF4 > /etc/bird4.conf
sed "$SED_PATTERN" $CF6 > /etc/bird6.conf
EOF
echo "rsync --exclude=.git -a /mnt/nfs/bird-test-$REV/ /tmp/bird4" >> net/rc-at$T
echo "rsync --exclude=.git -a /mnt/nfs/bird-test-$REV/ /tmp/bird6" >> net/rc-at$T
cat <<'EOF' >> net/rc-at$T
echo "rsync --exclude=.git -a /mnt/nfs/bird-test-$REV/ /tmp/bird4" >> rc/rc-loc-at$T
echo "rsync --exclude=.git -a /mnt/nfs/bird-test-$REV/ /tmp/bird6" >> rc/rc-loc-at$T
cat <<'EOF' >> rc/rc-loc-at$T
cd /tmp/bird4
$AUTOCONF
./configure --with-suffix=4
......
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