3 # Public domain, not copyrighted..
10 #PREFIX=3ffe:123:456::
13 PIDBASE
=/var
/run
/quagga
14 CHOWNSTR
=quagga
:quagga
16 for H
in `seq 1 ${NUM}` ; do
17 CONF
="${CONFBASE}"/bgpd
${H}.conf
20 if [ ! -e "$CONF" ] ; then
21 # This sets up a ring of bgpd peerings
22 NEXT
=$
(( ($H % ${NUM}) + 1 ))
23 PREV
=$
(( (($H + 3) % ${NUM}) + 1 ))
24 NEXTADDR
="${PREFIX}${NEXT}"
25 NEXTAS
=$
((${ASBASE} + $NEXT))
26 PREVADDR
="${PREFIX}${PREV}"
27 PREVAS
=$
((${ASBASE} + $PREV))
29 # Edit config to suit.
34 router bgp $((64560+${H}))
36 network 10.${H}.1.0/24 pathlimit 1
37 network 10.${H}.2.0/24 pathlimit 2
38 network 10.${H}.3.0/24 pathlimit 3
39 neighbor default peer-group
40 neighbor default update-source ${ADDR}
41 neighbor default capability orf prefix-list both
42 neighbor default soft-reconfiguration inbound
43 neighbor ${NEXTADDR} remote-as ${NEXTAS}
44 neighbor ${NEXTADDR} peer-group default
45 neighbor ${PREVADDR} remote-as ${PREVAS}
46 neighbor ${PREVADDR} peer-group default
49 network 3ffe:${H}::/48
50 network 3ffe:${H}:1::/48 pathlimit 1
51 network 3ffe:${H}:2::/48 pathlimit 3
52 network 3ffe:${H}:3::/48 pathlimit 3
53 neighbor default activate
54 neighbor default capability orf prefix-list both
55 neighbor default default-originate
56 neighbor ${NEXTADDR} peer-group default
57 neighbor ${PREVADDR} peer-group default
64 chown
${CHOWNSTR} "$CONF"
66 # You may want to automatically add configure a local address
67 # on a loop interface.
69 # Solaris: ifconfig vni${H} plumb ${ADDR}/${ADDRPLEN} up
70 # Linux: ip address add ${ADDR}/${ADDRPLEN} dev lo 2> /dev/null
71 ${BGPD} -i "${PIDBASE}"/bgpd${H}.pid \
74 -P $
((${VTYBASE}+${H})) \