summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/multiple-bgpd.sh22
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/multiple-bgpd.sh b/tools/multiple-bgpd.sh
index 001e91c6..028ad696 100644
--- a/tools/multiple-bgpd.sh
+++ b/tools/multiple-bgpd.sh
@@ -6,22 +6,24 @@ NUM=5
VTYBASE=2610
ASBASE=64560
BGPD=/path/to/bgpd
-PREFIX=192.168.145
+PREFIX=192.168.145.
+#PREFIX=3ffe:123:456::
+ADDRPLEN=32
CONFBASE=/tmp
PIDBASE=/var/run/quagga
CHOWNSTR=quagga:quagga
for H in `seq 1 ${NUM}` ; do
CONF="${CONFBASE}"/bgpd${H}.conf
- ADDR=${PREFIX}.${H}
+ ADDR=${PREFIX}${H}
if [ ! -e "$CONF" ] ; then
# This sets up a ring of bgpd peerings
NEXT=$(( ($H % ${NUM}) + 1 ))
PREV=$(( (($H + 3) % ${NUM}) + 1 ))
- NEXTADDR="${PREFIX}.${NEXT}"
+ NEXTADDR="${PREFIX}${NEXT}"
NEXTAS=$((${ASBASE} + $NEXT))
- PREVADDR="${PREFIX}.${PREV}"
+ PREVADDR="${PREFIX}${PREV}"
PREVAS=$((${ASBASE} + $PREV))
# Edit config to suit.
@@ -44,10 +46,10 @@ for H in `seq 1 ${NUM}` ; do
neighbor ${PREVADDR} peer-group default
!
address-family ipv6
- network fffe:${H}::/48
- network fffe:${H}:1::/48 pathlimit 1
- network fffe:${H}:2::/48 pathlimit 3
- network fffe:${H}:3::/48 pathlimit 3
+ network 3ffe:${H}::/48
+ network 3ffe:${H}:1::/48 pathlimit 1
+ network 3ffe:${H}:2::/48 pathlimit 3
+ network 3ffe:${H}:3::/48 pathlimit 3
neighbor default activate
neighbor default capability orf prefix-list both
neighbor default default-originate
@@ -64,8 +66,8 @@ for H in `seq 1 ${NUM}` ; do
# You may want to automatically add configure a local address
# on a loop interface.
#
- # Solaris: ifconfig vni${H} plumb ${ADDR}/32 up
- # Linux: ip address add ${ADDR}/32 dev lo 2> /dev/null
+ # Solaris: ifconfig vni${H} plumb ${ADDR}/${ADDRPLEN} up
+ # Linux: ip address add ${ADDR}/${ADDRPLEN} dev lo 2> /dev/null
${BGPD} -i "${PIDBASE}"/bgpd${H}.pid \
-l ${ADDR} \
-f "${CONF}" \