Sei sulla pagina 1di 22

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

LEZIONE 4 ROUTING BASE


ESERCIZIO N. 4.1- ROUTING STATICO

DESCRIZIONE:
Si vuole far pingare i due PC , rappresentati nello schema, attraverso due router Cisco 2620 fra loro collegati attraverso un link seriale basato su leased line (linea dedicata di tipo T1/E1). PC 1: Indirizzo IP 192.168.100.2 /24 - default gateway 192.168.100.1. PC 2: Indirizzo IP 192.168.200.2 /24 - default gateway 192.168.200.1. Router 1 Serie 2600 modello 2620 Interfaccia FastEthernet 0/0 - IP address : 192.168.100.1 /24 Interfaccia Serial 0/0 - IP address: 192.168.1.1 /24. Router 2 Serie 2600 modello 2620 Interfaccia FastEthernet 0/0 - IP address of 192.168.200.1 /24 Interfaccia Serial 0/0 - IP address 192.168.1.2 /24. Abbiamo un collegamento seriale tra il Router1 e Router 2. Il link seriale deve avere velocit di 64K. Configurare gli apparati dando gli hostname e impostando le rotte statiche , assicurandosi la raggiungibilit di ogni apparato tramite il ping. 1

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

SOLUZIONE:
Si configurano gli ip e i default gateway dei PC come visto nelle lezioni precedenti.

CONFIGURIAMO IL ROUTER R1:


Configuriamo lhostname
Router>enable Router#configure terminal Enter configuration commands, one per line. Router(config)#hostname R1 R1(config)#exit R1#

End with CNTL/Z.

Guardiamo che interfacce ha il nostro router


R1#show interface FastEthernet0/0 is administratively down, line protocol is down Hardware is SteveK, address is E5B0.C000.1005 No Internet address MTU 1500 bytes, BW 100000 Kbit, DLY 2000 usec, rely 255/255, load 1/255 Encapsulation ARPA, loopback not set, keepalive set (10 sec) ARP type: ARPA, ARP timeout 00.05.00 ..blah blah blah - look at a real device... -- all sorts of stats such as packet rate, bad packets, broadcast packet count, late collision count, runts (pkt too small), giants (pkt too big) etc... FastEthernet0/1 is administratively down, line protocol is down Hardware is SteveK, address is 1C17.C000.1006 No Internet address MTU 1500 bytes, BW 100000 Kbit, DLY 2000 usec, rely 255/255, load 1/255 Encapsulation ARPA, loopback not set, keepalive set (10 sec) ARP type: ARPA, ARP timeout 00.05.00 ..blah blah blah - look at a real device... -- all sorts of stats such as packet rate, bad packets, broadcast packet count, late collision count, runts (pkt too small), giants (pkt too big) etc... Serial0/0 is administratively down, line protocol is down Hardware is HD64570 No Internet address MTU 1500 bytes, BW 100000 Kbit, DLY 2000 usec, rely 255/255, load 1/255 Encapsulation HDLC, loopback not set, keepalive set (10 sec) ...blah blah blah - stats & settings - blah ... Serial0/1 is administratively down, line protocol is down Hardware is HD64570 No Internet address MTU 1500 bytes, BW 100000 Kbit, DLY 2000 usec, rely 255/255, load 1/255 Encapsulation HDLC, loopback not set, keepalive set (10 sec) ...blah blah blah - stats & settings - blah ...

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

Serial0/2 is administratively down, line protocol is down Hardware is HD64570 No Internet address MTU 1500 bytes, BW 100000 Kbit, DLY 2000 usec, rely 255/255, load 1/255 Encapsulation HDLC, loopback not set, keepalive set (10 sec) ...blah blah blah - stats & settings - blah ...

Configuriamo linterfaccia F0/0


R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#interface F0/0 R1(config-if)#ip address 192.168.100.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)# %LDXX - Line protocol on Interface FastEthernet0/0, changed state to up R1(config-if)#exit

