资源描述
路由器静态路由的配置
一、 实验目的
1. 掌握静态态路由的配置方法
2. 理解静态路由的工作过程和使用环境
二、 应用环境
1. 在路由器较少而且网络比较问题的环境里,为了减少路由器的开销和带宽的占用,通常手工配置静态路
2. 该网络的每个路由器都必须有所有目的网络的路由
3. 需要配置所有非直连的路由
三、 实验设备
1. DCR-1702 三台
2. CR-V35FC 一条
3. CR-V35MT 一条
四、 实验拓扑
五、 实验要求
配置表
Router-A
Router-B
Router-C
S1/1(DCE)
192.168.1.1
S/1/0(DTE)
192.168.1.2
F0/0
192.168.2.2
F0/0
192.168.0.1
F0/0
192.168.2.1
E1/0
192.168.3.1
六、 实验步骤
第一步:参照实验三,按照上表配置所有接口的IP地址,保证所有接口全部是up状态,测试连通性
第二步:查看ROUTER-A的路由表
Router-A#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
C 192.168.0.0/24 is directly connected, FastEthernet0/0 !直连的路由
C 192.168.1.0/24 is directly connected, Serial1/1 !直连的路由
第三步:查看ROUTER-B的路由表
Router-B#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
C 192.168.1.0/24 is directly connected, Serial1/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
第四步:查看ROUTER-C的路由表
Router-B#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
C 192.168.1.0/24 is directly connected, Serial1/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
第五步:在ROUTER-A上PING 路由器C
Router-A#ping 192.168.2.2
PING 192.168.2.2 (192.168.2.2): 56 data bytes
.....
--- 192.168.2.2 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss !不通
第六步:在路由器A上配置并查看路由表
Router-A_config#ip router 192.168.2.0 255.255.255.0 192.168.1.2 !配置192.168.2.0 的路由
Router-A_config#ip router 192.168.3.0 255.255.255.0 192.168.1.2
!配置192.168.3.0 的路由
Router-A#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
S 192.168.2.0/24 [1,0] via 192.168.1.2
S 192.168.3.0/24 [1,0] via 192.168.1.2
C 192.168.0.0/24 is directly connected, FastEthernet0/0
C 192.168.1.0/24 is directly connected, Serial1/1
注意到出现刚才配置的静态路由。
第七步:在路由器B上配置并查看路由表
Router-B_config#ip router 192.168.0.0 255.255.255.0 192.168.1.1
Router-B_config#ip router 192.168.3.0 255.255.255.0 192.168.2.2
Router-B#2004-1-1 00:15:58 Configured from console 0 by DEFAULT
Router-B#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
S 192.168.0.0/24 [1,0] via 192.168.1.1
S 192.168.3.0/24 [1,0] via 192.168.2.2
C 192.168.1.0/24 is directly connected, Serial1/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
第八步:在路由器C上配置并查看路由表
Router-C_config# ip router 192.168.0.0 255.255.255.0 192.168.2.1
Router-C_config# ip router 192.168.1.0 255.255.255.0 192.168.2.1
Router-C_config_rip#^Z
Router-C#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
S 192.168.0.0/24 [1,0] via 192.168.2.1
S 192.168.1.0/24 [1,0] via 192.168.2.1
C 192.168.2.0/24 is directly connected, FastEthernet0/0
C 192.168.3.0/24 is directly connected, Ethernet1/0
七、 注意事项和排错
1. 只配置非直连的网段
2. 配置内容为目的网络和下一跳
3. 掩码可以根据实际情况进行超网(汇总)以减少路由表的长度
八、 共同思考
1. 如果只配置一个方向的路由,能否通信?
2. 如果在配置路由器A的时候,目的网络为192.168.3.0 的下一条写成了192.168.2.2 会有什么问题?
3. 使用?查看ip route 命令还有哪些参数?各有什么作用
九、 课后练习
将地址改为10.0.0.0/24这个网段重复以上实验
展开阅读全文