资源描述
《计算机网络》实训项目六
——静态路由
路由器通过内置的路由表完成网络数据传输的路由选择,路由器的路由表有2种生成方式:
1)静态路由(手动编制路由表)
2)动态路由协议:如RIP,OSPF
本次实验首先 讨论静态路由协议的应用。
环境:两台2621XM系列路由器通过串口相连。
需要手动添加串行接口的面板WIC-1T一块作为S型串口
注意:添加时,关闭电源;添加完毕,打开电源。
要求:在R1和R2上启用静态路由,使两端网络能够互通。
192.168.20.1
说明:1、路由器R1为DCE端,路由器R2为DTE端。即连线时用Serial DCE线先点R1,再点R2。(实验命令只有DCE端要设置同步时钟频率,DTE端不需要设置)
2、从本次实验开始,直接在路由器的CLI仿真界面上配置,不再使用超级终端(但是在实际链路中,超级终端仍然是路由器、交换机的主要配置方法)。
3、x1和x2只要设置好IP地址和网关,做好与之相连的R1、R2的端口IP配置,就可以直接ping通了。可以不涉及到路由协议,因为它们是在同一路由器直连网段上的。但x1和x3、x2和x3之间ping通之前一定要设置路由协议。
步骤一:接口配置
R1的配置:
Router(config)#hostname R1
R1(config)#interface f0/0
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface f0/1
R1(config-if)#ip address 192.168.40.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface s0/0
R1(config-if)#ip address 192.168.30.1 255.255.255.0
R1(config-if)#clock rate 64000 à时钟速率端
R1(config-if)#no shutdown
R1(config-if)#
R2的配置:
Router(config)#hostname R2
R2(config)#interface f0/0
R2(config-if)#ip address 192.168.20.1 255.255.255.0
R1(config-if)#no shutdown
R2(config-if)#interface s0/0
R2(config-if)#ip address 192.168.30.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#
步骤二:指定R1和R2静态路由
R1(config)#ip route 192.168.20.0 255.255.255.0 s0/0 à指定R1静态路由
R2(config)#ip route 192.168.10.0 255.255.255.0 s0/0 à指定R2静态路由
R2(config)#ip route 192.168.40.0 255.255.255.0 s0/0 à指定R2静态路由
步骤三:作x1和x3的ping 测试,作x2和x3的ping 测试
注:在作测试之前,先要设置好x1、x2和x3的IP地址、子网掩码、网关的设置。
步骤四:显示静态路由条目
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, 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.10.0/24 is directly connected, FastEthernet0/0
S 192.168.20.0/24 is directly connected, Serial0/0
C 192.168.30.0/24 is directly connected, Serial0/0
C 192.168.40.0/24 is directly connected, FastEthernet0/1
- 4 -
展开阅读全文