上犹电脑信息网我们一直在努力
您的位置:上犹电脑信息网 > 设置问题 > 基本静态路由设置-路由设置

基本静态路由设置-路由设置

作者:上犹日期:

返回目录:设置问题

基本静态路由设置

实验目的:路由全通

RouterA

RouterA#sho run

Building configuration...

Current configuration : 584 bytes

!

version 12.2

no service single-slot-reload-enable

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname RouterA

!

logging rate-limit console 10 except errors

!

ip subnet-zero

no ip finger

!

no ip dhcp-client network-discovery

!

!

!

!

interface Ethernet0

no ip address

shutdown

!

interface Serial0

no ip address

shutdown

!

interface Serial1

ip address 192.168.1.1 255.255.255.0

clockrate 64000

!

ip kerberos source-interface any

ip classless

ip http server

!

!

!

line con 0

transport input none

line aux 0

line vty 0 4

!

End

RouterB

RouterB#sho run

Building configuration...

Current configuration : 393 bytes

!

version 12.2

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname RouterB

!

!

ip subnet-zero

!

!

!

!

interface Ethernet0

no ip address

shutdown

!

interface Serial0

ip address 192.168.2.2 255.255.255.0

!

interface Serial1

ip address 192.168.1.2 255.255.255.0

!

ip classless

ip http server

!

!

!

line con 0

line aux 0

line vty 0 4

!

End

RouterC

RouterC#show run

Building configuration...

Current configuration : 584 bytes

!

version 12.2

no service single-slot-reload-enable

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname RouterC

!

logging rate-limit console 10 except errors

!

ip subnet-zero

no ip finger

!

no ip dhcp-client network-discovery

!

!

!

!

interface Ethernet0

no ip address

shutdown

!

interface Serial0

ip address 192.168.2.3 255.255.255.0

clockrate 64000

!

interface Serial1

no ip address

shutdown

!

ip kerberos source-interface any

ip classless

ip http server

!

!

!

line con 0

transport input none

line aux 0

line vty 0 4

!

End

首先在RouterA上使用ping命令检测直连链路是否通畅

RouterA#ping 192.168.1.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/32/32 ms

再次使用ping命令检测能否将包从RouterA发送到达RouterC

RouterA#ping 192.168.2.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:

.....

Success rate is 0 percent (0/5)

Ping命令失败!使用debug ip packet命令来查看

RouterA#debug ip packet

IP packet debugging is on

RouterA#ping 192.168.2.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:

00:15:52: IP: s=192.168.1.1 (local), d=192.168.2.3, len 100, unroutable.

00:15:54: IP: s=192.168.1.1 (local), d=192.168.2.3, len 100, unroutable.

00:15:56: IP: s=192.168.1.1 (local), d=192.168.2.3, len 100, unroutable.

00:15:58: IP: s=192.168.1.1 (local), d=192.168.2.3, len 100, unroutable.

00:16:00: IP: s=192.168.1.1 (local), d=192.168.2.3, len 100, unroutable.

Success rate is 0 percent (0/5)

根据debug信息可以看出ping不成功是因为无法路由,使用show ip route来查看路由表

RouterA#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, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

C 192.168.1.0/24 is directly connected, Serial1

路由表中没有192.168.2.0/24网络的路由,需要手动添加静态路由

RouterA#conf t

Enter configuration commands, one per line. End with CNTL/Z.

RouterA(config)#ip route 192.168.2.0 255.255.255.0 S1

查看路由表

RouterA#sho ip rou

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 not set

C 192.168.1.0/24 is directly connected, Serial1

S 192.168.2.0/24 is directly connected, Serial1

此时路由表发生变化,多了一条静态路由。

再次ping一下RouterC

RouterA#ping 192.168.2.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:

00:21:43: IP: s=192.168.1.1 (local), d=192.168.2.3 (Serial1), len 100, sending.

00:21:45: IP: s=192.168.1.1 (local), d=192.168.2.3 (Serial1), len 100, sending.

00:21:47: IP: s=192.168.1.1 (local), d=192.168.2.3 (Serial1), len 100, sending.

00:21:49: IP: s=192.168.1.1 (local), d=192.168.2.3 (Serial1), len 100, sending.

00:21:51: IP: s=192.168.1.1 (local), d=192.168.2.3 (Serial1), len 100, sending.

Success rate is 0 percent (0/5)

依然不通,但是信息表示数据包已经发送成功,考虑ping是一个双向过程,于是到RouterB上去看一下

RouterB#ping 192.168.2.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/32/32 ms

RouterB#ping 192.168.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 40/40/44 ms

RouterB可以ping通RouterA与C,说明RouterB没有问题。

去看一下RouterC的路由表

RouterC#sho ip rou

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 not set

C 192.168.2.0/24 is directly connected, Serial0

发现路由器C没有去往192.168.1.0/24网络的路由信息,此时debug看RouterC ping RouterA的过程也证明了我们的推断

RouterC#debug ip pac

IP packet debugging is on

RouterC#ping 192.168.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:

03:46:38: IP: s=192.168.2.3 (local), d=192.168.1.1, len 100, unroutable.

03:46:40: IP: s=192.168.2.3 (local), d=192.168.1.1, len 100, unroutable.

03:46:42: IP: s=192.168.2.3 (local), d=192.168.1.1, len 100, unroutable.

03:46:44: IP: s=192.168.2.3 (local), d=192.168.1.1, len 100, unroutable.

03:46:46: IP: s=192.168.2.3 (local), d=192.168.1.1, len 100, unroutable.

Success rate is 0 percent (0/5)

在RouterC上添加去往192.168.1.0/24网络的静态路由

RouterC#conf t

Enter configuration commands, one per line. End with CNTL/Z.

RouterC(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.2

退回特权模式,查看路由表变化

RouterC(config)#exit

RouterC#

03:48:52: %SYS-5-CONFIG_I: Configured from console by console

RouterC#sho ip rou

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 not set

S 192.168.1.0/24 [1/0] via 192.168.2.2

C 192.168.2.0/24 is directly connected, Serial0

已经创建了一条去往192.168.1.0/24网络的路由,回到RouterA上测试ping一下

RouterA#ping 192.168.2.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 76/85/112 ms

相关阅读

关键词不能为空
极力推荐

电脑蓝屏_电脑怎么了_win7问题_win10问题_设置问题_文件问题_上犹电脑信息网

关于我们