Cele:
Adresy IP routerów:
R1
Interfejs |
IP |
FastEthernet 0/0 |
172.16.12.1/24 |
Loopback 0 |
1.1.1.1/24 |
R2
Interfejs |
IP |
FastEthernet 0/0 |
172.16.12.2/24 |
FastEthernet 1/0 |
172.16.23.2/24 |
Loopback 0 |
2.2.2.2/24 |
R3
Interfejs |
IP |
FastEthernet 0/0 |
172.16.23.3/24 |
Loopback 0 |
3.3.3.3/24 |
Schemat sieci:

Router: 3640
IOS: c3640-jk9o3s-mz.124-16a.bin
Rozwiązanie
Skonfiguruj RIP version 2 na wszystkich routerach. Upewnij się, że możesz pingować interfejsy Loopback0 z wszystkich routerów.
Włączymy obsługę RIPv2 na wszystkich routerach oraz rozgłosimy podłączone podsieci:
R1(config-router)#version 2 |
R1(config-router)#network 1.0.0.0 |
R1(config-router)#network 172.16.12.0 |
R2(config-router)#version 2 |
R2(config-router)#network 2.0.0.0 |
R2(config-router)#network 172.16.12.0 |
R2(config-router)#network 172.16.23.0 |
R3(config-router)#version 2 |
R3(config-router)#network 3.0.0.0 |
R3(config-router)#network 172.16.23.0 |
Sprawdzimy tablice routingu dla R1
R1#show ip route | begin Gateway |
Gateway of last resort is not set |
1.0.0.0/24 is subnetted, 1 subnets |
C 1.1.1.0 is directly connected, Loopback0 |
R 2.0.0.0/8 [120/1] via 172.16.12.2, 00:00:15, FastEthernet0/0 |
R 3.0.0.0/8 [120/1] via 172.16.12.2, 00:00:15, FastEthernet0/0 |
172.16.0.0/24 is subnetted, 2 subnets |
R 172.16.23.0 [120/1] via 172.16.12.2, 00:00:15, FastEthernet0/0 |
C 172.16.12.0 is directly connected, FastEthernet0/0 |
Router nauczył się sieci 2.0.0.0/8, 3.0.0.0/8 oraz 172.16.23.0 przez protokół RIP (litera R po lewej stronie). Upewnijmy się, że mamy łączność, pingując interfejsy Loopback 0 routera R2 oraz R3
R1#ping 2.2.2.2 source loopback 0 |
Type escape sequence to abort. |
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds: |
Packet sent with a source address of 1.1.1.1 |
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/16/20 ms |
R1#ping 3.3.3.3 source loopback 0 |
Type escape sequence to abort. |
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds: |
Packet sent with a source address of 1.1.1.1 |
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/39/44 ms |
Utwórz interfejs Loopback1 na R3 z adresem 1.1.3.3/24 oraz dodaj go do RIP. Dlaczego nie możesz go pingować z R1/R2?
R3(config)#interface loopback 1 |
R3(config-if)#ip add 1.1.3.3 255.255.255.0 |
R3(config-router)#network 1.1.3.0 |
Zobaczmy tablice routingu dla R2
Gateway of last resort is not set |
R 1.0.0.0/8 [120/1] via 172.16.23.3, 00:00:03, FastEthernet1/0 |
[120/1] via 172.16.12.1, 00:00:07, FastEthernet0/0 |
2.0.0.0/24 is subnetted, 1 subnets |
C 2.2.2.0 is directly connected, Loopback0 |
R 3.0.0.0/8 [120/1] via 172.16.23.3, 00:00:03, FastEthernet1/0 |
172.16.0.0/24 is subnetted, 2 subnets |
C 172.16.23.0 is directly connected, FastEthernet1/0 |
C 172.16.12.0 is directly connected, FastEthernet0/0 |
Jak widzimy R2 ma tylko jeden wpis dotyczący podsieci 1.0.0.0/8, prowadzący albo przez R1 albo przez R3.
Type escape sequence to abort. |
Sending 5, 100-byte ICMP Echos to 1.1.3.3, timeout is 2 seconds: |
Próbując pingować adres 1.1.3.3 zwracany jest komunikat, że adres ten jest niedostępny (unreachable). Powodem tego jest to, że RIP domyślnie aktywuje sumaryzację tras, dlatego pomimo tego, że skonfigurowaliśmy podsieć 1.1.3.0/24, będzie ona rozgłaszana jako 1.0.0.0/8. Poprawimy to dodając wpis no auto-summary do konfiguracji RIP na wszystkich routerach:
R1(config-router)#no auto-summary |
R2(config-router)#no auto-summary |
R3(config-router)#no auto-summary |
Po odświeżeniu, tablica routingu na R2 wygląda tak:
1.0.0.0/24 is subnetted, 2 subnets |
R 1.1.1.0 [120/1] via 172.16.12.1, 00:00:07, FastEthernet0/0 |
R 1.1.3.0 [120/1] via 172.16.23.3, 00:00:09, FastEthernet1/0 |
3.0.0.0/24 is subnetted, 1 subnets |
R 3.3.3.0 [120/1] via 172.16.23.3, 00:00:09, FastEthernet1/0 |
Mamy teraz 2 osobne wpisy dla sieci 1.1.1.0/24 (router R1) oraz 1.1.3.0/24 (router R2). Ping z R2:
Type escape sequence to abort. |
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds: |
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/19/24 ms |
Type escape sequence to abort. |
Sending 5, 100-byte ICMP Echos to 1.1.3.3, timeout is 2 seconds: |
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/28 ms |
R1 – nie wysyłaj aktualizacji RIP na interfejsie Loopback 0.
Po włączeniu trybu debug dla RIP, zobaczymy komunikat RIP: ignored v2 packet from 1.1.1.1 (sourced from one of our addresses)
RIP protocol debugging is on |
*Mar 1 01:24:30.471: RIP: sending v2 update to 224.0.0.9 via Loopback0 (1.1.1.1) |
*Mar 1 01:24:30.471: RIP: build update entries |
*Mar 1 01:24:30.471: 1.1.3.0/24 via 0.0.0.0, metric 3, tag 0 |
*Mar 1 01:24:30.471: 2.2.2.0/24 via 0.0.0.0, metric 2, tag 0 |
*Mar 1 01:24:30.475: 3.3.3.0/24 via 0.0.0.0, metric 3, tag 0 |
*Mar 1 01:24:30.475: 172.16.12.0/24 via 0.0.0.0, metric 1, tag 0 |
*Mar 1 01:24:30.475: 172.16.23.0/24 via 0.0.0.0, metric 2, tag 0 |
*Mar 1 01:24:30.483: RIP: ignored v2 packet from 1.1.1.1 (sourced from one of our addresses) |
*Mar 1 01:24:35.575: RIP: received v2 update from 172.16.12.2 on FastEthernet0/0 |
*Mar 1 01:24:35.575: 1.1.3.0/24 via 0.0.0.0 in 2 hops |
*Mar 1 01:24:35.575: 2.2.2.0/24 via 0.0.0.0 in 1 hops |
*Mar 1 01:24:35.575: 3.3.3.0/24 via 0.0.0.0 in 2 hops |
*Mar 1 01:24:35.579: 172.16.23.0/24 via 0.0.0.0 in 1 hops |
W celu wyłączenia wiadosci o zmianach w RIP na interfejsie Loopback 0, wpisujemy:
R1(config-router)#passive-interface l0 |
Wysyłaj aktualizację RIP co 5 sekund.
Domyślnie pakiety RIP-update są wysyłane co 30 sekund:
Routing Protocol is "rip" |
Sending updates every 30 seconds, next due in 21 seconds |
Włączymy debuggowanie zdarzeń RIP na routerze R3:
RIP event debugging is on |
*Mar 1 18:41:38.383: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.23.3) |
*Mar 1 18:41:38.383: RIP: Update contains 2 routes |
*Mar 1 18:41:38.383: RIP: Update queued |
*Mar 1 18:41:38.387: RIP: Update sent via FastEthernet0/0 |
*Mar 1 18:42:02.439: RIP: received v2 update from 172.16.23.2 on FastEthernet0/0 |
*Mar 1 18:42:02.439: RIP: Update contains 3 routes |
*Mar 1 18:42:07.607: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.23.3) |
*Mar 1 18:42:07.607: RIP: Update contains 2 routes |
*Mar 1 18:42:07.607: RIP: Update queued |
*Mar 1 18:42:07.611: RIP: Update sent via FastEthernet0/0 |
Jak widać powyżej router R3 wysyła informacje o zmianach do routera R2 (172.16.23.3) co 30 sekund. Zmiany dokonujemy w trybie konfiguracji interfejsu FastEthernet 0/0:
R3(config)#interface fastEthernet 0/0 |
R3(config-if)#ip rip advertise 5 |
Możemy też dokonać tej zmiany globalnie w konfiguracji RIP:
R3(config-router)#timers basic 5 180 180 240 |
Routing Protocol is "rip" |
Sending updates every 5 seconds, next due in 3 seconds |
Invalid after 180 seconds, hold down 180, flushed after 240 |
Polecenie timers basic
jako pierwszy argument ustawia czas pomiędzy kolejnymi aktualizacjami (Interval between updates), następnie licznik Invalid, Holddown oraz Flush. W tym przypadku zmieniliśmy tylko pierwszą wartość z 30 na 5 sekund. Zmianę potwierdzamy poleceniem show ip protocols
(Sending updates every 5 seconds). Poniżej debug ip rip events
:
*Mar 1 18:45:40.635: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.23.3) |
*Mar 1 18:45:40.635: RIP: Update contains 2 routes |
*Mar 1 18:45:40.635: RIP: Update queued |
*Mar 1 18:45:40.639: RIP: Update sent via FastEthernet0/0 |
*Mar 1 18:45:45.023: RIP: received v2 update from 172.16.23.2 on FastEthernet0/0 |
*Mar 1 18:45:45.023: RIP: Update contains 3 routes |
*Mar 1 18:45:45.099: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.23.3) |
*Mar 1 18:45:45.099: RIP: Update contains 2 routes |
*Mar 1 18:45:45.099: RIP: Update queued |
*Mar 1 18:45:45.103: RIP: Update sent via FastEthernet0/0 |
0 Komentarze.