Configuriamo linterfaccia S0/0 Per un approfondimento delle modalit di configurazione del link seriale si rimanda al documento in inglese, riportato in allegato dal link http://www.jlsnet.co.uk/index.php?page=cc_wan, che spiega in modo chiaro le varie tipologie di connessione e configurazione. Si rammenta che ogni interfaccia seriale del router viene denominata DTE (data terminal equipment); questa viene collegata, tramite un cavo di tipo DTE/DCE (ve ne sono di diversi tipi come si pu vedere nel documento allegato; in Italia il pi utilizzato il cavo denominato V.35) ad un dispositivo, di solito fornito da ISP, denominato DCE (data communications equipment). Il DCE pu essere: 1) un modem analogico nel caso che la connettivit fornita da ISP si basi su linee che utilizzano un segnale di tipo analogico 2) un dispositivo CSU/CDU (ossia un terminal adapter digitale) nel caso di linee di comunicazione basate su segnale digitale

DCE fornito da ISP 1) modem analogico 2) CSU/CDU digitale

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

Il DCE ha il compito di ricevere il segnale digitale trasmesso da DTE (ossia dall'interfaccia seriale del router) e di trasformarlo in un segnale (analogico o digitale) che possa essere veicolato sulla linea di comunicazione fornita da ISP. Quando, in laboratorio, si voglia testare il funzionamento di una comunicazione basata su link seriale si pu, per semplicit, sostituire i due CSU/DSU e la relativa linea di interconnessione, con un apposito cavo incrociato DTE/DCE (DTE/DCE crossover cable). Le due estremit di questo cavo vengono denominate rispettivamente DTE e DCE.

crossover DTE/DCE cable

Quando si usa questo particolare tipo di cavo, l'interfaccia del router al quale collegato l'estremit di tipo DCE deve fornire il clock; quest'ultimo non deve essere assegnato per l'altra interfaccia del router collegata all'estremit di tipo DTE. Con questo semplice accorgimento (paragonabile al cavo null modem utilizzato per collegare in modo diretto le porte seriali di due PC), pu essere facilmente simulata in laboratorio una WAN di qualsiasi tipo.

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

Guardo se DCE o DTE Lo scopo del comando capire se all'interfaccia seriale del router R1 stata collegata l'estremit di tipo DTE o DCE (nota: in Netsimk, il crossover cable DTE/DCE chiamato wan serial)
R1#show controllers S0/0 <Blah blah blah for a few lines> buffer size 1524 HD unit -1, V.35 DCE cable, no clock <Blah blah blah for LOTS more lines... ...This information is specific to the chipset in the interface and includes a lot of incomprehensible gobbledy gook... But it DOES have statistical counts such as: - buffer over/under runs, - memory errors, - encapsulation errors, - etc. which is useful for indicating a congested or error-prone line.

E DCE quindi devo impostare il Clock su questa interfaccia (infatti si gi visto che il clock, nel link seriale simulato da DTE/DCE crossover cable, va impostato solo per l'interfaccia seriale alla quale collegata l'estremit di tipo DCE).
R1(config)#interface S0/0 R1(config-if)#ip address 192.168.1.1 255.255.255.0 R1(config-if)#clock rate 64000 R1(config-if)#no shutdown R1(config-if)#exit R1(config)#

CONFIGURIAMO IL ROUTER R2:


Configuriamo lhostname
Router>enable Router#configure terminal Enter configuration commands, one per line. Router(config)#hostname R2 R2(config)#exit

End with CNTL/Z.

Configuriamo linterfaccia F0/0


R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#interface F0/0 R2(config-if)#ip address 192.168.200.1 255.255.255.0

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

R2(config-if)#no shutdown R2(config-if)# %LDXX - Line protocol on Interface FastEthernet0/0, changed state to up R2(config-if)#exit

Configuriamo linterfaccia S0/0


R2(config)#interface S0/0 R2(config-if)#ip address 192.168.1.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#exit %LDXX - Line protocol on Interface Serial0/0, changed state to up

Testiamo ora se il Router 2 riesce a raggiungere il Router 1


R2(config)#exit R2#ping 192.168.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 192.168.1.1. Timeout is 2 seconds: !!!!! Success rate is 100% (5/5), round trip min/avg/max = 9/10/12 ms

Testiamo ora se il Router 2 riesce a raggiungere il PC 1


R2#ping 192.168.100.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 192.168.100.2. Timeout is 2 seconds: ..... Success rate is 0% (0/5), round trip min/avg/max = 0/0/0 ms R2#

Come si pu vedere, non riusciamo a raggiungere il PC1, dato che non definita nel router R2 alcuna rotta verso la rete avente net-id 192.168.100.0 Definiamo quindi due rotte statiche, una sul Router 1 e una sul Router 2 Definiamo la prima rotta statica sul Router 2
R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#ip route 192.168.100.0 255.255.255.0 192.168.1.1

Praticamente stiamo dicendo al Router 2 che tutti i pacchetti con destinazione di rete 192.168.100.0 / 24 vanno spediti al Router 1 che ha indirizzo 192.168.1.1 Analogamente definiamo anche una rotta statica sul Router 1 6

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ip route 192.168.200.0 255.255.255.0 192.168.1.2

Anche al Router 1 diciamo che tutti i pacchetti con destinazione di rete 192.168.200.0 / 24 vanno spediti al Router 2 che ha indirizzo 192.168.1.2 Proviamo ora a Pingare il PC 2
R1(config)#exit R1#ping 192.168.200.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 192.168.200.2. Timeout is 2 seconds: !!!!! Success rate is 100% (5/5), round trip min/avg/max = 18/18/23

Torniamo sul Router 2 e proviamo a pingare il PC 1


R2(config)#exit R2#ping 192.168.100.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 192.168.100.2. Timeout is 2 seconds: !!!!! Success rate is 100% (5/5), round trip min/avg/max = 16/17/23 ms

Andiamo sul PC 1 e proviamo a pingare il PC 2


C:>ping 192.168.200.2 Pinging 192.168.200.2 with 32 bytes of data: Reply Reply Reply Reply from from from from 192.168.200.2 192.168.200.2 192.168.200.2 192.168.200.2 on on on on Eth, Eth, Eth, Eth, time<10ms time<10ms time<10ms time<10ms TTL=126 TTL=126 TTL=126 TTL=126

Proviamo ora a fare un traceroute dal PC1 al PC2


C:>tracert 192.168.200.2 Tracing route to 192.168.200.2 1 4ms - 6ms 192.168.100.1 2 8ms 12ms 9ms 192.168.1.2 3 14ms 12ms 17ms 192.168.200.2 Destination trace successful.

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

Vediamo che il nostro pacchetto prima raggiunge linterfaccia Eth0 del Router 1 ( 192.168.100.1), poi arriva allinterfaccia Serial 0 del Router 2 (192.168.1.2) e infine arriva al PC2 (192.168.200.2)

MONITORAGGIO ROUTER Per vedere le tabelle di routing si utilizza il comando show ip route Andiamo ad interrogare il Router 1
R1#show 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, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set C C S 192.168.1.0/24 is directly connected to Serial0/0 192.168.100.0/24 is directly connected to FastEthernet0/0 192.168.200.0/24 [1/0] via 192.168.1.2 00.00.10 S0/0

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

Andiamo ad interrogare il Router 2


R2#show 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, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set C S C 192.168.1.0/24 is directly connected to Serial0/0 192.168.100.0/24 [1/0] via 192.168.1.1 00.00.37 S0/0 192.168.200.0/24 is directly connected to FastEthernet0/0

Per vedere leARP table si utilizza il comando show ip arp


R2#show arp Protocol Address Internet 192.168.200.2 Internet 192.168.200.1 Internet 0.0.0.0 Age (min) 3 Hardware Addr 5AF3.3300.1003 E4E0.8500.1005 28ED.8500.1006 Type ARPA ARPA ARPA Interface FastEthernet0/0 FastEthernet0/0 FastEthernet0/1

Per vedere il modello di Router e altre informazioni si utilizza il comando show version
R2#show version Cisco Internetwork Operating System Software IOS (tm) C2600 Software (C2600-D-M), Version 12.2(16), RELEASE SOFTWARE (fc3) Copyright (c) 1986-2008 by cisco Systems, Inc. >>LITTLE OF THE FOLLOWING IS RELEVANT - JUST FOR LOOKS<< Compiled Wed 04-Mar-8 04:44 by Someone Image text-base: 0x02005000, data-base: 0x0246B4A4 ROM: System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1) R2 uptime is 23 minutes System restarted by power-on System image file is "flash:c2600-d-mz.122-16.bin", booted via flash cisco 2620 (MPC860) processor (revision 0x200) with 29696K/3072K bytes of memory. Processor board ID 07708054, with hardware revision 00000000 Bridging software. X.25 software, Version 2.0, NET2, BFE and GOSIP compliant. 2 FastEthernet/IEEE 802.3 interface(s) 3 serial(sync/async) network interface(s) System/IO memory with parity disabled 8192K bytes of DRAM onboard 2048K bytes of DRAM on SIMM System running from RAM 32K bytes of non-volatile configuration memory. 8192K bytes of processor board System flash (Read/Write) Configuration register is 0x2102

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

DEFINIZIONE ROTTE DI DEFAULT

Si utilizzano per dire ai router che i pacchetti per qualsiasi destinazione vanno inviati allindirizzo specificato. Impostiamo quindi sul router R1 questa rotta di default:
R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2

E sul sul router R2 questa rotta di default:


R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z.Router2(config)# R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.1

Andiamo a vedere le tabelle di routing


R2#show 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, * - candidate default U - per-user static route, o - ODR Gateway of last resort is 192.168.1.1 to network 0.0.0.0 C S C S* 192.168.1.0/24 is directly connected to Serial0/0 192.168.100.0/24 [1/0] via 192.168.1.1 00.00.50 S0/0 192.168.200.0/24 is directly connected to FastEthernet0/0 0.0.0.0/0 [1/0] via 192.168.1.1 00.00.50 S0/0

Provare infine a definire il link seriale fra i due router usando un netmask di tipo 255.255.255.252.

10

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

ESERCIZIO N. 4.2 - ROUTING STATICO 2

DESCRIZIONE:
Router R1 Serie 2600 modello 2620 (Serial 0 DCE) Router R2 Serie 2600 modello 2620 Router R3 Serie 2600 modello 2620 (Serial 0 DTE) Il link seriale deve avere velocit di 64K Configurare gli apparati dando gli hostname e configurando le rotte statiche assicurandosi la raggiungibilit di ogni apparato tramite il ping e traceroute.

11

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

SOLUZIONE:

CONFIGURIAMO IL ROUTER R1:


Configuriamo lhostname
Router>enable Router#configure terminal Enter configuration commands, one per line. Router(config)#hostname R1

End with CNTL/Z.

Configuriamo linterfaccia F0/0


R1(config)#interface F0/0 R1(config-if)#ip address 10.1.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#exit

Configuriamo linterfaccia Seriale S0/0


R1(config)#interface S0/0 R1(config-if)#ip address 12.5.10.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)# exit %LDXX - Interface Serial0/0, changed state to downR1(config)#

Controlliamo se la nostra interfaccia seriale DTE o DCE


R1(config)#exit R1#show controllers S0/0 <Blah blah blah for a few lines> buffer size 1524 HD unit -1, V.35 DCE cable, no clock <Blah blah blah for LOTS more lines... ...This information is specific to the chipset in the interface and includes a lot of incomprehensible gobbledy gook... But it DOES have statistical counts such as: - buffer over/under runs, - memory errors, - encapsulation errors, - etc. which is useful for indicating a congested or error-prone line.

12

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

Vediamo che la nostra interfaccia seriale DCE, quindi dobbiamo impostare la frequenza di clock su questa interfaccia.
R1#configure terminal Enter configuration commands, one per line. R1(config)#interface S0/0 R1(config-if)#clock rate 64000 R1(config-if)#exit R1(config)# End with CNTL/Z.

CONFIGURIAMO IL ROUTER R2:


Configuriamo lhostname
Router>enable Router#configure terminal Enter configuration commands, one per line. Router(config)#hostname R2

End with CNTL/Z.

Configuriamo linterfaccia F0/0


R2(config)#interface F0/0 R2(config-if)#ip address 10.1.1.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)# %LDXX - Line protocol on Interface FastEthernet0/0, changed state to up R2(config-if)#exit R2(config)#

Testiamo ora se il Router R2 riesce a raggiungere il Router R1


R2(config)#exit R2#ping 10.1.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 10.1.1.1. Timeout is 2 seconds: !!!!! Success rate is 100% (5/5), round trip min/avg/max = 8/9/10 ms

CONFIGURIAMO IL ROUTER R3:


Configuriamo lhostname
Router>enable Router#configure terminal Enter configuration commands, one per line. Router(config)#hostname R3

End with CNTL/Z.

13

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

Configuriamo linterfaccia Serial 0


R3(config)#interface S0/0 R3(config-if)#ip address 12.5.10.2 255.255.255.0 R3(config-if)#no shutdown R3(config-if)# %LDXX - Line protocol on Interface Serial0/0, changed state to up R3(config-if)#exit

Controlliamo se la nostra interfaccia seriale DTE o DCE


R3(config)#exit R3#show controllers S0/0 <Blah blah blah for a few lines> buffer size 1524 HD unit -1, V.35 DTE cable <Blah blah blah for LOTS more lines... ...This information is specific to the chipset in the interface and includes a lot of incomprehensible gobbledy gook... But it DOES have statistical counts such as: - buffer over/under runs, - memory errors, - encapsulation errors, - etc. which is useful for indicating a congested or error-prone line.

Vediamo che la nostra interfaccia seriale DTE, quindi il clock sar dato dallinterfaccia allaltro lato del cavo. Testiamo ora se il Router R3 riesce a raggiungere il Router R1
R3#ping 12.5.10.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 12.5.10.1. Timeout is 2 seconds: !!!!! Success rate is 100% (5/5), round trip min/avg/max = 9/10/11 ms R3#

Per vedere gli indirizzi IP assegnati alle interface del router utilizziamo il seguente comando:
R3#show ip interface brief Any interface listed with OK? value "NO" does not have a valid configuration Interface IP-Address OK? Method Status Protocol FastEthernet0/0 unassigned YES unset administratively down down FastEthernet0/1 unassigned YES unset administratively down down Serial0/0 12.5.10.2 YES manual up up Serial0/1 unassigned YES unset administratively down down Serial0/2 unassigned YES unset administratively down down

14

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

Per riuscire ora a raggiungere, da R3, il router R2 (rete 10.1.1.0/24), dobbiamo andare ad impostare la tabella di routing sul router R3, che, al momento, solo in grado di instradare i pacchetti verso il router R1 ossia verso la sottorete 12.5.10.0/24. E utile evidenziare al riguardo che, in questo esempio, solo il router R1 vede entrambe le sottoreti 10.1.1.0/24 e 12.5.10.0/24, senza alcuna necessit di configurazione: esse sono entrambe direttamente collegate. Invece nei router R2 ed R3 occorre modificare manualmente le tabelle di routing in modo che essi siano in grado di gestire linoltro dei pacchetti anche verso le sottoreti non direttamente collegate. Aggiungiamo quindi alla tabella di routing di R3 la destinazione 10.1.1.0/24 raggiungibile attraverso il router R1 che ha indirizzo 12.5.10.1.
R3#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R3(config)#ip route 10.1.1.0 255.255.255.0 12.5.10.1

Per vedere la tabella di routing di R3 si utilizza il comando show ip route; la rotta statica, ossia aggiunta manualmente, contrassegnata con la lettera S.
R3(config)#exit R3#show 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, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set S C 10.1.1.0/24 [1/0] via 12.5.10.1 00.00.34 S0/0 12.5.10.0/24 is directly connected to Serial0/0

In tal modo sicuramente i pacchetti spediti da R3 possono arrivare ad R2. Occorre per anche gestire il percorso di ritorno dei pacchetti di risposta da R2 ad R3 e quindi intervenire sulla tabella di routing di R2 per consentire il corretto instradamento dei pacchetti destinati alla rete 12.5.10.0/24. Perci andiamo sul Router R2 e diciamo che tutti i pacchetti con destinazione di rete 12.5.10.0 / 24 vanno spediti al Router R3 che ha indirizzo 10.1.1.1
R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#ip route 12.5.10.0 255.255.255.0 10.1.1.1 R2(config)#exit

15

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

Per vedere la tabella di routing si utilizza il comando show ip route, le rotte statiche sono contrassegnate con la lettera S.
R2#show 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, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set C S 10.1.1.0/24 is directly connected to FastEthernet0/0 12.5.10.0/24 [1/0] via 10.1.1.1 00.00.25 F0/0

Proviamo ora a Pingare il Router R3 da R2.


R2#ping 12.5.10.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 12.5.10.2. Timeout is 2 seconds: !!!!! Success rate is 100% (5/5), round trip min/avg/max = 16/18/20 ms

Torniamo sul router R3 e proviamo a pingare il router R2


R3#ping 10.1.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 10.1.1.2. Timeout is 2 seconds: !!!!! Success rate is 100% (5/5), round trip min/avg/max = 21/21/24 ms

Proviamo ora a fare un traceroute dal router R3 al router R2


R3#traceroute 10.1.1.2 Type escape sequence to abort. Tracing the route to (10.1.1.2) 1 (12.5.10.1) 12 msec 11 msec 8 msec 2 (10.1.1.2) 18 msec 19 msec * Destination trace successful.

Vediamo che il nostro pacchetto prima raggiunge linterfaccia Serial 0 del Router 1 ( 12.5.10.1), poi arriva allinterfaccia F0/0 del Router 2 (10.1.1.2)

16

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

ALLEGATO Serial WAN Link da http://www.jlsnet.co.uk/index.php?page=cc_wan Author: James Saunders Date: Wed, 8 Jun 2005 01:31:00 CEST For the Cisco CCNA (Cisco Certified Network Associate) exam you are expected to know about WAN (Wide Area Network) links, the protocols used and how to configure a serial WAN link on a router. This tutorial will discuss these topics and end with a simple WAN lab which can be setup with minimal equipment and cost. WAN Connection through an ISP A serial WAN link is a dedicated Point to Point link, mainly used to connect two sites through an telco ISP. A serial link would appear to the routers at each end to be always on. The way in which the data gets between the two routers may be very different depending on the protocol and encapsulation methods (e.g. it may be Packetswitched or Leased Line).

DCE fornito da ISP 1) modem analogico 2) CSU/CDU digitale

