Cisco路由器静态路由配置实例
初学路由器的配置,下面就用Boson NetSim for CCNP 6.1模拟软件进行配置…这篇文章主要是对路由表进行静态路由配置…
拓扑结构图如下:
下面开始:
1.对Router1进行配置,配置命令如下:
Router>enable进入特权模式
Router#configure terminal 进入配置模式
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface ethernet0 进入E0端口模式
Router(config-if)#ip address 192.168.1.1 255.255.255.0 配置IP地址Router(config-if)#no shutdown 激活该端口
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
Router(config-if)#exit 返回上一级
Router(config)#interface serial0 进入S0 端口模式
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial0, changed state to up
%LINK-3-UPDOWN: Interface Serial0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down
Router(config-if)#clock rate 6400 注意这里是设置时钟..如有不明白,可以打”?”.但是系统给的参数是 64000 .而我们要配置成 6400 ..可能是模拟软件的一个小BUG 吧!现在是在模拟软件中,如果是真实环境,我们要参照说
明书..按照说明书来配置参数….
Router(config-if)#exit
Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2 配置路由表
Router(config)#end 返回特权模式
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
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, * - candidate default
U - per-user static route
Gateway of last resort is not set
C 192.168.1.0 is directly connected, Ethernet0
S 192.168.3.0 [1/0] via 192.168.2.2
C 192.168.2.0 is directly connected, Serial0
2. 对Router2进行配置,配置命令如下:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#interface ethernet0
Router(config-if)#ip address 192.168.3.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up
Router(config-if)#exit
Router(config)#interface serial0
Router(config-if)#ip address 192.168.2.2 255.255.255.0
Router(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial0, changed state to up
/////在这儿我们就不用设置时钟了,在相连的两个路由器接口中,只要一个接口配置时钟就可以了
Router(config-if)#exit
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1
Router(config)#end
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
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, * - candidate default
U - per-user static route
Gateway of last resort is not set
C 192.168.3.0 is directly connected, Ethernet0
C 192.168.2.0 is directly connected, Serial0
S 192.168.1.0 [1/0] via 192.168.2.1
3.对计算机的配置..
IP地址和子网掩码还有网关上面的图上面的..
测试:PC1 ping PC3
C:>ping 192.168.3.2
Pinging 192.168.3.2 with 32 bytes of data:
Reply from 192.168.3.2: bytes=32 time=60ms TTL=241
Reply from 192.168.3.2: bytes=32 time=60ms TTL=241
Reply from 192.168.3.2: bytes=32 time=60ms TTL=241
Reply from 192.168.3.2: bytes=32 time=60ms TTL=241
Reply from 192.168.3.2: bytes=32 time=60ms TTL=241
Ping statistics for 192.168.3.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 50ms, Maximum = 60ms, Average = 55ms 静态路由表的配置完成..初学者…有错误希望大家指出…..。