实验三 静态路由与缺省路由的使用
一、实验环境:Windows7操作系统的计算机;
Boson Netsim for CCNA v6.0 805交换机
二、实验步骤;rt1接到pc1,rt2接到pc2,rt1到rt2选择点到点类型,rt2的serial0作为DCE端。配置如下:
(1)Router1配置:
Router>enable Router#config t
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname router1 router1(config)#ena se c1 router1(config)#vty 0 4 ^
% Invalid input detected at '^' marker.
router1(config)#line vty 0 4 router1(config-line)#login router1(config-line)#pass c2 router1(config-line)#int eth 0
router1(config-if)#ip address 192.168.1.1 255.255.255.0 router1(config-if)#no shut
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up router1(config-if)#int se 0
router1(config-if)#ip address 10.0.0.1 255.0.0.0 router1(config-if)#clock rate 64000 router1(config-if)#no shut
%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
router1(config-if)#end router1#copy run start
Destination filename [startup-config]? Building configuration... [OK]
(2)Router2配置:
Router>enable Router#config t
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#host router2 router2(config)#ena se c1 router2(config)#line vty 0 4 router2(config-line)#login router2(config-line)#pass c2 router2(config-line)#int eth 0
router2(config-if)#ip address 192.168.2.1 255.255.255.0 router2(config-if)#no shut
%LINK-3-UPDOWN: Interface Ethernet0, changed state to up router2(config-if)#int se 0
router2(config-if)#ip add 10.0.0.2 255.0.0.0 router2(config-if)#no shut
%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
router2(config-if)#end router2#copy run start
Destination filename [startup-config]? Building configuration... [OK]
(3)PC配置:
PC1 192.168.1.2 255.255.255.0 192.168.1.1 PC2 192.168.2.2 255.255.255.0 192.168.1.1
(4)配置,测试静态路由 在Rputer1中配置:
router1#ip route 192.168.2.0 255.255.255.0 10.0.0.2 ^
% Invalid input detected at '^' marker.
router1# ip router 192.168.2.0 255.255.255.0 10.0.0.2 ^
% Invalid input detected at '^' marker.
router1#config t
Enter configuration commands, one per line. End with CNTL/Z. router1(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2 router1(config)#end
router1#copy run start
Destination filename [startup-config]? Building configuration... [OK]
router1#
router1#show ip rpute ^
% Invalid input detected at '^' marker.
router1#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.2.0 [1/0] via 10.0.0.2
在Router2中配置:
router2# router2#
router2#config t
Enter configuration commands, one per line. End with CNTL/Z. router2(config)#ip route 192.168.1,0 255.255.255.0 10.0.0.1 % Invalid input detected at '^' marker.
router2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.1 router2(config)#end router2#copy run start
Destination filename [startup-config]? Building configuration... [OK]
router2#show ip rpute ^
% Invalid input detected at '^' marker.
router2#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