十年匠心定制 · 商业建站与技术教学双线并行 咨询热线:400-886-1026 service@lmnt.cn
ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

Cisco路由-静态路由

Cisco路由-静态路由 # 概述静态路由(Static Routing)是由网络管理员手动配置的固定路由用于指定数据包传输路径不会自动更新或学习网络变化。适用于网络规模小、拓扑稳定。优点简单、可靠、安全不占用路由器CPU计算路径没有协议开销。缺点缺乏灵活性链路或设备故障时必须由管理员手动修改无法自动绕过。# 架构图# 配置命令一、基础信息配置R1配置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 12.1.1.1 255.255.255.0 R1(config-if)#int f1/0 R1(config-if)#no sh R1(config-if)#ip add 192.168.1.254 255.255.255.0 R1(config-if)#endR2配置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 12.1.1.2 255.255.255.0 R2(config-if)#int f1/0 R2(config-if)#no sh R2(config-if)#ip add 192.168.2.254 255.255.255.0 R2(config-if)#endPC1配置PC1#conf t Enter configuration commands, one per line. End with CNTL/Z. PC1(config)#int f0/0 PC1(config-if)#no shu PC1(config-if)#ip add 192.168.1.1 255.255.255.0 PC1(config-if)#end PC1(config)#no ip routing PC1(config)#ip default-gateway 192.168.1.254 PC1(config)#endPC2配置PC2#conf t Enter configuration commands, one per line. End with CNTL/Z. PC2(config)#int f0/0 PC2(config-if)#ip add 192.168.2.1 255.255.255.0 PC2(config-if)#no shu PC2(config-if)#end PC2(config)#no ip routing PC2(config)#ip default-gateway 192.168.2.254 PC2(config)#end二、配置静态路由方式一R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ip route 192.168.2.0 255.255.255.0 s0/0 R1(config)#end --- R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#ip route 192.168.1.0 255.255.255.0 s0/0 R2(config)#end方式二R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#no ip route 192.168.2.0 255.255.255.0 s0/0 R1(config)#end --- R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#no ip route 192.168.1.0 255.255.255.0 s0/0 R2(config)#end三、测试PC1#ping 192.168.2.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds: ..!!! Success rate is 60 percent (3/5), round-trip min/avg/max 132/160/184 ms
返回列表