1、 根据拓扑链接,配置PC 的IP和网关
2、 路由器基本配置
路由器R0基本配置
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#inter
Router(config)#interface f0/0
Router(config-if)#ip add 192.168.1.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#interface s2/0
Router(config-if)#ip add 192.168.3.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#clock rate 64000 时钟频率
Router(config-if)#no shutdown
Router(config-if)#interface s3/0
Router(config-if)#ip add 192.168.2.1 255.255.255.0
Router(config-if)#clock rate 64000 时钟频率
Router(config-if)#no shutdown
Router(config-if)#end
Router#
Router#show ip route 查看路由表 都是直连路由
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, Serial3/0
C 192.168.3.0/24 is directly connected, Serial2/0
Router#conf t
Router(config)#ip route 192.168.6.0 255.255.255.0 192.168.3.2
配置静态路由命令格式:IP route 目标网段 掩码 下一跳或者出接口
Router(config)#ip route 192.168.5.0 255.255.255.0 192.168.2.2
Router(config)#end
Router#
Router#show ip route
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, Serial3/0
C 192.168.3.0/24 is directly connected, Serial2/0
S 192.168.5.0/24 [1/0] via 192.168.2.2
S 192.168.6.0/24 [1/0] via 192.168.3.2
Router#
路由器R2基本配置
Router>
Router>en
Router#conf t
Router(config)#interface f0/0
Router(config-if)#ip add 192.168.5.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
Router(config-if)#exit
Router(config)#interface s2/0
Router(config-if)#ip add 192.168.2.2 255.255.255.0
Router(config-if)#no shu
Router(config-if)#no shutdown
Router(config-if)#interface s3/0
Router(config-if)#ip add 192.168.4.2 255.255.255.0
Router(config-if)#no shu
Router(config-if)#no shutdown
Router(config-if)#end
Router#
Router#show ip route
C 192.168.2.0/24 is directly connected, Serial2/0
C 192.168.4.0/24 is directly connected, Serial3/0
C 192.168.5.0/24 is directly connected, FastEthernet0/0
Router#conf t
Router(config)#ip rou
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1
Router(config)#ip route 192.168.6.0 255.255.255.0 192.168.4.1
Router(config)#end
Router#
Router#show ip rou
Router#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
Gateway of last resort is not set
S 192.168.1.0/24 [1/0] via 192.168.2.1
C 192.168.2.0/24 is directly connected, Serial2/0
C 192.168.4.0/24 is directly connected, Serial3/0
C 192.168.5.0/24 is directly connected, FastEthernet0/0
S 192.168.6.0/24 [1/0] via 192.168.4.1
Router#
路由器R3基本配置
Router>
Router>en
Router#conf t
Router(config)#interface f0/0
Router(config-if)#ip add 192.168.6.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#inter
Router(config)#interface s2/0
Router(config-if)#ip add 192.168.3.2 255.255.255.0
Router(config-if)#no sh
Router(config-if)#no shutdown
Router(config-if)#interface s3/0
Router(config-if)#ip add 192.168.4.1 255.255.255.0
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
Router(config-if)#end
Router#
Router#show ip route
C 192.168.3.0/24 is directly connected, Serial2/0
C 192.168.4.0/24 is directly connected, Serial3/0
C 192.168.6.0/24 is directly connected, FastEthernet0/0
Router#conf t
Router(config)#ip rou
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1
Router(config)#ip route 192.168.5.0 255.255.255.0 192.168.4.2
Router(config)#
最后测试三台PC是否可以ping通!如果通说明实验成功,如果不通要检查路由,检查网关等
原文地址:http://blog.51cto.com/ronning/2118893