Permalink
Browse files

Modify for two-server lab

  • Loading branch information...
1 parent ef67cfb commit 5e475dc574a3afd0fdb416c053d10e26136c0682 @steffann steffann committed Apr 10, 2012
View
@@ -115,38 +115,45 @@ function process_template() {
done; ) < ${TEMPLATE} > ${OUTPUT}
}
-DIR="../working/cfg-${MODE}"
-echo "Writing to ${DIR}"
-mkdir -p ${DIR}
-rm -f ../${DIR}/*.cfg
+BASE_DIR="../working"
+MODE_DIR="cfg-${MODE}"
echo -n "- Basic configuration:"
for SWITCH in `seq 1 2`; do
+ DIR="${BASE_DIR}/SW${SWITCH}/${MODE_DIR}"
+ mkdir -p "${DIR}"
+
TPL="templates/core-switch.cfg"
- CFG="SW${SWITCH}.cfg"
- echo -n " ${CFG}"
+ CFG="SWITCH.cfg"
+ echo -n " SW${SWITCH}:${CFG}"
set_possible_matches "X" "SW${SWITCH}"
process_template "${TPL}" "${DIR}/${CFG}"
done
-for UPSTREAM in `seq 1 2`; do
- TPL="templates/upstream-router.cfg"
- CFG="UPSTREAM${UPSTREAM}.cfg"
- echo -n " ${CFG}"
+for TRANSIT in `seq 1 2`; do
+ DIR="${BASE_DIR}/TRANSIT${TRANSIT}/${MODE_DIR}"
+ mkdir -p "${DIR}"
+
+ TPL="templates/transit-router.cfg"
+ CFG="TRANSIT.cfg"
+ echo -n " TRANSIT${TRANSIT}:${CFG}"
- set_possible_matches "X" "UPSTREAM${UPSTREAM}"
+ set_possible_matches "X" "TRANSIT${TRANSIT}"
process_template "${TPL}" "${DIR}/${CFG}"
done
echo ""
for POP in `seq 1 ${POP_COUNT}`; do
+ DIR="${BASE_DIR}/POP${POP}/${MODE_DIR}"
+ mkdir -p "${DIR}"
+
echo "- POP ${POP}:"
echo -n " - Basic configuration:"
for ROUTER in `seq 1 3`; do
TPL="templates/pop-router.cfg"
- CFG="POP${POP}-R${ROUTER}.cfg"
- echo -n " ${CFG}"
+ CFG="R${ROUTER}.cfg"
+ echo -n " POP${POP}:${CFG}"
set_possible_matches "${POP}" "R${ROUTER}"
process_template "${TPL}" "${DIR}/${CFG}"
@@ -156,8 +163,8 @@ for POP in `seq 1 ${POP_COUNT}`; do
echo -n " - Customer configuration:"
for CUSTOMER in `seq 1 2`; do
TPL="templates/pop-customer.cfg"
- CFG="POP${POP}-CUST${CUSTOMER}.cfg"
- echo -n " ${CFG}"
+ CFG="CUST${CUSTOMER}.cfg"
+ echo -n " ${POP}:${CFG}"
set_possible_matches "${POP}" "CUST${CUSTOMER}"
process_template "${TPL}" "${DIR}/${CFG}"
@@ -88,6 +88,7 @@ router bgp 650${POP}2
network 172.2${POP}.2.0 mask 255.255.255.0
neighbor 172.16.2${POP}.5 remote-as 65530
neighbor 172.16.2${POP}.5 description "BGP ISP POP${POP}-R2"
+ neighbor 172.16.2${POP}.5 prefix-list MYSELF-IPv4 out
neighbor 172.16.2${POP}.5 password "Cu5t0m3r"
neighbor 172.16.2${POP}.5 activate
--END--
@@ -97,10 +98,19 @@ router bgp 650${POP}2
network 2001:db8:${POP}002::/48
neighbor 2001:db8:${POP}:ff02::1 remote-as 65530
neighbor 2001:db8:${POP}:ff02::1 description "BGP ISP POP${POP}-R2"
+ neighbor 2001:db8:${POP}:ff02::1 prefix-list MYSELF-IPv6 out
neighbor 2001:db8:${POP}:ff02::1 password "Cu5t0m3r"
neighbor 2001:db8:${POP}:ff02::1 activate
--END--
!
+--ONLY CUST2-v4--
+ip prefix-list MYSELF-IPv4 permit 172.2${POP}.2.0/24
+--END--
+!
+--ONLY CUST2-v6--
+ipv6 prefix-list MYSELF-IPv6 permit 2001:db8:${POP}002::/4
+--END--
+!
--ONLY v4--
ip route 172.2${POP}.${CUSTOMER}.0 255.255.255.0 Null 0
ip route 0.0.0.0 0.0.0.0 172.16.2${POP}.1 ! ONLY CUST1
@@ -172,7 +172,7 @@ interface e1/2
shutdown
--ONLY R2--
ip address 192.168.1.$((POP*4-2)) 255.255.255.252 ! ONLY v4
- ipv6 address 2001:DB9:FFFE:100${POP}::B/127 ! ONLY v6
+ ipv6 address 2001:db9:ffff:100${POP}::b/127 ! ONLY v6
no shutdown
--END--
!
@@ -186,7 +186,7 @@ interface e1/3
shutdown
--ONLY R2--
ip address 192.168.2.$((POP*4-2)) 255.255.255.252 ! ONLY v4
- ipv6 address 2001:DB9:FFFE:200${POP}::B/127 ! ONLY v6
+ ipv6 address 2001:db9:ffff:200${POP}::b/127 ! ONLY v6
no shutdown
--END--
!
@@ -250,12 +250,12 @@ router bgp 65530
neighbor Core-iBGP-IPv4 remote-as 65530
neighbor Core-iBGP-IPv4 update-source Loopback0
neighbor 192.168.1.$((POP*4-3)) remote-as 65531
- neighbor 192.168.1.$((POP*4-3)) password "upstream-1"
- neighbor 192.168.1.$((POP*4-3)) prefix-list UPSTREAM-OUT-IPv4 out
+ neighbor 192.168.1.$((POP*4-3)) password "transit-1"
+ neighbor 192.168.1.$((POP*4-3)) prefix-list TRANSIT-OUT-IPv4 out
neighbor 192.168.1.$((POP*4-3)) activate
neighbor 192.168.2.$((POP*4-3)) remote-as 65532
- neighbor 192.168.2.$((POP*4-3)) password "upstream-2"
- neighbor 192.168.2.$((POP*4-3)) prefix-list UPSTREAM-OUT-IPv4 out
+ neighbor 192.168.2.$((POP*4-3)) password "transit-2"
+ neighbor 192.168.2.$((POP*4-3)) prefix-list TRANSIT-OUT-IPv4 out
neighbor 192.168.2.$((POP*4-3)) activate
neighbor 172.16.1.2 peer-group Core-iBGP-IPv4 ! ONLY POP1EXISTS
neighbor 172.16.1.2 activate ! ONLY POP1EXISTS
@@ -313,14 +313,14 @@ router bgp 65530
neighbor Core-iBGP-IPv6 peer-group
neighbor Core-iBGP-IPv6 remote-as 65530
neighbor Core-iBGP-IPv6 update-source Loopback0
- neighbor 2001:db9:fffe:100${POP}::a remote-as 65531
- neighbor 2001:db9:fffe:100${POP}::a password "upstream-1"
- neighbor 2001:db9:fffe:100${POP}::a prefix-list UPSTREAM-OUT-IPv6 out
- neighbor 2001:db9:fffe:100${POP}::a activate
- neighbor 2001:db9:fffe:200${POP}::a remote-as 65532
- neighbor 2001:db9:fffe:200${POP}::a password "upstream-2"
- neighbor 2001:db9:fffe:200${POP}::a prefix-list UPSTREAM-OUT-IPv6 out
- neighbor 2001:db9:fffe:200${POP}::a activate
+ neighbor 2001:db9:ffff:100${POP}::a remote-as 65531
+ neighbor 2001:db9:ffff:100${POP}::a password "transit-1"
+ neighbor 2001:db9:ffff:100${POP}::a prefix-list TRANSIT-OUT-IPv6 out
+ neighbor 2001:db9:ffff:100${POP}::a activate
+ neighbor 2001:db9:ffff:200${POP}::a remote-as 65532
+ neighbor 2001:db9:ffff:200${POP}::a password "transit-2"
+ neighbor 2001:db9:ffff:200${POP}::a prefix-list TRANSIT-OUT-IPv6 out
+ neighbor 2001:db9:ffff:200${POP}::a activate
neighbor 2001:db8::1:2 peer-group Core-iBGP-IPv6 ! ONLY POP1EXISTS
neighbor 2001:db8::1:2 activate ! ONLY POP1EXISTS
neighbor 2001:db8::2:2 peer-group Core-iBGP-IPv6 ! ONLY POP2EXISTS
@@ -354,10 +354,10 @@ router bgp 65530
--END--
!
--ONLY R2-v4--
-ip prefix-list UPSTREAM-OUT-IPv4 permit 172.16.0.0/12
+ip prefix-list TRANSIT-OUT-IPv4 permit 172.16.0.0/12
--END--
--ONLY R2-v6--
-ipv6 prefix-list UPSTREAM-OUT-IPv6 permit 2001:db8::/32
+ipv6 prefix-list TRANSIT-OUT-IPv6 permit 2001:db8::/32
--END--
--ONLY R3-v4--
ip prefix-list POP${POP}-CUST2-IN-IPv4 permit 172.2${POP}.2.0/24
Oops, something went wrong.

0 comments on commit 5e475dc

Please sign in to comment.