17

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

As can be seen in the diagram above in a serial WAN setup there are a few bits of equipment with different terminologies; DCE and DTE, these terms relate to where in the end to end setup the equipment is. A DTE (Data Terminating Equipment) is the start and end points in the serial setup, this is the Cisco routers at each end. A DCE (Data Communications Equipment) is the equipment which the router connects to, usually provided by the ISP, and provides the main link out of an office to the ISP (in the example above, BT, these are equipment also known as CSU/DSU's or Modem's). A DTE can only talk to a DCE, but a DCE can talk to other DCE's. The speed at which a serial WAN link runs is determined by the 'clock rate', this rate governs the number of bits that can be transferred per second, for example, a clock rate of 64000 would give an overall serial link bandwidth of 64k. This clock rate can not be set at the DTE's (routers) at either end but is controlled by the telco ISP via the DCE's. If you require more bandwidth you must contact your ISP and request the clock rate to be increased and pay more money for the privilege! There is NOTHING you can add to the Cisco router configuration to increase the bandwidth above the clock rate! Cables There are different types of cables used when setting up a serial WAN link. As discussed previously, the DTE (router) can only talk to a DCE, a cable called a DTE/DCE cable should be used for such a link. There are a variety of different flavor of plug that can be used at each end of a serial DTE/DCE cable but they all conform to the same standard which governs the Physical (OSI Layer 1) details, electrical signaling, voltages etc. A X.21 cable can be seen in the diagram above linked to s0/0 of the routers at each end. The following image shows some of the different types of serial cable connectors:

