This shows you the differences between two versions of the page.
pr:laboratoare:10 [2017/01/16 19:38] iulia.florea [4. Route filtering (10p)] |
pr:laboratoare:10 [2025/07/27 14:49] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Laboratorul 10. Recapitulare ===== | + | ===== Laboratorul 10. ===== |
- | ==== Topologie ==== | ||
- | {{ :pr:laboratoare:10_topologie.png |}} | ||
- | |||
- | ==== Cerințe ==== | ||
- | |||
- | === Setup === | ||
- | <note important> În acest laborator vom folosi un alt fișier de topologie ''.net''. | ||
- | |||
- | Descărcați și dezarhivați arhiva de laborator de {{:pr:laboratoare:10_lab.zip|aici}}. Copiați imaginea de IOS în folderul ''ios/'', porniți Dynamips și apoi porniți dynagen folosind fișierul ''.net'' din arhivă. </note> | ||
- | |||
- | === Exerciții === | ||
- | |||
- | |||
- | ==== 1. Adresare IP (10p) ==== | ||
- | |||
- | **(10p)** Configurați adresele IP ale interfețelor de loopback conform tabelului de mai jos. | ||
- | |||
- | ^ Ruter ^ Interfață ^ Adresă IP | | ||
- | | R1 | Lo0 | 11.10.1.1/24 | | ||
- | | R2 | Lo0 | 12.14.14.1/24 | | ||
- | | R3 | Lo0 | 13.13.13.1/24 | | ||
- | | R4 | Lo0 | 14.14.14.1/24 | | ||
- | | R5 | Lo0 | 15.12.13.1/26 | | ||
- | | R5 | Lo1 | 15.12.13.65/26 | | ||
- | |||
- | <solution -hidden> | ||
- | Pe **R1**: | ||
- | <code> | ||
- | int l0 | ||
- | ip add 11.10.1.1 255.255.255.0 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R1#sh ip int brief | ||
- | Interface IP-Address OK? Method Status Protocol | ||
- | […] | ||
- | Loopback0 11.10.1.1 YES manual up up | ||
- | </code> | ||
- | </solution> | ||
- | |||
- | |||
- | |||
- | ==== 2. OSPF (35p) ==== | ||
- | |||
- | **a. (3p)** Configurați OSPF aria 0 pe segmentul Ethernet dintre R2 și R5. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R2# | ||
- | router ospf 1 | ||
- | network 89.112.25.0 0.0.0.255 area 0 | ||
- | </code> | ||
- | |||
- | |||
- | <code> | ||
- | R5# | ||
- | router ospf 1 | ||
- | ! | ||
- | int e0/1 | ||
- | ip ospf 1 area 0 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | *Mar 1 00:46:06.519: %OSPF-5-ADJCHG: Process 1, Nbr 12.14.14.1 on Ethernet0/1 | ||
- | rom LOADING to FULL, Loading Done | ||
- | R5#sh ip ospf nei | ||
- | |||
- | Neighbor ID Pri State Dead Time Address Interface | ||
- | 12.14.14.1 1 FULL/BDR 00:00:37 89.112.25.2 Ethernet0/1 | ||
- | </code> | ||
- | </solution> | ||
- | |||
- | **b. (4p)** Configurați OSPF aria 1 pe segmentul Serial dintre R1 și R2 și pe interfața de loopback lo0 a lui R2. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R1# | ||
- | router ospf 1 | ||
- | ! | ||
- | int se 1/0 | ||
- | ip ospf 1 area 1 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R2# | ||
- | int se 1/0 | ||
- | ip ospf 1 area 1 | ||
- | int l0 | ||
- | ip ospf 1 area 1 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | *Mar 1 01:01:04.835: %OSPF-5-ADJCHG: Process 1, Nbr 12.14.14.1 on Serial1/0 fro | ||
- | m LOADING to FULL, Loading Done | ||
- | R1#sh ip route ospf | ||
- | 89.0.0.0/24 is subnetted, 3 subnets | ||
- | O IA 89.112.25.0 [110/74] via 89.112.12.2, 00:00:06, Serial1/0 | ||
- | 12.0.0.0/32 is subnetted, 1 subnets | ||
- | O 12.14.14.1 [110/65] via 89.112.12.2, 00:00:06, Serial1/0 | ||
- | </code> | ||
- | </solution> | ||
- | |||
- | **c. (4p)** Configurați OSPF aria 2 pe interfața lo0 a lui R1. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R1(config)#int l0 | ||
- | R1(config-if)#ip ospf 1 area 2 | ||
- | R1#sh ip ospf database | ||
- | |||
- | OSPF Router with ID (11.10.2.1) (Process ID 1) | ||
- | |||
- | Router Link States (Area 1) | ||
- | |||
- | Link ID ADV Router Age Seq# Checksum Link count | ||
- | 11.10.2.1 11.10.2.1 455 0x80000002 0x00CFCD 2 | ||
- | 12.14.14.1 12.14.14.1 448 0x80000002 0x00341C 3 | ||
- | |||
- | Summary Net Link States (Area 1) | ||
- | |||
- | Link ID ADV Router Age Seq# Checksum | ||
- | 89.112.25.0 12.14.14.1 456 0x80000001 0x00C561 | ||
- | |||
- | Router Link States (Area 2) | ||
- | |||
- | Link ID ADV Router Age Seq# Checksum Link count | ||
- | 11.10.2.1 11.10.2.1 8 0x80000001 0x00BB2F 1 | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | |||
- | **d. (4p)** Configurați rețeaua OSPF astfel încât să aveți ping între R5 și interfața lo0 a lui R1 | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R2(config-router)#do sh ip route ospf | ||
- | 11.0.0.0/32 is subnetted, 1 subnets | ||
- | O IA 11.10.1.1 [110/65] via 89.112.12.1, [...] | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R2(config-router)#area 1 virtual-link 11.10.2.1 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R1(config-router)#area 1 virtual-link 12.14.14.1 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R1(config-router)#do sh ip ospf nei | ||
- | |||
- | Neighbor ID Pri State Dead Time Address Interface | ||
- | 12.14.14.1 0 FULL/ - - 89.112.12.2 OSPF_VL0 | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | |||
- | **e. (4p)** Configurați rețeaua OSPF astfel încât R2 să fie mereu ales DR pe legătura dintre R2 și R5. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R2# | ||
- | int e 0/1 | ||
- | ip ospf priority 100 | ||
- | ! | ||
- | clear ip ospf 1 process | ||
- | Reset OSPF process? [no]: yes | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R5#sh ip ospf nei | ||
- | |||
- | Neighbor ID Pri State Dead Time Address Interface | ||
- | 12.14.14.1 100 FULL/DR 00:00:35 89.112.25.2 Ethernet0/1 | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | |||
- | |||
- | **f. (4p)** Introduceți în OSPF, ca rute externe cu cost cumulativ, DOAR interfețele lo0 și lo1 ale lui R5. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R5# | ||
- | ip access-list standard ACL_OSPF_RED_CONN | ||
- | permit 15.12.13.0 0.0.0.127 | ||
- | ! | ||
- | route-map OSPF_RED_CONN | ||
- | match ip address ACL_OSPF_RED_CONN | ||
- | ! | ||
- | router ospf 1 | ||
- | redistribute connected subnets route-map OSPF_RED_CONN metric-type 1 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R1#sh ip route ospf | ||
- | […] | ||
- | 15.0.0.0/26 is subnetted, 2 subnets | ||
- | O E1 15.12.13.0 [110/94] via 89.112.12.2, 00:00:01, Serial1/0 | ||
- | O E1 15.12.13.64 [110/94] via 89.112.12.2, 00:00:01, Serial1/0 | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | |||
- | |||
- | **g. (8p)** Sumarizați rețele de pe lo0 și lo1 ale lui R5. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R5# | ||
- | router ospf 1 | ||
- | summary-address 15.12.13.0 255.255.255.128 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R1(config-router)#do sh ip route ospf | ||
- | 89.0.0.0/24 is subnetted, 3 subnets | ||
- | O 89.112.25.0 [110/74] via 89.112.12.2, 00:06:29, Serial1/0 | ||
- | 12.0.0.0/32 is subnetted, 1 subnets | ||
- | O 12.14.14.1 [110/65] via 89.112.12.2, 00:34:29, Serial1/0 | ||
- | 15.0.0.0/8 is variably subnetted, 2 subnets, 2 masks | ||
- | O 15.15.15.1/32 [110/75] via 89.112.12.2, 00:06:29, Serial1/0 | ||
- | O E1 15.12.13.0/25 [110/94] via 89.112.12.2, 00:00:04, Serial1/0 | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | |||
- | **h. (4p)** Configurați aria 2 astfel încât această să nu accepte LSA-uri de tip 5. Verificați acest lucru. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R1(config)#router ospf 1 | ||
- | R1(config-router)#area 2 stub | ||
- | R1#sh ip ospf | ||
- | […] | ||
- | Area 2 | ||
- | Number of interfaces in this area is 1 (1 loopback) | ||
- | It is a stub area | ||
- | generates stub default route with cost 1 | ||
- | Area has no authentication | ||
- | SPF algorithm last executed 00:02:23.996 ago | ||
- | SPF algorithm executed 7 times | ||
- | Area ranges are | ||
- | Number of LSA 6. Checksum Sum 0x03ADC9 | ||
- | Number of opaque link LSA 0. Checksum Sum 0x000000 | ||
- | Number of DCbitless LSA 0 | ||
- | Number of indication LSA 0 | ||
- | Number of DoNotAge LSA 0 | ||
- | Flood list length 0 | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | |||
- | ==== 3. IPv6 (20p) ==== | ||
- | |||
- | ** a. (5p)** Configurați adresa 2001:1::1/64 pe interfața lo1 a lui R1. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R1(config)#int l1 | ||
- | R1(config-if)#ipv6 address 2001:1::1/64 | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | |||
- | |||
- | ** b. (5p)** Configurați adresa 2001:2::/64 pe interfața lo2 a lui R5. Ultimii 64 de biți ai adresei trebuie generați folosind metoda EUI-64. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R5(config)#int l2 | ||
- | R5(config-if)#ipv6 address 2001:2::/64 eui-64 | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | |||
- | ** c. (10p)** Configurați un tunel MCT între R1 și R5 astfel încât să existe conectivitate între lo1 a lui R1 și lo2 a lui R5. Pentru acest task este permisă folosirea rutelor statice. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R1#sh runn | sec Tunn | ||
- | interface Tunnel0 | ||
- | no ip address | ||
- | ipv6 address 2001:15::1/64 | ||
- | tunnel source Loopback0 | ||
- | tunnel destination 15.12.13.1 | ||
- | tunnel mode ipv6ip | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R5#sh runn | sec Tunn | ||
- | interface Tunnel0 | ||
- | no ip address | ||
- | ipv6 address 2001:15::5/64 | ||
- | tunnel source Loopback0 | ||
- | tunnel destination 11.10.1.1 | ||
- | tunnel mode ipv6ip | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R1(config)#ipv6 route 2001:2::/64 2001:15::5 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R5(config)#ipv6 route 2001:1::/64 2001:15::1 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R5(config-if)#do sh ipv6 int brief | ||
- | […] | ||
- | Loopback2 [up/up] | ||
- | FE80::CE04:3FF:FE8C:0 | ||
- | 2001:2::CE04:3FF:FE8C:0 | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R1#ping 2001:2::CE04:3FF:FE8C:0 | ||
- | |||
- | Type escape sequence to abort. | ||
- | Sending 5, 100-byte ICMP Echos to 2001:2::CE04:3FF:FE8C:0, timeout is 2 seconds: | ||
- | !!!!! | ||
- | Success rate is 100 percent (5/5), round-trip min/avg/max = 200/735/1696 ms | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | |||
- | ==== 4. Route filtering (10p) ==== | ||
- | |||
- | **(10p)** Pe R2, filtrați rețeaua 15.12.13.0/26 astfel încât aceasta să nu fie instalată în tabela de rutare. R1 trebuie să aibă în continuare această rețea în tabela sa de rutare. | ||
- | Hint: este posibil să trebuiască să restartați procesul OSPF pentru a vedea diferențele în tabela de rutare. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R2(config)#router ospf 1 | ||
- | R2(config-router)#distribute-list OSPF_IN in | ||
- | R2(config-router)#exit | ||
- | R2(config)#ip access-list standard OSPF_IN | ||
- | R2(config-std-nacl)#deny 15.12.13.0 0.0.0.127 | ||
- | R2(config-std-nacl)#permit any | ||
- | ! | ||
- | R2(config-std-nacl)#do sh ip access-list | ||
- | Standard IP access list OSPF_IN | ||
- | 10 deny 15.12.13.0, wildcard bits 0.0.0.127 (2 matches) | ||
- | 20 permit any (3 matches) | ||
- | ! | ||
- | R2(config-std-nacl)#do sh ip route | ||
- | […] | ||
- | 11.0.0.0/32 is subnetted, 1 subnets | ||
- | O IA 11.10.1.1 [110/65] via 89.112.12.1, 00:00:05, Serial1/0 | ||
- | 89.0.0.0/24 is subnetted, 3 subnets | ||
- | C 89.112.12.0 is directly connected, Serial1/0 | ||
- | C 89.112.25.0 is directly connected, Ethernet0/1 | ||
- | C 89.112.23.0 is directly connected, Ethernet0/0 | ||
- | 12.0.0.0/24 is subnetted, 1 subnets | ||
- | C 12.14.14.0 is directly connected, Loopback0 | ||
- | 15.0.0.0/32 is subnetted, 1 subnets | ||
- | O 15.15.15.1 [110/11] via 89.112.25.5, 00:00:05, Ethernet0/1 | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | ==== 5. BGP (35p) ==== | ||
- | |||
- | ** a. (10p)** Configurați următoarele adiacențe iBGP în AS-ul 100: | ||
- | * R2-R5 – adiacența trebuie realizată peste interfețele de loopback | ||
- | * R1-R2 – adiacența trebuie realizată peste interfețele de loopback | ||
- | In AS 200: | ||
- | * R3-R4 – adiacența trebuie realizată peste interfețele fizice | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R2#sh runn | sec bgp | ||
- | router bgp 100 | ||
- | no synchronization | ||
- | bgp log-neighbor-changes | ||
- | neighbor 15.15.15.1 remote-as 100 | ||
- | neighbor 15.15.15.1 update-source Loopback0 | ||
- | no auto-summary | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R5#sh runn | sec bgp | ||
- | router bgp 100 | ||
- | no synchronization | ||
- | bgp log-neighbor-changes | ||
- | neighbor 12.14.14.1 remote-as 100 | ||
- | neighbor 12.14.14.1 update-source Loopback2 | ||
- | no auto-summary | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R5#sh ip bgp summ | ||
- | BGP router identifier 15.15.15.1, local AS number 100 | ||
- | BGP table version is 1, main routing table version 1 | ||
- | |||
- | Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd | ||
- | 12.14.14.1 4 100 3 3 1 0 0 00:00:54 0 | ||
- | </code> | ||
- | |||
- | |||
- | <code> | ||
- | R2#sh runn | sec bgp | ||
- | router bgp 100 | ||
- | no synchronization | ||
- | bgp log-neighbor-changes | ||
- | neighbor 11.10.1.1 remote-as 100 | ||
- | neighbor 11.10.1.1 update-source Loopback0 | ||
- | no auto-summary | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R1#sh runn | sec bgp | ||
- | router bgp 100 | ||
- | no synchronization | ||
- | bgp log-neighbor-changes | ||
- | neighbor 12.14.14.1 remote-as 100 | ||
- | neighbor 12.14.14.1 update-source Loopback0 | ||
- | no auto-summary | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R1#sh ip bgp nei | ||
- | BGP neighbor is 12.14.14.1, remote AS 100, internal link | ||
- | BGP version 4, remote router ID 12.14.14.1 | ||
- | BGP state = Established, up for 00:03:39 | ||
- | </code> | ||
- | |||
- | |||
- | |||
- | <code> | ||
- | R3#sh runn | sec bgp | ||
- | router bgp 200 | ||
- | no synchronization | ||
- | bgp log-neighbor-changes | ||
- | neighbor 89.112.34.4 remote-as 200 | ||
- | no auto-summary | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R4#sh runn | sec bgp | ||
- | router bgp 200 | ||
- | no synchronization | ||
- | bgp log-neighbor-changes | ||
- | neighbor 89.112.34.3 remote-as 200 | ||
- | no auto-summary | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R4#sh ip bgp | ||
- | |||
- | R4# | ||
- | </code> | ||
- | |||
- | </solution> | ||
- | |||
- | |||
- | ** b. (5p) ** Configurați eBGP între R4-R5. Adiacența trebuie realizată direct peste interfețele fizice, fără a folosi interfețe de loopback. | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R5(config)#router bgp 100 | ||
- | R5(config-router)#neigh 89.112.45.4 remote-as 200 | ||
- | </code> | ||
- | |||
- | |||
- | <code> | ||
- | R4(config)#router bgp 200 | ||
- | R4(config-router)#neigh 89.112.45.5 remote-as 100 | ||
- | </code> | ||
- | |||
- | |||
- | </solution> | ||
- | |||
- | ** c. (5p) ** Configurați eBGP între R2 și R3 folosind interfețele de loopback pentru stabilirea adiacenței. Folosirea rutelor statice este permisă pentru acest task. | ||
- | |||
- | <solution -hidden> | ||
- | <code> | ||
- | R2(config)#ip route 13.13.13.0 255.255.255.0 89.112.23.3 | ||
- | R2(config)#router bgp 100 | ||
- | R2(config-router)#neighbor 13.13.13.1 remote-as 200 | ||
- | R2(config-router)#neighbor 13.13.13.1 update-source l0 | ||
- | R2(config-router)#neighbor 13.13.13.1 ebgp-multihop 2 | ||
- | </code> | ||
- | |||
- | |||
- | <code> | ||
- | R3(config)#ip route 12.14.14.0 255.255.255.0 89.112.23.2 | ||
- | R3(config)#router bgp 200 | ||
- | R3(config-router)#neighbor 12.14.14.1 remote-as 100 | ||
- | R3(config-router)#neighbor 12.14.14.1 update-source l0 | ||
- | R3(config-router)#neighbor 12.14.14.1 ebgp-multihop 2 | ||
- | </code> | ||
- | </solution> | ||
- | |||
- | ** d. (5p) ** Introduceți rețeaua lo1 a lui R4 în BGP cu codul de origine “?” | ||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R4(config)#route-map BGP_RED_CONN | ||
- | R4(config-route-map)#match ip address ACL_BGP_CONN | ||
- | R4(config-route-map)#exit | ||
- | R4(config)#ip access-list standard ACL_BGP_CONN | ||
- | R4(config-std-nacl)#permit 14.14.14.0 0.0.0.255 | ||
- | R4(config-std-nacl)#exit | ||
- | R4(config)#router bgp 200 | ||
- | R4(config-router)#redistribute connected route-map BGP_RED_CONN | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R5#sh ip bgp | ||
- | […] | ||
- | Origin codes: i - IGP, e - EGP, ? - incomplete | ||
- | |||
- | Network Next Hop Metric LocPrf Weight Path | ||
- | * i14.14.14.0/24 13.13.13.1 0 100 0 200 ? | ||
- | *> 89.112.45.4 0 0 200 ? | ||
- | </code> | ||
- | </solution> | ||
- | |||
- | ** e. (10p) ** Configurați rețeaua astfel încât R1 să poată da ping din interfața sa de loopback lo0 în interfața lo1 a lui R4. Nu este permisă folosirea rutelor statice. | ||
- | |||
- | |||
- | <solution -hidden> | ||
- | |||
- | <code> | ||
- | R3(config-router)#neighbor 89.112.34.4 next-hop-self | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R2(config)#router bgp 100 | ||
- | R2(config-router)#nei 11.10.1.1 next-hop-self | ||
- | </code> | ||
- | |||
- | <code> | ||
- | R1(config)#router bgp 100 | ||
- | R1(config-router)#net | ||
- | R1(config-router)#network 11.10.1.0 mask 255.255.255.0 | ||
- | </code> | ||
- | |||
- | |||
- | <code> | ||
- | R4#sh ip bgp | ||
- | […] | ||
- | Network Next Hop Metric LocPrf Weight Path | ||
- | *>i11.10.1.0/24 89.112.34.3 0 100 0 100 i | ||
- | *> 14.14.14.0/24 0.0.0.0 0 32768 ? | ||
- | R4#ping 11.10.1.1 source l1 | ||
- | Type escape sequence to abort. | ||
- | Sending 5, 100-byte ICMP Echos to 11.10.1.1, timeout is 2 seconds: | ||
- | Packet sent with a source address of 14.14.14.1 | ||
- | !!!!! | ||
- | Success rate is 100 percent (5/5), round-trip min/avg/max = 56/134/252 ms | ||
- | </code> | ||
- | </solution> |