实验二 静态路由协议配置
一、实验目的
⑴ 掌握路由器在网络中的作用、组成以及路由器设备选型;
⑵ 掌握PacketTrace 仿真软件的使用方法;
⑶ 掌握路由器的静态路由配置命令。
二、实验条件
Cisco2621 Router、PacketTrace仿真软件、具备Windows操作系统的PC机
三、实验原理及相关知识
掌握PacketTrace路由仿真软件的使用、静态路由配置方法
四、实验步骤
1. 按要求对路由器接口进行配置(仅配置接口信息,不做任何路由设置)
⑴ 配置路由协议之前路由器R0的路由信息
Router>en
Router#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R0
⑵ 配置路由协议之前路由器R4的路由信息
Router>en
Router#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R4
2.配置路由器静态路由
⑴ 配置路由器R0路由
R0(config)#interface se 1/0
R0(config-if)#ip address 192.172.101.2 255.255.255.252
R0(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial1/0, changed state to down
R0(config-if)#exit
R0(config)#interface f0/0
R0(config-if)#ip address 192.172.1.1 255.255.255.0
R0(config-if)#no sh
R0(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R0(config-if)#exit
⑵ 配置路由器R1路由
R1(config)#interface s1/1
R1(config-if)#ip address 192.172.101.6 255.255.255.252
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial1/1, changed state to down
R1(config-if)#interface f0/0
R1(config-if)#ip address 192.172.2.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
⑶ 配置路由器R2路由
R2(config)#interface s1/2
R2(config-if)#ip address 192.172.101.10 255.255.255.252
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial1/2, changed state to down
R2(config-if)#exit
R2(config)#interface f0/0
R2(config-if)#ip address 192.172.3.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#exit
⑷ 配置路由器R3路由
R3(config)#interface s1/1
R3(config-if)#ip address 192.172.101.14 255.255.255.252
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial1/1, changed state to down
R3(config-if)#exit
R3(config)#interface f0/0
R3(config-if)#ip address 192.172.4.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#exit
⑸ 配置路由器R4路由
R4(config)#interface s1/0
R4(config-if)#ip address 192.172.101.1 255.255.255.252
R4(config-if)#no sh
R4(config-if)#
%LINK-5-CHANGED: Interface Serial1/0, changed state to up
R4(config-if)#clock rate 64000
R4(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up
R4(config-if)#no sh
R4(config-if)#interface s1/1
R4(config-if)#ip address 192.172.101.5 255.255.255.252
R4(config-if)#clock rate 64000
R4(config-if)#no sh
R4(config-if)#interface s1/2
R4(config-if)#ip address 192.172.101.9 255.255.255.252
R4(config-if)#clock rate 64000
R4(config-if)#no sh
R4(config-if)#interface s1/3
R4(config-if)#ip address 192.172.101.13 255.255.255.252
R4(config-if)#clock rate 64000
R4(config-if)#no sh
⑹ 配置之后路由器R0的路由信息
R0(config)#ip route 192.172.101.12 255.255.255.252 192.172.101.1
R0(config)#ip route 192.172.101.8 255.255.255.252 192.172.101.1
R0(config)#ip route 192.172.101.4 255.255.255.252 192.172.101.1
R0(config)#ip route 192.172.4.0 255.255.255.0 192.172.101.14
R0(config)#ip route 192.172.3.0 255.255.255.0 192.172.101.10
R0(config)#ip route 192.172.2.0 255.255.255.0 192.172.101.6
⑺ 配置之后路由器R1的路由信息
R1(config)#ip route 192.172.101.0 255.255.255.252 192.172.101.5
R1(config)#ip route 192.172.101.12 255.255.255.252 192.172.101.5
R1(config)#ip route 192.172.101.8 255.255.255.252 192.172.101.5
R1(config)#ip route 192.172.1.0 255.255.255.0 192.172.101.2
R1(config)#ip route 192.172.4.0 255.255.255.0 192.172.101.14
R1(config)#ip route 192.172.3.0 255.255.255.0 192.172.101.10
⑻ 配置之后路由器R2的路由信息
R2(config)#ip route 192.172.101.0 255.255.255.252 192.172.101.9
R2(config)#ip route 192.172.101.12 255.255.255.252 192.172.101.9
R2(config)#ip route 192.172.101.4 255.255.255.252 192.172.101.9
R2(config)#ip route 192.172.1.0 255.255.255.0 192.172.101.2
R2(config)#ip route 192.172.2.0 255.255.255.0 192.172.101.6
R2(config)#ip route 192.172.4.0 255.255.255.0 192.172.101.14
⑼ 配置之后路由器R3的路由信息
Router(config)#ip route 192.172.101.0 255.255.255.252 192.172.101.13
Router(config)#ip route 192.172.101.4 255.255.255.252 192.172.101.13
Router(config)#ip route 192.172.101.8 255.255.255.252 192.172.101.13
Router(config)#ip route 192.172.1.0 255.255.255.252 192.172.101.2
Router(config)#ip route 192.172.2.0 255.255.255.252 192.172.101.6
Router(config)#ip route 192.172.3.0 255.255.255.252 192.172.101.10
⑽ 配置之后路由器R4的路由信息
R4(config)#ip route 192.172.1.0 255.255.255.0 192.172.101.2
R4(config)#ip route 192.172.4.0 255.255.255.0 192.172.101.14
R4(config)#ip route 192.172.3.0 255.255.255.0 192.172.101.10
R4(config)#ip route 192.172.2.0 255.255.255.0 192.172.101.6
3. 测试连通性
⑴ 路由器R0 ping路由器R2
R0#ping 192.172.101.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.172.101.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/8/33 ms
⑵ 在各主机间使用ping命令,测试主机间的连通性。
C:\>ping 192.172.2.11
Pinging 192.172.2.11 with 32 bytes of data:
Reply from 192.172.2.11: bytes=32 time=3ms TTL=125
Reply from 192.172.2.11: bytes=32 time=5ms TTL=125
Reply from 192.172.2.11: bytes=32 time=2ms TTL=125
Reply from 192.172.2.11: bytes=32 time=12ms TTL=125
Ping statistics for 192.172.2.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 12ms, Average = 5ms
C:\>ping 192.172.1.11
Pinging 192.172.1.11 with 32 bytes of data:
Reply from 192.172.1.11: bytes=32 time=1693ms TTL=128
Reply from 192.172.1.11: bytes=32 time=4ms TTL=128
Reply from 192.172.1.11: bytes=32 time<1ms TTL=128
Reply from 192.172.1.11: bytes=32 time=4ms TTL=128
Ping statistics for 192.172.1.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1693ms, Average = 425ms
C:\>ping 192.172.3.11
Pinging 192.172.3.11 with 32 bytes of data:
Reply from 192.172.3.11: bytes=32 time=2ms TTL=125
Reply from 192.172.3.11: bytes=32 time=12ms TTL=125
Reply from 192.172.3.11: bytes=32 time=2ms TTL=125
Reply from 192.172.3.11: bytes=32 time=2ms TTL=125
Ping statistics for 192.172.3.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 12ms, Average = 4ms
C:\>ping 192.172.4.11
Pinging 192.172.4.11 with 32 bytes of data:
Reply from 192.172.4.11: bytes=32 time=10ms TTL=125
Reply from 192.172.4.11: bytes=32 time=3ms TTL=125
Reply from 192.172.4.11: bytes=32 time=12ms TTL=125
Reply from 192.172.4.11: bytes=32 time=12ms TTL=125
Ping statistics for 192.172.4.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 12ms, Average = 9ms
五、常用路由器状态查询命令(在特权模式下输入命令)
Show version //查看IOS版本号,已启动时间,flash中的IOS的文件名,router里面共有什么的端口,寄存器的值等等。
show protocol //显示与IP 有关的路由协议信息。各个端口的情况。
show flash //查看flash中的内容,IOS的长度,文件名,剩余空间,总空间。
show running-config //查看路由器当前的配置信息。
show startup-config //查看nvram 中的路由器配置信息。
show ip route //查看路由器的路由配置情况
show hosts //查看IP host 表
show interface //查看路由器上的各个端口的状态信息。(很多重要信息)
show controller //查看接口控制器的状态,可看到连接的是DTE还是DCE
show history //查看history buffer 里面的命令列表
六、思考题及其它
⑴ 查看路由器的路由协议信息,用什么命令?
show ip route