Upload
mimmo
View
47
Download
2
Embed Size (px)
DESCRIPTION
skill packet tracer
Citation preview
Corso di Reti di Calcolatori: Applicazioni – Esercitazioni di Laboratorio Docente: Setti Stefano
LEZIONE 4 – ROUTING BASEESERCIZIO 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 2620Interfaccia 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 2620Interfaccia 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 l’hostname
Router>enableRouter#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R1R1(config)#exitR1#
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 ...
2
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 l’interfaccia F0/0
R1#configure terminalEnter configuration commands, one per line. End with CNTL/Z.R1(config)#interface F0/0R1(configif)#ip address 192.168.100.1 255.255.255.0R1(configif)#no shutdown R1(configif)#%LDXX Line protocol on Interface FastEthernet0/0, changed state to upR1(configif)#exit
Configuriamo l’interfaccia 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
3
DCE fornito da ISP 1) modem analogico2) 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.
4
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 errorprone 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/0R1(configif)#ip address 192.168.1.1 255.255.255.0R1(configif)#clock rate 64000R1(configif)#no shutdown R1(configif)#exitR1(config)#
CONFIGURIAMO IL ROUTER R2:
Configuriamo l’hostname
Router>enable Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R2R2(config)#exit
Configuriamo l’interfaccia F0/0
R2#configure terminalEnter configuration commands, one per line. End with CNTL/Z.R2(config)#interface F0/0R2(configif)#ip address 192.168.200.1 255.255.255.0
5
Corso di Reti di Calcolatori: Applicazioni – Esercitazioni di Laboratorio Docente: Setti Stefano
R2(configif)#no shutdown R2(configif)#%LDXX Line protocol on Interface FastEthernet0/0, changed state to upR2(configif)#exit
Configuriamo l’interfaccia S0/0
R2(config)#interface S0/0R2(configif)#ip address 192.168.1.2 255.255.255.0R2(configif)#no shutdown R2(configif)#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)#exitR2#ping 192.168.1.1
Type escape sequence to abort.Sending 5, 100byte 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, 100byte 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 msR2#
Come si può vedere, non riusciamo a raggiungere il PC1, dato che non è definita nel router R2 alcuna rotta verso la rete avente netid 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 terminalEnter 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 16
Corso di Reti di Calcolatori: Applicazioni – Esercitazioni di Laboratorio Docente: Setti Stefano
R1#configure terminalEnter 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)#exitR1#ping 192.168.200.2
Type escape sequence to abort.Sending 5, 100byte 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)#exitR2#ping 192.168.100.2
Type escape sequence to abort.Sending 5, 100byte 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 from 192.168.200.2 on Eth, time<10ms TTL=126Reply from 192.168.200.2 on Eth, time<10ms TTL=126Reply from 192.168.200.2 on Eth, time<10ms TTL=126Reply from 192.168.200.2 on Eth, time<10ms 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.12 8ms 12ms 9ms 192.168.1.23 14ms 12ms 17ms 192.168.200.2Destination trace successful.
7
Corso di Reti di Calcolatori: Applicazioni – Esercitazioni di Laboratorio Docente: Setti Stefano
Vediamo che il nostro pacchetto prima raggiunge l’interfaccia Eth0 del Router 1 ( 192.168.100.1), poi arriva all’interfaccia 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 routeCodes: 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 ISIS, L1 ISIS level1, L2 ISIS level2, * candidate
default U peruser static route, o ODR
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected to Serial0/0C 192.168.100.0/24 is directly connected to FastEthernet0/0S 192.168.200.0/24 [1/0] via 192.168.1.2 00.00.10 S0/0
8
Corso di Reti di Calcolatori: Applicazioni – Esercitazioni di Laboratorio Docente: Setti Stefano
Andiamo ad interrogare il Router 2
R2#show ip routeCodes: 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 ISIS, L1 ISIS level1, L2 ISIS level2, * candidate
default U peruser static route, o ODR
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected to Serial0/0S 192.168.100.0/24 [1/0] via 192.168.1.1 00.00.37 S0/0C 192.168.200.0/24 is directly connected to FastEthernet0/0
Per vedere le’ARP table si utilizza il comando show ip arp
R2#show arpProtocol Address Age (min) Hardware Addr Type InterfaceInternet 192.168.200.2 3 5AF3.3300.1003 ARPA FastEthernet0/0Internet 192.168.200.1 E4E0.8500.1005 ARPA FastEthernet0/0Internet 0.0.0.0 28ED.8500.1006 ARPA FastEthernet0/1
Per vedere il modello di Router e altre informazioni si utilizza il comando show version
R2#show version Cisco Internetwork Operating System SoftwareIOS (tm) C2600 Software (C2600DM), Version 12.2(16), RELEASE SOFTWARE (fc3)Copyright (c) 19862008 by cisco Systems, Inc.>>LITTLE OF THE FOLLOWING IS RELEVANT JUST FOR LOOKS<<Compiled Wed 04Mar8 04:44 by SomeoneImage textbase: 0x02005000, database: 0x0246B4A4
ROM: System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)
R2 uptime is 23 minutesSystem restarted by poweronSystem image file is "flash:c2600dmz.12216.bin", booted via flash
cisco 2620 (MPC860) processor (revision 0x200) with 29696K/3072K bytes of memory.Processor board ID 07708054, with hardware revision 00000000Bridging 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 disabled8192K bytes of DRAM onboard 2048K bytes of DRAM on SIMMSystem running from RAM32K bytes of nonvolatile configuration memory.8192K bytes of processor board System flash (Read/Write)
Configuration register is 0x2102
9
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 all’indirizzo specificato.
Impostiamo quindi sul router R1 questa rotta di default:
R1#configure terminalEnter 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 terminalEnter 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 routeCodes: 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 ISIS, L1 ISIS level1, L2 ISIS level2, * candidate default U peruser static route, o ODR
Gateway of last resort is 192.168.1.1 to network 0.0.0.0
C 192.168.1.0/24 is directly connected to Serial0/0S 192.168.100.0/24 [1/0] via 192.168.1.1 00.00.50 S0/0C 192.168.200.0/24 is directly connected to FastEthernet0/0S* 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 2620Router 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 l’hostname
Router>enableRouter#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R1
Configuriamo l’interfaccia F0/0
R1(config)#interface F0/0R1(configif)#ip address 10.1.1.1 255.255.255.0R1(configif)#no shutdown R1(configif)#exit
Configuriamo l’interfaccia Seriale S0/0
R1(config)#interface S0/0R1(configif)#ip address 12.5.10.1 255.255.255.0R1(configif)#no shutdown R1(configif)# exit%LDXX Interface Serial0/0, changed state to downR1(config)#
Controlliamo se la nostra interfaccia seriale è DTE o DCE
R1(config)#exitR1#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 errorprone 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 terminalEnter configuration commands, one per line. End with CNTL/Z.R1(config)#interface S0/0R1(configif)#clock rate 64000R1(configif)#exitR1(config)#
CONFIGURIAMO IL ROUTER R2:
Configuriamo l’hostname
Router>enableRouter#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R2
Configuriamo l’interfaccia F0/0
R2(config)#interface F0/0R2(configif)#ip address 10.1.1.2 255.255.255.0R2(configif)#no shutdown R2(configif)#%LDXX Line protocol on Interface FastEthernet0/0, changed state to upR2(configif)#exitR2(config)#
Testiamo ora se il Router R2 riesce a raggiungere il Router R1
R2(config)#exitR2#ping 10.1.1.1
Type escape sequence to abort.Sending 5, 100byte 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 l’hostname
Router>enable Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname R3
13
Corso di Reti di Calcolatori: Applicazioni – Esercitazioni di Laboratorio Docente: Setti Stefano
Configuriamo l’interfaccia Serial 0
R3(config)#interface S0/0R3(configif)#ip address 12.5.10.2 255.255.255.0R3(configif)#no shutdown R3(configif)#%LDXX Line protocol on Interface Serial0/0, changed state to upR3(configif)#exit
Controlliamo se la nostra interfaccia seriale è DTE o DCE
R3(config)#exitR3#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 errorprone line.
Vediamo che la nostra interfaccia seriale è DTE, quindi il clock sarà dato dall’interfaccia all’altro 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, 100byte 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 msR3#
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 configurationInterface IPAddress OK? Method Status ProtocolFastEthernet0/0 unassigned YES unset administratively down downFastEthernet0/1 unassigned YES unset administratively down downSerial0/0 12.5.10.2 YES manual up upSerial0/1 unassigned YES unset administratively down downSerial0/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 l’inoltro 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 terminalEnter 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)#exitR3#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 ISIS, L1 ISIS level1, L2 ISIS level2, * candidate default U peruser static route, o ODR
Gateway of last resort is not set
S 10.1.1.0/24 [1/0] via 12.5.10.1 00.00.34 S0/0C 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 terminalEnter configuration commands, one per line. End with CNTL/Z.R2(config)#ip route 12.5.10.0 255.255.255.0 10.1.1.1R2(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 ISIS, L1 ISIS level1, L2 ISIS level2, * candidate default U peruser static route, o ODR
Gateway of last resort is not set
C 10.1.1.0/24 is directly connected to FastEthernet0/0S 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, 100byte 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, 100byte 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 msec2 (10.1.1.2) 18 msec 19 msec *Destination trace successful.
Vediamo che il nostro pacchetto prima raggiunge l’interfaccia Serial 0 del Router 1 ( 12.5.10.1), poi arriva all’interfaccia 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).
17
DCE fornito da ISP 1) modem analogico2) CSU/CDU digitale
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/0HD unit 0, ibd = 0xCE160, driver structure at 0xD2EE0buffer 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 backtoback. One additional configuration command must be entered onto one of the routers serial interfaces to enable it it to provide a clockrate for the link, simulating a DCE.
19
Corso di Reti di Calcolatori: Applicazioni – Esercitazioni di Laboratorio Docente: Setti Stefano
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 clockrate on Router 2 in the example diagram above. router2#config trouter2(config)int s0/0router2(configif)encapsulation hdlc
router2(configif)clock rate 64000router2(configif)bandwidth 64router2(configif)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 trouter1(config)int s0/0router1(configif)encapsulation hdlcrouter1(configif)bandwidth 64router1(configif)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/0Serial0 is up, line protocol is up...Encapsulation HDLC, loopback not set, keepalive set (10 sec)...
20
DTE/DCE crossover cable
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
Packetswitched service, Allows bursing past CIR, giving the perception of "free capacity. Is pervasive in the United States.
X.25Packetswitched service, As a WAN technology, is not as pervasively
available as Frame Relay. Has an attractive builtin Quality of Service feature.
ATMPacketswitched service, Asynchronous Transfer Mode, Is available
pervasively in some parts if the world. Offers beneficial errorrecovery features when links have higher error rates.
HDLCLeased Line service, High Level Data Link Control, Default
encapsulation on Cisco Serial interfaces. Requires a Cisco router at each end.
LAPBLeased Line service, Link Access Procedure Balanced, Provides error
recovery, but this can result in throttling (slowing) the data rate.
SDLC
Leased Line service, Synchronous Data Link Control, IBM developed the protocol in the mid1970s for use in Systems Network Architecture (SNA) environments. SDLC was the first link layer protocol based on synchronous, bitoriented operation.
PPPLeased Line service, Can improve the speed of routing protocol
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 trouter1(config)int s0/0router1(configif)encapsulation ppprouter1(configif)bandwidth 64
21
Corso di Reti di Calcolatori: Applicazioni – Esercitazioni di Laboratorio Docente: Setti Stefano
router1(configif)no shutdownrouter1(configif)ip address 172.16.1.1
router2#config trouter2(config)int s0/0router2(configif)encapsulation ppprouter2(configif)clock rate 64000router2(configif)bandwidth 64router2(configif)no shutdownrouter2(configif)ip address 172.16.1.2
and once again check the status with the "sh int s0/0" command...router1#sh int s 0/0Serial0 is up, line protocol is up...Encapsulation PPP, loopback not set, keepalive set (10 sec)...
22