Router>en
Router#conf t
Router(config)#hostname route0
route0(config)#int f0/0
route0(config-if)#ip ad 192.168.10.1 255.255.255.0
route0(config-if)#no sh
route0(config)#int s2/0
route0(config-if)#ip ad 192.168.20.1 255.255.255.0
route0(config-if)#no sh
route0(config-if)#clock rate 64000
因为路由器是背对背连接的,所以把两个背对背连接的串口其中一个设置为DCE route1:
Router>en
Router#conf t
Enter configuration commands,one per line. End with CNTL/Z.
Router(config)#hostname route1
route1(config)#int s2/0
route1(config-if)#ip ad 192.168.20.2 255.255.255.0
route1(config-if)#no sh
%link-5-CHANGED: Interface Serial2/0,changed state to up
route1(config-if)#int s3/0
route1(config-if)#ip ad 192.168.30.1 255.255.255.0
route1(config-if)#no sh
%link-5-CHANGED: Interface Serial3/0,changed state to down
route2:Router>en
Router#conf t
Enter configuration commands,one per line. End with CNTL/Z.
Router(config)#hostname route2
route2(config)#int s3/0
route2(config-if)#ip ad 192.168.30.2 255.255.255.0
route2(config-if)#no sh
%link-5-CHANGED: Interface Serial3/0,changed state to up
route2(config-if)#int f0/0
route2(config-if)#ip ad 192.168.40.1 255.255.255.0
route2(config-if)#no sh
%link-5-CHANGED: Interface FastEthernet0/0,changed state to up
%liNEPROTO-5-updown: line protocol on Interface FastEthernet0/0,changed state to up
配置route0静态路由:route0自己的网络192.168.10.0和192.168.20.0(直接相连),所以route0的路由表必须加入192.168.30.0和192.168.40.0的信息,注意下一跳接口(数据包经过的下一个接口),配置如下:
route0(config-if)#exit
route0(config)#ip route 192.168.30.0 255.255.255.0 192.168.20.2
说的通俗点就是要去192.168.30.0网络就要去找192.168.20.2接口发送数据包
route0(config)#ip route 192.168.40.0 255.255.255.0 192.168.20.2
要去192.168.40.0网络就要去找192.168.20.2接口发送数据包
route1要学习到的网络应该是192.168.10.0和192.168.40.0,配置如下:
route1(config-if)#exit
route1(config)#ip route 192.168.10.0 255.255.255.0 192.168.20.1
要去192.168.10.0这个网段的网络就要去找192.168.20.1接口发送数据包
route1(config)#ip route 192.168.40.0 255.255.255.0 192.168.30.2
要去192.168.40.0这个网段的网络就要去找192.168.30.2接口发送数据包
route2要学习到的网络应该是192.168.10.10和192.168.20.0,配置如下:
route2(config)#ip route 192.168.10.0 255.255.255.0 192.168.30.1
要去192.168.10.0这个网段的网络就要去找192.168.30.1接口发送数据包
route2(config)#ip route 192.168.20.0 255.255.255.0 192.168.30.1
要去192.168.20.0这个网段的网络就要去找192.168.30.1接口发送数据包
PC0 Ping PC1
route0#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
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.10.0/24 is directly connected,FastEthernet0/0C 192.168.20.0/24 is directly connected,Serial2/0S 192.168.30.0/24 [1/0] via 192.168.20.2S 192.168.40.0/24 [1/0] via 192.168.20.2上面输出中S代表静态路由,C代表直接相连,[1/0]分布为管理距离和度,via代表下一跳。
总结以上是内存溢出为你收集整理的Cisco Packet Tracer 静态路由配置全部内容,希望文章能够帮你解决Cisco Packet Tracer 静态路由配置所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)