第二篇:静态路由!

                         

 

 

 
建立如图机架模型,我这里用到的是GNS3模拟器!以后我也将利用这款模拟器来完成我们的学习教程!
 
-------------------------------------------------------------------------------------------------
第一步:基本IP通讯配置!
R1>en                                                  -------------进入特权模式
R1#conf t                                          ---------------进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int s0/0                              -----------------------进入接口
R1(config-if)#no sh                                  -----------------------激活接口
R1(config-if)#ip add 192.168.12.1 255.255.255.0                        ---------------------配置IP
R1(config-if)#clock rate 64000                                                                      -----------------------配置时钟
R1(config-if)#exit
R1(config)#int s0/1
R1(config-if)#no sh
R1(config-if)#ip add 192.168.13.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#end
R1#

--------------------------------------------------------------------------------------------------

R2>en
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int s0/0
R2(config-if)#no sh
R2(config-if)#ip add 192.168.12.2 255.255.255.0
R2(config-if)#exit
R2(config)#end
R2#

--------------------------------------------------------------------------------------------------

R3>en
R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#int s0/1
R3(config-if)#no sh
R3(config-if)#ip add 192.168.13.3 255.255.255.0
R3(config-if)#end
R3#

--------------------------------------------------------------------------------------------------

第二步:ping测试!
 

R3#ping 192.168.12.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R3#

--------------------------------------------------------------------------------------------------

R2#ping 192.168.13.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.13.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R2#

从上面可以看出,R2路由器 与 R3路由器互相ping测试未能ping通!出现“!”才算ping通!

--------------------------------------------------------------------------------------------------

第三步:查看路由表!

R1#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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.12.0/24 is directly connected, Serial0/0
C    192.168.13.0/24 is directly connected, Serial0/1              ---------------两条直连路由
R1#

-------------------------------------------------------------------------------------------------

R2#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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.12.0/24 is directly connected, Serial0/0
R2#

--------------------------------------------------------------------------------------------------

R3#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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.13.0/24 is directly connected, Serial0/1
R3#
--------------------------------------------------------------------------------------------------

第四步:配置静态路由!

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#ip route 192.168.13.0 255.255.255.0 192.168.12.1
R2(config)#end

--------------------------------------------------------------------------------------------------

R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#ip route 192.168.12.0 255.255.255.0 192.168.13.1
R3(config)#end
R3#

--------------------------------------------------------------------------------------------------

第五步:查看路由表!

R1#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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.12.0/24 is directly connected, Serial0/0
C    192.168.13.0/24 is directly connected, Serial0/1
R1#

--------------------------------------------------------------------------------------------------

R2#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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.12.0/24 is directly connected, Serial0/0
S    192.168.13.0/24 [1/0] via 192.168.12.1                         ---------------配置的静态路由
R2#
--------------------------------------------------------------------------------------------------

R3#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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.12.0/24 [1/0] via 192.168.13.1
C    192.168.13.0/24 is directly connected, Serial0/1
R3#

-------------------------------------------------------------------------------------------------

第六步:再次ping测试!

R3#ping 192.168.12.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/33/68 ms
R3#

-------------------------------------------------------------------------------------------------

R2#ping 192.168.13.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.13.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/43/80 ms
R2#

-------------------------------------------------------------------------------------------------

此教程到这里就结束了!如有什么问题请留言!我会尽快回复大家的!谢谢……


 

你可能感兴趣的:(CCNA)