Maggio 2004 Ultimo
aggiornamento - Aggiornamenti successivi vai a libro routing -
L'esercitazione si basa su un laboratorio con due router Cisco
collegati tra loro
tramite la seriale in back-to-back. Ogni router Cisco ha una sua
ethernet con un suo switch.
Qui ci focalizziamo su uno dei due router essendone il secondo
l'esatto simmetrico.
Ecco la condizione iniziale:
Il router 'remoto' ha una
ethernet 192.168.0.1/24 e una seriale 192.168.40.2/30
Il router 'locale' ha una ethernet 192.168.30.1/24 e una
seriale 192.168.40.1/30
Sia assegnata questa
configurazione:
interface FastEthernet0/0
ip address 192.168.30.1 255.255.255.0
no ip directed-broadcast
duplex auto
speed auto
!
interface Serial0/0
ip address 192.168.40.1 255.255.255.252
no ip directed-broadcast
no ip mroute-cache
!
router rip
network 192.168.30.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 Serial0/0
no ip http
server
locale#
locale#
00:20:48: RIP: sending v1 update to 255.255.255.255 via
FastEthernet0/0 (192.168
.30.1)
00:20:48: RIP: build update entries - suppressing null update
locale#
locale#
come si puo' il comando
network definisce non cosa propagare ma bensi' dove.
Infatti con questa configurazione nulla viene inviato attraverso
la seriale 0/0 al router
remoto. E, importante, gli aggiornamenti RIP non sono accettati
in ingresso dalla
seriale0/0:
00:23:36: RIP: ignored v1 packet from 192.168.40.2 (not enabled
on Serial0/0)
remoto# .
La configurazione si
corregge aggiungendo la newtork della seriale:
router rip
network 192.168.30.0
network 192.168.40.0
subito il rip si attiva.
Notate i "flash update":
00:24:51: RIP: sending request on
FastEthernet0/0 to 255.255.255.255
00:24:51: RIP: sending request on Serial0/0 to 255.255.255.255
00:24:53: RIP: sending v1 flash update to 255.255.255.255 via
FastEthernet0/0 (1
92.168.30.1)
00:24:53: RIP: build flash update entries
00:24:53: network
192.168.40.0 metric 1
00:24:53: RIP: sending v1 flash update to 255.255.255.255 via
Serial0/0 (192.168
.40.1)
00:24:53: RIP: build flash update entries
00:24:53: network
192.168.30.0 metric 1
dopo i 30 secondi
l'intera tabella di routing viene propagata (tranne la default):
00:25:24: RIP: sending v1 update to 255.255.255.255 via
FastEthernet0/0 (192.168
.30.1)
00:25:24: RIP: build update entries
00:25:24: network
192.168.40.0 metric 1
00:25:24: RIP: sending v1 update to 255.255.255.255 via
Serial0/0 (192.168.40.1)
00:25:24: RIP: build update entries
00:25:24: network
192.168.30.0 metric
1
adesso la tabella di
routing e' completa:
locale#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,
B - BGP
D - EIGRP, EX - EIGRP
external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external
type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1,
E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS
level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U -
per-user static route, o - ODR
P - periodic downloaded
static route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
C 192.168.30.0/24 is directly connected,
FastEthernet0/0
192.168.40.0/30 is subnetted, 1 subnets
C 192.168.40.0 is directly
connected, Serial0/0
R 192.168.0.0/24 [120/1] via 192.168.40.2,
00:00:12, Serial0/0
S* 0.0.0.0/0 is directly connected, Serial0/0
locale#
Osserviamo,
dal debug, questa riga:
00:32:44: RIP: sending v1 update to 255.255.255.255 via
FastEthernet0/0 (192.168
.30.1)
se non vogliamo mandare
gli update sulla fasteth0/0, ad esempio perche' non conosciamo
la topologia di questa LAN (o comunque non ci sono nostri router
rip):
router rip
passive-interface FastEthernet0/0
network 192.168.30.0
network 192.168.40.0
adesso:
00:35:18: RIP: received v1 update from 192.168.40.2 on Serial0/0
00:35:18: 192.168.0.0 in 1 hops
00:35:32: RIP: sending v1 update to 255.255.255.255 via
Serial0/0 (192.168.40.1)
00:35:32: RIP: build update entries
00:35:32: network
192.168.30.0 metric 1
Scolleghiamo
l'interfaccia ethernet dal router remoto:
00:37:20: RIP: sending v1 update to 255.255.255.255 via
Serial0/0 (192.168.40.1)
00:37:20: RIP: build update entries
00:37:20: network
192.168.30.0 metric 1
00:37:23: RIP: received v1 update from 192.168.40.2 on Serial0/0
00:37:23: 192.168.0.0 in 16 hops (inaccessible)
00:37:25: RIP: sending v1 flash update to 255.255.255.255 via
Serial0/0 (192.168
.40.1)
00:37:25: RIP: build flash update entries
00:37:25: network
192.168.0.0 metric 16
locale#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,
B - BGP
D - EIGRP, EX - EIGRP
external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external
type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1,
E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS
level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U -
per-user static route, o - ODR
P - periodic downloaded
static route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
C 192.168.30.0/24 is directly connected,
FastEthernet0/0
192.168.40.0/30 is subnetted, 1 subnets
C 192.168.40.0 is directly
connected, Serial0/0
S* 0.0.0.0/0 is directly connected, Serial0/0
locale#sh ip rip database
192.168.0.0/24 is possibly down
192.168.30.0/24 auto-summary
192.168.30.0/24 directly connected,
FastEthernet0/0
192.168.40.0/24 auto-summary
192.168.40.0/30 directly connected,
Serial0/0
Dopo qualche secondo
sparisce dal database. Praticamente subito dalla tabella di
routing.
Il tutto avviene entro pochi secondi, sia come cancellazione che
come ripristino.
Riproviamo ma col "debug ip rip database" stavolta:
locale#sh ip rip database
192.168.0.0/24 is possibly down
192.168.30.0/24 auto-summary
192.168.30.0/24 directly connected,
FastEthernet0/0
192.168.40.0/24 auto-summary
192.168.40.0/30 directly connected, Serial0/0
00:41:03: RIP-DB: garbage collect 192.168.0.0/24
locale#sh ip rip database
192.168.30.0/24 auto-summary
192.168.30.0/24 directly connected,
FastEthernet0/0
192.168.40.0/24 auto-summary
192.168.40.0/30 directly connected,
Serial0/0
Alcuni
dati sul rip che stiamo testando:
locale#sh ip protocol
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 17 seconds
Invalid after 180 seconds, hold down 180, flushed after
240
Outgoing update filter list for all interfaces is
Incoming update filter list for all interfaces is
Redistributing: rip
Default version control: send version 1, receive any
version
Interface Send
Recv Triggered RIP Key-chain
Serial0/0
1 1 2
Automatic network summarization is in effect
Routing for Networks:
192.168.30.0
192.168.40.0
Passive Interface(s):
FastEthernet0/0
Routing Information Sources:
Gateway
Distance Last Update
192.168.40.2
120 00:00:54
Distance: (default is 120)
Simuliamo
un fault sulla rete. Il router remoto non invia piu'
aggiornamenti rip:
locale#
locale#
locale#
locale#
locale#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,
B - BGP
D - EIGRP, EX - EIGRP
external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external
type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1,
E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS
level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U -
per-user static route, o - ODR
P - periodic downloaded
static route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
C 192.168.30.0/24 is directly connected,
FastEthernet0/0
192.168.40.0/30 is subnetted, 1 subnets
C 192.168.40.0 is directly
connected, Serial0/0
R 192.168.0.0/24 [120/1] via 192.168.40.2,
00:00:20, Serial0/0
S* 0.0.0.0/0 is directly connected, Serial0/0
locale#
locale#
locale#sh ip rip database
192.168.0.0/24 auto-summary
192.168.0.0/24
[1] via 192.168.40.2, 00:00:25, Serial0/0
192.168.30.0/24 auto-summary
192.168.30.0/24 directly connected,
FastEthernet0/0
192.168.40.0/24 auto-summary
192.168.40.0/30 directly connected, Serial0/0
locale#
locale#
locale#
01:02:50: RIP:
la route rimane anche
nella tabella di route. Dopo tre minuti (non fase caso
all'imprecisione dei secondi dovuta alle condizioni di test)
scade l'hold-down e parte il poison:
locale#
...snip...
locale#
01:05:41: RIP-DB: flush
route of 192.168.0.0/24 via 192.168.40.2
01:05:41: RIP-DB: Remove 192.168.0.0/24, (metric 4294967295) via
192.168.40.2, S
erial0/0
01:05:41: RIP-DB: hold down 192.168.0.0/24
01:05:41: RIP: sending v1 update to 255.255.255.255 via
Serial0/0 (192.168.40.1)
01:05:41: RIP: build update entries
01:05:41: network
192.168.0.0 metric 16
01:05:41: network
192.168.30.0 metric 1
01:05:43: RIP: sending v1 flash update to 255.255.255.255 via
Serial0/0 (192.168
.40.1)
01:05:43: RIP: build flash update entries
01:05:43: network
192.168.0.0 metric 16
locale#
adesso la route non
verra' piu' usata ma e' nel database RIP nello stato di possibly
down:
locale#
locale#sh ip rip database
192.168.0.0/24 is possibly down
192.168.0.0/24 is possibly down
192.168.30.0/24 auto-summary
192.168.30.0/24 directly connected,
FastEthernet0/0
192.168.40.0/24 auto-summary
192.168.40.0/30 directly connected, Serial0/0
locale#
locale#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,
B - BGP
D - EIGRP, EX - EIGRP
external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external
type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1,
E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS
level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U -
per-user static route, o - ODR
P - periodic downloaded
static route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
C 192.168.30.0/24 is directly connected,
FastEthernet0/0
192.168.40.0/30 is subnetted, 1 subnets
C 192.168.40.0 is directly
connected, Serial0/0
S* 0.0.0.0/0 is directly connected, Serial0/0
01:06:08: RIP-DB: garbage collect 192.168.0.0/24
01:06:08: RIP: sending v1 update to 255.255.255.255 via
Serial0/0 (192.168.40.1)
01:06:08: RIP: build update entries
01:06:08: network
192.168.30.0 metric 1
locale#
locale#
dopo all'incirca altri
60 secondi dai tre minuti (e siamo a 180+60=240) la route viene
rimossa dal database
(non fate caso al tempo qui sopra di 01:06:08 che e'
relativo alla summary):
01:06:34: RIP-DB: garbage collect 192.168.0.0/24
01:06:34: RIP: sending v1 update to 255.255.255.255 via
Serial0/0 (192.168.40.1)
01:06:34: RIP: build update entries
01:06:34: network
192.168.30.0 metric 1
locale#
locale#sh ip rip database
192.168.30.0/24 auto-summary
192.168.30.0/24 directly connected,
FastEthernet0/0
192.168.40.0/24 auto-summary
192.168.40.0/30 directly connected, Serial0/0
locale#sparita
Continuita'
della subnet. Supponiamo che la ethernet del router remoto
diventi 192.168.40.5/30. Vediamo che succede:
locale#
01:21:00: RIP: sending request on Serial0/0 to 255.255.255.255
01:21:00: RIP: received v1 update from 192.168.40.2 on Serial0/0
01:21:00: 192.168.40.4 in 1 hops
01:21:02: RIP: sending v1 flash update to 255.255.255.255 via
Serial0/0 (192.168
.40.1)
01:21:02: RIP: build flash update entries
01:21:02: network
192.168.30.0 metric 1
locale#
01:21:06: RIP: received v1 update from 192.168.40.2 on Serial0/0
01:21:06: 192.168.40.4 in 1 hops
locale#
locale#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,
B - BGP
D - EIGRP, EX - EIGRP
external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external
type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1,
E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS
level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U -
per-user static route, o - ODR
P - periodic downloaded
static route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
C 192.168.30.0/24 is directly connected,
FastEthernet0/0
192.168.40.0/30 is subnetted, 2 subnets
C 192.168.40.0 is directly
connected, Serial0/0
R 192.168.40.4 [120/1] via
192.168.40.2, 00:00:05, Serial0/0
S* 0.0.0.0/0 is directly connected, Serial0/0
locale#sh ip route 192.168.40.5
Routing entry for 192.168.40.4/30
Known via "rip", distance 120, metric 1
Redistributing via rip
Last update from 192.168.40.2 on Serial0/0, 00:00:10 ago
Routing Descriptor Blocks:
* 192.168.40.2, from 192.168.40.2, 00:00:10 ago, via
Serial0/0
Route metric is 1, traffic share
count is 1
locale#sh ip rip database
192.168.30.0/24 auto-summary
192.168.30.0/24 directly connected,
FastEthernet0/0
192.168.40.0/24 auto-summary
192.168.40.0/30 directly connected, Serial0/0
192.168.40.4/30
[1] via 192.168.40.2, 00:00:08,
Serial0/0
mettiamo ora nel router
remoto 192.168.50.1/25 e vediamo cosa succede:
locale#sh ip route 192.168.50.1
Routing entry for 192.168.50.0/24
Known via "rip", distance 120, metric 1
Redistributing via rip
Last update from 192.168.40.2 on Serial0/0, 00:00:08 ago
Routing Descriptor Blocks:
* 192.168.40.2, from 192.168.40.2, 00:00:08 ago, via
Serial0/0
Route metric is 1, traffic share
count is 1
locale#sh ip rip database
192.168.30.0/24 auto-summary
192.168.30.0/24 directly connected,
FastEthernet0/0
192.168.40.0/24 auto-summary
192.168.40.0/30 directly connected, Serial0/0
192.168.50.0/24 auto-summary
192.168.50.0/24
[1] via 192.168.40.2, 00:00:11, Serial0/0
locale#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,
B - BGP
D - EIGRP, EX - EIGRP
external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external
type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1,
E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS
level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U -
per-user static route, o - ODR
P - periodic downloaded
static route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
C 192.168.30.0/24 is directly connected,
FastEthernet0/0
192.168.40.0/30 is subnetted, 1 subnets
C 192.168.40.0 is directly
connected, Serial0/0
R 192.168.50.0/24 [120/1] via 192.168.40.2,
00:00:14, Serial0/0
S* 0.0.0.0/0 is directly connected,
Serial0/0
notate che mentre nel primo esempio la netmask e' stata
propagata nel secondo no e questo perche' nel secondo esempio
viene meno la continuita' della subnet
Attiviamo ora ripv2
sulla configurazione di sopra (quella col 192.168.50.1/25):
01:32:45: RIP: sending request on Serial0/0 to 224.0.0.9
01:32:45: RIP: received v2 update from 192.168.40.2 on Serial0/0
01:32:45: 192.168.50.0/25 via
0.0.0.0 in 1 hops
01:32:46: RIP: received v2 update from 192.168.40.2 on Serial0/0
01:32:46: 192.168.50.0/25 via
0.0.0.0 in 1 hops
01:32:47: RIP: sending v2 flash update to 224.0.0.9 via
Serial0/0 (192.168.40.1)
01:32:47: RIP: build flash update entries
01:32:47: 192.168.30.0/24
via 0.0.0.0, metric 1, tag 0
locale#
01:32:52: RIP: sending v2 update to 224.0.0.9 via Serial0/0
(192.168.40.1)
01:32:52: RIP: build update entries
01:32:52: 192.168.30.0/24
via 0.0.0.0, metric 1, tag 0
locale#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,
B - BGP
D - EIGRP, EX - EIGRP
external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external
type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1,
E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS
level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U -
per-user static route, o - ODR
P - periodic downloaded
static route
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
C 192.168.30.0/24 is directly connected,
FastEthernet0/0
192.168.40.0/30 is subnetted, 1 subnets
C 192.168.40.0 is directly
connected, Serial0/0
192.168.50.0/25 is subnetted, 1 subnets
R 192.168.50.0 [120/1] via
192.168.40.2, 00:00:15, Serial0/0
S* 0.0.0.0/0 is directly connected, Serial0/0
locale#sh ip rip database
192.168.30.0/24 auto-summary
192.168.30.0/24 directly connected,
FastEthernet0/0
192.168.40.0/24 auto-summary
192.168.40.0/30 directly connected, Serial0/0
192.168.50.0/24 auto-summary
192.168.50.0/25
[1] via 192.168.40.2, 00:00:01,
Serial0/0
attenzione: per default
e' attivo l'auto-summary. Mettere "no auto-summary"
per vedere la propagazione della /25
Ed ecco
un riepilogo di quanto messo a disposizione da ripv2:
remoto(config)#router rip
remoto(config-router)#?
Router configuration commands:
address-family
Enter Address Family command mode
auto-summary
Enable automatic network number summarization
default
Set a command to its defaults
default-information Control
distribution of default information
default-metric
Set metric of redistributed routes
distance
Define an administrative distance
distribute-list
Filter networks in routing updates
exit
Exit from routing protocol configuration mode
flash-update-threshold Specify flash update
threshold in second
help
Description of the interactive help system
maximum-paths
Forward packets over multiple paths
neighbor
Specify a neighbor router
network
Enable routing on an IP network
no
Negate a command or set its defaults
offset-list
Add or subtract offset from IGRP or RIP metrics
output-delay
Interpacket delay for RIP updates
passive-interface
Suppress routing updates on an interface
redistribute
Redistribute information from another routing
protocol
timers
Adjust routing timers
traffic-share
How to compute traffic share over alternate paths
validate-update-source Perform sanity checks
against source address of
routing updates
version
Set routing protocol version
- ultima revisione Maggio 2004
Altre
letture
Vedi
anche questo esempio
Consiglio di consultare l’enorme documentazione
disponibile on-line nel sito della cisco http://www.cisco.com/
. E’ possibile trovare sempre tutto cio’ che si
cerca.
|