18

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

There are different ways in which a serial cable can be wired up, depending on which pins are connected to which and the gender of plug each end could either be a DTE or DCE connection, this is very important when setting up a serial link, if the wrong plug is connected at one end or the other you will not get a link, because transmit pins at one end will be sending data to transmit pins at the other. When you connect a serial cable to a Cisco router you can use the "show controller s 0/0" command which will tell you the hardware (OSI Layer 1) specifications including what type of cable you have plugged into the router, including the plug type.
router1#sh cont s 0/0 HD unit 0, ibd = 0xCE160, driver structure at 0xD2EE0 buffer size 1524 HD unit 0, X.21 DTE cable

The router can detect the cable type because particular pins are joined, this command will work even if the cable is not plugged in at the other end. WAN Connection without an ISP (The cheap way to do a lab!) When studying for a CCNA you are hardly wanting to pay for a leased line from your ISP, or purchase expensive DSU/CSU's. You can connect two routers using a DTE serial cable and a DCE serial cable connected back-to-back. One additional configuration command must be entered onto one of the routers serial interfaces to enable it it to provide a clock-rate for the link, simulating a DCE.

19

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

DTE/DCE crossover cable

The first thing to do is to ascertain which is the DTE and which is the DCE interface. This can be done by physically looking at the cable connector type. If you are using X21 then the female connector is the DCE end. The other (and CCNA exam preferred!) way of achieving this is to issue the "show controller s 0/0" command as discussed earlier. Once you have found the DCE end you next need to add the clock rate to this interface. DCE devices provide the clock rate and because you are emulating this you have to manually get the router to provide the clocking source. All you need to do is use the "clock rate" interface configuration command, which tells the router to supply clocking (synchronization) on the link which in normal conditions the CSU/DSU would provide. The following configuration commands are needed to set the clock-rate on Router 2 in the example diagram above.
router2#config t router2(config)int s0/0 router2(config-if)encapsulation hdlc router2(config-if)clock rate 64000 router2(config-if)bandwidth 64 router2(config-if)no shutdown

