1、1静态路由静态路由(全网通)拓扑图如下:接口连接:Router1 S0/0 Router2 S0/0 Router3 S0/1 Router2 S0/1路由器参考配置如下:路由器R1的配置:Router /用户模式Routerenable /从用户模式进入到特权模式Router#configure terminal /从特权模式进入到全局模式Router(config)#hostname R1 /给路由器从命名为R1 R1(config)#no ip domain lookup /关闭域名查找R1(config)#line console 0 /进入控制口R1(config-line)#log
2、ging synchronous /光标跟随R1(config-line)#exec-timeout 0 0 /关闭延迟R1(config-line)#exitR1(config)#interface loopback 0 /配置接口ip地址R1(config-if)#ip address 1.1.1.1 255.255.255.0R1(config-if)#no shutdown /激活接口(此接口可不激活,但物理接口一定要激活)R1(config-if)#interface s0/0 /配置串口ip地址R1(config-if)#ip address 192.1.1.1 255.255.2
3、55.0R1(config-if)#no shutdown R1(config-if)#endR1#show 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 e
4、xternal 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 routeGateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connecte
5、d, Loopback0C 192.1.1.0/24 is directly connected, Serial0/0R1#configure terminalR1(config)#ip route 2.2.2.0 255.255.255.0 192.1.1.2/在全局模式下配置静态ip地址R1(config)#ip route 3.3.3.0 255.255.255.0 192.1.1.2R1(config)#ip route 193.1.1.0 255.255.255.0 192.1.1.2R1(config)#endR1#show ip routeCodes: C - connected
6、, 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-
7、IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not set/C是直联ip地址,S是静态ip地址 1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback0 2.0.0.0/24 is subnetted, 1 subnetsS 2.2.2.0 1/0 via 192.1.1.2
8、3.0.0.0/24 is subnetted, 1 subnetsS 3.3.3.0 1/0 via 192.1.1.2S 193.1.1.0/24 1/0 via 192.1.1.2C 192.1.1.0/24 is directly connected, Serial0/0R1#show running-config /查看配置的信息Building configuration.Current configuration : 858 bytes!version 12.4service timestamps debug datetime msecservice timestamps log
9、 datetime msecno service password-encryption!hostname R1!boot-start-markerboot-end-marker!no aaa new-modelmemory-size iomem 5!ip cef!no ip domain lookup! !interface Loopback0 ip address 1.1.1.1 255.255.255.0!interface Serial0/0 ip address 192.1.1.1 255.255.255.0 serial restart-delay 0!interface Seri
10、al0/1 no ip address shutdown serial restart-delay 0!interface Serial0/2 no ip address shutdown serial restart-delay 0!interface Serial0/3 no ip address shutdown serial restart-delay 0!ip http serverip route 2.2.2.0 255.255.255.0 192.1.1.2ip route 3.3.3.0 255.255.255.0 192.1.1.2ip route 193.1.1.0 255
11、.255.255.0 192.1.1.2!control-plane!line con 0 exec-timeout 0 0 logging synchronousline aux 0line vty 0 4!EndR1#路由器R2的配置:RouterRouterenableRouter#configure terminalRouter(config)#hostname R2R2(config)#no ip domain lookupR2(config)#line console 0R2(config-line)#logging synchronousR2(config-line)#exec-
12、timeout 0 0R2(config-line)#exitR2(config)#interface loopback 0R2(config-if)#ip address 2.2.2.2 255.255.255.0R2(config-if)#no shutdown R2(config-if)#interface s0/0R2(config-if)#ip address 192.1.1.2 255.255.255.0R2(config-if)#no shutdown R2(config-if)#interface s0/1R2(config-if)#ip address 193.1.1.2 2
13、55.255.255.0R2(config-if)#no shutdown R2(config-if)#endR2#show ip routeCodes: 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 ext
14、ernal 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 routeGateway of last resort is not set 2.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected,
15、 Loopback0C 193.1.1.0/24 is directly connected, Serial0/1C 192.1.1.0/24 is directly connected, Serial0/0R2#configure terminalR2(config)#ip route 1.1.1.0 255.255.255.0 192.1.1.1R2(config)#ip route 3.3.3.0 255.255.255.0 193.1.1.1R2(config)#exitR2#show ip routeCodes: C - connected, S - static, R - RIP,
16、 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, * - can
17、didate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsS 1.1.1.0 1/0 via 192.1.1.1 2.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected, Loopback0 3.0.0.0/24 is subnetted, 1 subnetsS 3.3.
18、3.0 1/0 via 193.1.1.1C 193.1.1.0/24 is directly connected, Serial0/1C 192.1.1.0/24 is directly connected, Serial0/0R2#show running-config Building configuration.Current configuration : 826 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password
19、-encryption!hostname R2!boot-start-markerboot-end-marker!no aaa new-modelmemory-size iomem 5!ip cef!no ip domain lookup! !interface Loopback0 ip address 2.2.2.2 255.255.255.0!interface Serial0/0 ip address 192.1.1.2 255.255.255.0 serial restart-delay 0!interface Serial0/1 ip address 193.1.1.2 255.25
20、5.255.0 serial restart-delay 0!interface Serial0/2 no ip address shutdown serial restart-delay 0!interface Serial0/3 no ip address shutdown serial restart-delay 0!ip http serverip route 1.1.1.0 255.255.255.0 192.1.1.1ip route 3.3.3.0 255.255.255.0 193.1.1.1!control-plane!line con 0 exec-timeout 0 0
21、logging synchronousline aux 0line vty 0 4!endR2#路由器R3的配置:RouterRouterenableRouter#configure terminalRouter(config)#hostname R3R3(config)#no ip domain lookupR3(config)#line console 0R3(config-line)#logging synchronousR3(config-line)#exec-timeout 0 0R3(config-line)#exitR3(config)#interface loopback 0R
22、3(config-if)#ip address 3.3.3.3 255.255.255.0R3(config-if)#no shutdown R3(config-if)#interface s0/0R3(config-if)#ip address 193.1.1.1 255.255.255.0R3(config-if)#no shutdown R3(config-if)#endR3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external,
23、 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
24、 - periodic downloaded static routeGateway of last resort is not set 3.0.0.0/24 is subnetted, 1 subnetsC 3.3.3.0 is directly connected, Loopback0C 193.1.1.0/24 is directly connected, Serial0/1R3#configure terminal R3(config)#ip route 1.1.1.0 255.255.255.0 193.1.1.2 R3(config)#ip route 2.2.2.0 255.25
25、5.255.0 193.1.1.2R3(config)#ip route 192.1.1.0 255.255.255.0 193.1.1.2R3(config)#endR3#show ip routeCodes: 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 e
26、xternal 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 routeGateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsS 1
27、.1.1.0 1/0 via 193.1.1.2 2.0.0.0/24 is subnetted, 1 subnetsS 2.2.2.0 1/0 via 193.1.1.2 3.0.0.0/24 is subnetted, 1 subnetsC 3.3.3.0 is directly connected, Loopback0C 193.1.1.0/24 is directly connected, Serial0/1S 192.1.1.0/24 1/0 via 193.1.1.2R3#show running-config Building configuration.Current conf
28、iguration : 858 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R3!boot-start-markerboot-end-marker!no aaa new-modelmemory-size iomem 5!ip cef!no ip domain lookup! !interface Loopback0 ip address 3.3.3.3 255.255.255.
29、0!interface Serial0/0 no ip address shutdown serial restart-delay 0!interface Serial0/1 ip address 193.1.1.1 255.255.255.0 serial restart-delay 0!interface Serial0/2 no ip address shutdown serial restart-delay 0!interface Serial0/3 no ip address shutdown serial restart-delay 0!ip http serverip route 1.1.1.0 255.255.255.0 193.1.1.2ip route 2.2.2.0 255.255.255.0 193.1.1.2ip route 192.1.1.0 255.255.255.0 193.1.1.2!control-plane!line con 0 exec-timeout 0 0 logging synchronousline aux 0line vty 0 4!endR3#最终可以实现全网通。2009-05-06
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1