




























































































Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!





























































































Redouane MEDDANE Table of Contents
Lab 1: MED and AS-Path Prepend Basic configuration R1: interface Loopback ip address 1.1.1.1 255.255.255. ! interface FastEthernet0/ ip address 150.1.1.1 255.255.255. no shut ! interface Serial0/ ip address 10.0.0.1 255.255.255. no shut R2: interface Loopback ip address 2.2.2.2 255.255.255. ! interface Loopback ip address 192.1.1.1 255.255.255. ! interface Loopback ip address 193.1.1.1 255.255.255. !
In order to ensure that the ORIGIN code is INCOMPLETE, you need to redistribute the LAN subnets into BGP. However, you can also use the network statement in conjunction with a R1(config-router)#redistribute connected route-map CONNECTED R1(config-router)#exit You can verify the ORIGIN code by looking at the prefix entry in the BGP Tables. The ORIGIN code of INCOMPLETE is denoted by a question mark (?) in the output of the show ip bgp
R1(config-router)#do show ip bgp BGP table version is 4, local router ID is 1.1.1. Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP,? - incomplete Network Next Hop Metric LocPrf Weight Path
R2(config-router)#neighbor 3.3.3.3 route-map MED out R2(config-router)#exit Let's verify the BGP RIBs of R3: We have still the best path to reach 150.1.1.0 via R4 as shown by the show ip bgp command on R3 below, so the problem is not resolved even if R2 advertises the lowest MED comparing with R4. The reason is: we met two issues in this case:
**- the first issue is: by default, the MED is only compared for path received from the same AS ,in this case R3 receives two values of MED from two routers (R2 and R4) configured in different AS.
R3(config-router)#do show ip bgp BGP table version is 4, local router ID is 3.3.3. Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP,? - incomplete Network Next Hop Metric LocPrf Weight Path
interface Loopback ip address 4.4.4.4 255.255.255. ! interface FastEthernet0/ ip address 24.0.0.4 255.255.255. no shutdown ! interface FastEthernet0/ ip address 10.100.1.4 255.255.255. no shutdown R5: interface Loopback ip address 5.5.5.5 255.255.255. ! interface FastEthernet0/ ip address 35.0.0.5 255.255.255. no shutdown ! interface FastEthernet0/ ip address 10.100.1.5 255.255.255. no shutdown R6: interface Loopback ip address 6.6.6.6 255.255.255. ! interface FastEthernet0/ ip address 10.100.1.6 255.255.255. no shutdown R7: interface Loopback ip address 7.7.7.7 255.255.255. ! interface FastEthernet0/ ip address 10.100.1.3 255.255.255. no shutdown Configure EIGRP AS 4567 on R4, R5, R6 and R7 and advertise the subnet 10.100.1.0/29 and the loopback 0 subnets: R4: router eigrp 4567 network 4.4.4.4 0.0.0. network 10.100.1.0 0.0.0. R5: router eigrp 4567 network 5.5.5.5 0.0.0. network 10.100.1.0 0.0.0. R6: router eigrp 4567 network 6.6.6.6 0.0.0.
network 10.100.1.0 0.0.0. R7: router eigrp 4567 network 7.7.7.7 0.0.0. network 10.100.1.0 0.0.0. Configure iBGP in AS 4567, use loopback 0 interface for peering and use peer group configuration. Configure eBGP between AS 4567 and AS 2 and AS 3. Configure eBGP between AS 2 and AS 1. Configure eBGP between AS 3 and AS 1, advertise 1.0.0.0/8 and 2.0.0.0/8 subnets in BGP: R4: router bgp 4567 network 10.100.1.0 mask 255.255.255. neighbor INTERNAL peer-group neighbor INTERNAL remote-as 4567 neighbor INTERNAL update-source Loopback neighbor INTERNAL next-hop-self neighbor 5.5.5.5 peer-group INTERNAL neighbor 6.6.6.6 peer-group INTERNAL neighbor 7.7.7.7 peer-group INTERNAL neighbor 24.0.0.2 remote-as 2 R5: router bgp 4567 network 10.100.1.0 mask 255.255.255. neighbor INTERNAL peer-group neighbor INTERNAL remote-as 4567 neighbor INTERNAL update-source Loopback neighbor INTERNAL next-hop-self neighbor 4.4.4.4 peer-group INTERNAL neighbor 6.6.6.6 peer-group INTERNAL neighbor 7.7.7.7 peer-group INTERNAL neighbor 35.0.0.3 remote-as 3 R6: router bgp 4567 neighbor INTERNAL peer-group neighbor INTERNAL remote-as 4567 neighbor INTERNAL update-source Loopback neighbor 4.4.4.4 peer-group INTERNAL neighbor 5.5.5.5 peer-group INTERNAL neighbor 7.7.7.7 peer-group INTERNAL R7: router bgp 4567 neighbor INTERNAL peer-group neighbor INTERNAL remote-as 4567 neighbor INTERNAL update-source Loopback neighbor 4.4.4.4 peer-group INTERNAL neighbor 5.5.5.5 peer-group INTERNAL neighbor 6.6.6.6 peer-group INTERNAL
6 path entries using 312 bytes of memory 5/2 BGP path/bestpath attribute entries using 620 bytes of memory 2 BGP AS-PATH entries using 48 bytes of memory 0 BGP route-map cache entries using 0 bytes of memory 0 BGP filter-list cache entries using 0 bytes of memory BGP using 1331 total bytes of memory BGP activity 3/0 prefixes, 6/0 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 5.5.5.5 4 4567 11 11 5 0 0 00:06:58 3 6.6.6.6 4 4567 10 12 5 0 0 00:07:05 0 7.7.7.7 4 4567 10 12 5 0 0 00:06:27 0 24.0.0.2 4 2 7 6 5 0 0 00:01:55 2 R7(config-router)#do show ip bgp sum BGP router identifier 7.7.7.7, local AS number 4567 BGP table version is 5, main routing table version 5 3 network entries using 351 bytes of memory 6 path entries using 312 bytes of memory 4/2 BGP path/bestpath attribute entries using 496 bytes of memory 2 BGP AS-PATH entries using 48 bytes of memory 0 BGP route-map cache entries using 0 bytes of memory 0 BGP filter-list cache entries using 0 bytes of memory BGP using 1207 total bytes of memory BGP activity 3/0 prefixes, 6/0 paths, scan interval 60 secs Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 4.4.4.4 4 4567 12 10 5 0 0 00:06:47 3 5.5.5.5 4 4567 12 10 5 0 0 00:07:08 3 6.6.6.6 4 4567 9 9 5 0 0 00:06:56 0 Ensure AS 4567 will use the link between R3-R5 towards network 2.0.0.0/8. Use LOCAL_PREF only. Before configuring the Local-Pref, let’s use a traceroute on R6 and R7 toward 2.0.0.1. We can see that the packet goes through R4--R2: R6#traceroute 2.0.0. Type escape sequence to abort. Tracing the route to 2.0.0. 1 10.100.1.4 72 msec 24 msec 24 msec 2 24.0.0.2 60 msec 28 msec 80 msec 3 12.0.0.1 96 msec * 96 msec R6# R7(config-router)#do traceroute 2.0.0. Type escape sequence to abort. Tracing the route to 2.0.0. 1 10.100.1.4 56 msec 56 msec 12 msec 2 24.0.0.2 52 msec 48 msec 32 msec 3 12.0.0.1 84 msec * 108 msec R7(config-router) *Verify the RIB of R6 and R7: Notice that the best route to reach 2.0.0.0/24 is via R4 (4.4.4.4) denoted by " >i " on both R and R7: R6#show ip bgp
BGP table version is 5, local router ID is 6.6.6. Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP,? - incomplete Network Next Hop Metric LocPrf Weight Path
Origin codes: i - IGP, e - EGP,? - incomplete Network Next Hop Metric LocPrf Weight Path *>i1.0.0.0 4.4.4.4 0 200 0 2 1 i *>i2.0.0.0 5.5.5.5 0 200 0 3 1 i r>i10.100.1.0/29 4.4.4.4 0 100 0 i r i 5.5.5.5 0 100 0 i R7(config)#do show ip bgp BGP table version is 10, local router ID is 7.7.7. Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP,? - incomplete Network Next Hop Metric LocPrf Weight Path *>i1.0.0.0 4.4.4.4 0 200 0 2 1 i *>i2.0.0.0 5.5.5.5 0 200 0 3 1 i r>i10.100.1.0/29 4.4.4.4 0 100 0 i r i 5.5.5.5 0 100 0 i Note: you must enter the clear ip bgp * command to reset the bgp neighbors relationship when configuring the Local-Preference to take effect.
Lab 3 : BGP path control Basic Configuration R1: interface FastEthernet0/ ip address 150.1.1.1 255.255.255. no shutd ! interface Serial0/ ip address 10.0.0.1 255.255.255. no shutd ! interface Serial0/ ip address 10.0.0.5 255.255.255. no shutd R2: interface FastEthernet0/ ip address 150.2.2.2 255.255.255. no shutd ! interface Serial0/ ip address 10.0.0.2 255.255.255. no shutd !
router bgp 65503 bgp router-id 3.3.3. bgp confederation identifier 5 bgp confederation peers 65502 65504 network 150.3.3.0 mask 255.255.255. neighbor 10.0.0.5 remote-as 254 neighbor 10.0.0.9 remote-as 65502 neighbor 10.0.0.9 next-hop-self neighbor 10.0.0.14 remote-as 65504 neighbor 10.0.0.14 next-hop-self R4: router bgp 65504 bgp router-id 4.4.4. bgp confederation identifier 5 bgp confederation peers 65503 network 150.1.1.0 mask 255.255.255. neighbor 10.0.0.13 remote-as 65503 neighbor 10.0.0.13 next-hop-self neighbor 150.1.1.1 remote-as 254 Configure AS 5 so that R2 and R3 prefer the path via R1 to reach the 150.1.1.0/24 prefix. Ensure that this is ONLY applicable to this single prefix. The best path to reach 150.1.1.0 from R2 is via R3 through the AS 5 confederation as shown by the following output in the section confed-external, best: R2#show ip bgp 150.1.1.0 255.255.255. BGP routing table entry for 150.1.1.0/24, version 10 Paths: (2 available, best #1, table Default-IP-Routing-Table) Advertised to update-groups: 2 (65503 65504) 10.0.0.10 from 10.0.0.10 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, confed-external, best 254 10.0.0.1 from 10.0.0.1 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, external The best path to reach 150.1.1.0 from R3 is via R4 as shown by the following output in the section confed-external, best: R3#show ip bgp 150.1.1.0 255.255.255. BGP routing table entry for 150.1.1.0/24, version 6 Paths: (2 available, best #1, table Default-IP-Routing-Table) Advertised to update-groups: 1 2 (65504) 10.0.0.14 from 10.0.0.14 (4.4.4.4) Origin IGP, metric 0, localpref 100, valid, confed-external, best 254 10.0.0.5 from 10.0.0.5 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, external
To complete this task, you need to modify either the WEIGHT or the LOCAL_PREF attributes for the 150.1.1.0/24 prefix received from R1 on routers R2 and R3. R2(config) # routerbgp 65502 R2(config-router) #neighbor 10.0.0.1 route-map weight-R1 in R2(config-router) #ip prefix-list NET-R1 seq 5 permit 150.1.1.0/ R2(config) # route-map weight-R1 permit 10 R2(config-route-map)# match ip address prefix-list NET-R R2(config-route-map)# set weight 1000 R2(config-route-map)#route-map weight-R1 permit 20 R3(config)#router bgp 65503 R3(config-router)#neighbor 10.0.0.5 route-map weight-R1 in R3(config-router)#ip prefix-list NET-R1 seq 5 permit 150.1.1.0/ R3(config)#route-map weight-R1 permit 10 R3(config-route-map)# match ip address prefix-list NET-R R3(config-route-map)# set weight 1000 R3(config-route-map)# R3(config-route-map)#route-map weight-R1 permit 20 let's verify the result after clearing the bgp neighbors: R2(config-route-map) #do clear ip bgp * R3(config-route-map)#do clear ip bgp * Both R2 and R3 prefer the path through R1 (10.0.0.1): R2(config-route-map)#do show ip bgp 150.1.1.0 255.255.255. BGP routing table entry for 150.1.1.0/24, version 2 Paths: (2 available, best #2, table Default-IP-Routing-Table) Flag: 0x Advertised to update-groups: 1 (65503) 254 10.0.0.10 from 10.0.0.10 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, confed-external 254 10.0.0.1 from 10.0.0.1 (1.1.1.1) Origin IGP, metric 0, localpref 100, weight 1000, valid, external, best R3(config-route-map)#do show ip bgp 150.1.1.0 255.255.255. BGP routing table entry for 150.1.1.0/24, version 2 Paths: (3 available, best #3, table Default-IP-Routing-Table) Flag: 0x Advertised to update-groups: 1 (65502) 254 10.0.0.9 from 10.0.0.9 (2.2.2.2) Origin IGP, metric 0, localpref 100, valid, confed-external (65504) 10.0.0.14 from 10.0.0.14 (4.4.4.4) Origin IGP, metric 0, localpref 100, valid, confed-external 254 10.0.0.5 from 10.0.0.5 (1.1.1.1) Origin IGP, metric 0, localpref 100, weight 1000, valid, external, best