The commands above would set the clock rate to roughly 64K. You now need to setup Router 1 with the equivalent commands (note there is no need for the clock rate command on the DTE router, if you attempt to enter it it will simply display an error and not let you set it):
router1#config t router1(config)int s0/0 router1(config-if)encapsulation hdlc router1(config-if)bandwidth 64 router1(config-if)no shutdown

All that is needed now is to configure the Network Layer IP Address's such as 172.16.1.1 for the DCE and 172.16.1.2 for the DTE and check the status of a serial link with the "sh int s0/0" command...
router1#sh int s 0/0 Serial0 is up, line protocol is up ... Encapsulation HDLC, loopback not set, keepalive set (10 sec) ...

20

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio

Docente: Setti Stefano

and maybe ping each other to check all is well. WAN Protocols There are a number of different WAN protocols which can run on a Cisco Serial interface, each protocol has different features, advantages and disadvantages: Frame Relay Packet-switched service, Allows bursing past CIR, giving the perception of "free capacity. Is pervasive in the United States. Packet-switched service, As a WAN technology, is not as pervasively X.25 available as Frame Relay. Has an attractive built-in Quality of Service feature. Packet-switched service, Asynchronous Transfer Mode, Is available ATM pervasively in some parts if the world. Offers beneficial error-recovery features when links have higher error rates. Leased Line service, High Level Data Link Control, Default HDLC encapsulation on Cisco Serial interfaces. Requires a Cisco router at each end. Leased Line service, Link Access Procedure Balanced, Provides error LAPB recovery, but this can result in throttling (slowing) the data rate. Leased Line service, Synchronous Data Link Control, IBM developed the protocol in the mid-1970s for use in Systems Network Architecture SDLC (SNA) environments. SDLC was the first link layer protocol based on synchronous, bit-oriented operation. Leased Line service, Can improve the speed of routing protocol PPP convergence. Allows multi vendor interoperability. Has an errorrecovery option and authentication.

The protocols above are also known as "encapsulation" protocols. When creating a serial WAN link between two routers, the encapsulation protocol set at both ends must match! The default WAN protocol which Cisco routers use on their Serial interfaces is HDLC. HDLC is a Cisco proprietary protocol and will only work if you have Cisco routers at both ends, no other manufacturers use HDLC. To change the WAN protocol used on the serial links you must use the "encapsulation" interface configuration command. Any of the various WAN commands above can be used over a serial WAN link. For example to set the WAN protocol to PPP you would perform the following configuration changes:
router1#config t router1(config)int s0/0 router1(config-if)encapsulation ppp router1(config-if)bandwidth 64

21

Corso di Reti di Calcolatori: Applicazioni Esercitazioni di Laboratorio router1(config-if)no shutdown router1(config-if)ip address 172.16.1.1 router2#config t router2(config)int s0/0 router2(config-if)encapsulation ppp router2(config-if)clock rate 64000 router2(config-if)bandwidth 64 router2(config-if)no shutdown router2(config-if)ip address 172.16.1.2

Docente: Setti Stefano

and once again check the status with the "sh

int s0/0"

command...

router1#sh int s 0/0 Serial0 is up, line protocol is up ... Encapsulation PPP, loopback not set, keepalive set (10 sec) ...

22

Potrebbero piacerti anche