|
r1 ÅäÖÃ
router>en router#conf t router(config)#host r1 r1(config)#no ip domain-lookup r1(config)#ban mot #Welcome to r1# r1(config)#ena sec 123 r1(config)#line vty 0 4 r1(config-line)#no login r1(config-line)#int f 0/0 r1(config-if)#des link to r3 r1(config-if)#ip add 192.168.3.1 255.255.255.0 r1(config-if)#no shut r1(config-if)#int f 1/0 r1(config-if)#des link to r2 r1(config-if)#ip add 192.168.4.1 255.255.255.0 r1(config-if)#no shut r1(config-if)#router ospf 1 r1(config-route)#network 192.168.4.0 0.0.0.255 area 0 r1(config-route)#network 192.168.3.0 0.0.0.255 area 0 r1(config-route)#end r1#
r2 ÅäÖÃ
router>en router#conf t router(config)#host r2 r2(config)#no ip domain-lookup r2(config)#ban mot #Welcome to r2# r2(config)#ena sec 123 r2(config)#line vty 0 4 r2(config-line)#no login r2(config-line)#int f 0/0 r2(config-if)#des link to r4 r2(config-if)#ip add 192.168.5.1 255.255.255.0 r2(config-if)#no shut r2(config-if)#int f 1/0 r2(config-if)#des link to r1 r2(config-if)#ip add 192.168.4.2 255.255.255.0 r2(config-if)#no shut r2(config-if)#router ospf 1 r2(config-route)#network 192.168.4.0 0.0.0.255 area 0 r2(config-route)#network 192.168.5.0 0.0.0.255 area 0 r2(config-route)#end r2#
r3 ÅäÖÃ
router>en router#conf t router(config)#host r3 r3(config)#no ip domain-lookup r3(config)#ban mot #Welcome to r3# r3(config)#ena sec 123 r3(config)#line vty 0 4 r3(config-line)#no login r3(config-line)#int f 0/0 r3(config-if)#des link to r5 r3(config-if)#ip add 192.168.2.1 255.255.255.0 r3(config-if)#no shut r3(config-if)#int f 1/0 r3(config-if)#des link to r1 r3(config-if)#ip add 192.168.3.2 255.255.255.0 r3(config-if)#no shut r3(config-if)#exit r3(config)#access-list 1 permit 192.168.4.0 0.0.0.255 r3(config)#access-list 1 permit 192.168.5.0 0.0.0.255 r3(config)#access-list 2 permit 192.168.1.0 0.0.0.255 r3(config)#access-list 2 permit 192.168.6.0 0.0.0.255 r3(config)#router ospf 1 r3(config-route)#network 192.168.3.0 0.0.0.255 area 0 r3(config-route)#redistribution rip metric 10 r3(config-route)#distance 130 r3(config-route)#distance 110 0.0.0.0 255.255.255.255 1 r3(config-route)#router rip r3(config-route)#redistribution ospf 1 metric 3 r3(config-route)#network 192.168.2.0 r3(config-route)#distance 130 r3(config-route)#distance 120 192.168.2.0 0.0.0.255 2 r3(config-route)#end r3#
r4 ÅäÖÃ
router>en router#conf t router(config)#host r4 r4(config)#no ip domain-lookup r4(config)#ban mot #Welcome to r4# r4(config)#ena sec 123 r4(config)#line vty 0 4 r4(config-line)#no login r4(config-line)#int f 0/0 r4(config-if)#des link to r5 r4(config-if)#ip add 192.168.6.2 255.255.255.0 r4(config-if)#no shut r4(config-if)#int f 1/0 r4(config-if)#des link to r2 r4(config-if)#ip add 192.168.5.2 255.255.255.0 r4(config-if)#no shut r4(config-if)#exit r4(config)#access-list 1 permit 192.168.3.0 0.0.0.255 r4(config)#access-list 1 permit 192.168.4.0 0.0.0.255 r4(config)#access-list 2 permit 192.168.1.0 0.0.0.255 r4(config)#access-list 2 permit 192.168.2.0 0.0.0.255 r4(config)#router ospf 1 r4(config-route)#network 192.168.5.0 0.0.0.255 area 0 r4(config-route)#redistribution rip metric 10 r4(config-route)#distance 130 r4(config-route)#distance 110 0.0.0.0 255.255.255.255 1 r4(config-route)#router rip r4(config-route)#redistribution ospf 1 metric 3 r4(config-route)#network 192.168.6.0 r4(config-route)#distance 130 r4(config-route)#distance 120 192.168.6.0 0.0.0.255 2 r4(config-route)#end r4#
r5 ÅäÖÃ
router>en router#conf t router(config)#host r1 r5(config)#no ip domain-lookup r5(config)#ban mot #Welcome to r5# r5(config)#ena sec 123 r5(config)#line vty 0 4 r5(config-line)#no login r5(config-line)#int f 0/0 r5(config-if)#des link to r4 r5(config-if)#ip add 192.168.6.1 255.255.255.0 r5(config-if)#no shut r5(config-if)#int f 1/0 r5(config-if)#des link to r3 r5(config-if)#ip add 192.168.2.2 255.255.255.0 r5(config-if)#no shut r5(config-if)#int lo0 r5(config-if)#des test network segment r5(config-if)#ip add 192.168.1.1 255.255.255.0 r5(config-if)#router rip r5(config-route)#network 192.168.2.0 r5(config-route)#network 192.168.6.0 r5(config-route)#network 192.168.1.0 r5(config-route)#end r5#
r1>en Password: r1#show run Building configuration...
Current configuration : 807 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname r1 ! boot-start-marker boot-end-marker ! enable secret 5 $1$f3QH$71t6moMVwG8cSWZkpd8.8. ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 description link to r3 ip address 192.168.3.1 255.255.255.0 duplex half ! interface FastEthernet1/0 description link to r2 ip address 192.168.4.1 255.255.255.0 duplex half ! router ospf 1 log-adjacency-changes network 192.168.3.0 0.0.0.255 area 0 network 192.168.4.0 0.0.0.255 area 0 ! ip classless no ip http server ! ! ! ! ! ! ! ! ! gatekeeper shutdown ! banner motd ^CWelcome to r1^C ! line con 0 stopbits 1 line aux 0 line vty 0 4 no login ! ! end
r1#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 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 route
Gateway of last resort is not set
C 192.168.4.0/24 is directly connected, FastEthernet1/0 O 192.168.5.0/24 [110/2] via 192.168.4.2, 00:06:28, FastEthernet1/0 O E2 192.168.6.0/24 [110/10] via 192.168.3.2, 00:04:23, FastEthernet0/0 O E2 192.168.1.0/24 [110/10] via 192.168.3.2, 00:04:02, FastEthernet0/0 O E2 192.168.2.0/24 [110/10] via 192.168.3.2, 00:04:02, FastEthernet0/0 C 192.168.3.0/24 is directly connected, FastEthernet0/0
r1#192.168.4.2 Trying 192.168.4.2 ... Open Welcome to r2 r2>en Password: r2#show run Building configuration...
Current configuration : 807 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname r2 ! boot-start-marker boot-end-marker ! enable secret 5 $1$UZo.$idqpYk8o3ubiucTw9IhLR/ ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 description link to r4 ip address 192.168.5.1 255.255.255.0 duplex half ! interface FastEthernet1/0 description link to r1 ip address 192.168.4.2 255.255.255.0 duplex half ! router ospf 1 log-adjacency-changes network 192.168.4.0 0.0.0.255 area 0 network 192.168.5.0 0.0.0.255 area 0 ! ip classless no ip http server ! ! ! ! ! ! ! ! ! gatekeeper shutdown ! banner motd ^CWelcome to r2^C ! line con 0 stopbits 1 line aux 0 line vty 0 4 no login ! ! end
r2#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 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 route
Gateway of last resort is not set
C 192.168.4.0/24 is directly connected, FastEthernet1/0 C 192.168.5.0/24 is directly connected, FastEthernet0/0 O E2 192.168.6.0/24 [110/10] via 192.168.5.2, 00:04:32, FastEthernet0/0 O E2 192.168.1.0/24 [110/10] via 192.168.5.2, 00:04:11, FastEthernet0/0 O E2 192.168.2.0/24 [110/10] via 192.168.5.2, 00:04:11, FastEthernet0/0 O 192.168.3.0/24 [110/2] via 192.168.4.1, 00:06:36, FastEthernet1/0
r2#192.168.3.2 Trying 192.168.3.2 ... Open Welcome to r3 r3>en Password: r3#show run Building configuration...
Current configuration : 1138 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname r3 ! boot-start-marker boot-end-marker ! enable secret 5 $1$tvCZ$7DL2XTJkbmcnflB0CN/yT0 ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 description link to 5 ip address 192.168.2.1 255.255.255.0 duplex half ! interface FastEthernet1/0 description link to r1 ip address 192.168.3.2 255.255.255.0 duplex half ! router ospf 1 log-adjacency-changes redistribute rip metric 10 network 192.168.3.0 0.0.0.255 area 0 distance 130 distance 110 0.0.0.0 255.255.255.255 1 ! router rip redistribute ospf 1 metric 3 network 192.168.2.0 distance 130 distance 120 192.168.2.0 0.0.0.255 2 ! ip classless no ip http server ! ! access-list 1 permit 192.168.4.0 0.0.0.255 access-list 1 permit 192.168.5.0 0.0.0.255 access-list 2 permit 192.168.1.0 0.0.0.255 access-list 2 permit 192.168.6.0 0.0.0.255 ! ! ! ! ! ! gatekeeper shutdown ! banner motd ^CWelcome to r3^C ! line con 0 stopbits 1 line aux 0 line vty 0 4 no login ! ! end
r3#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 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 route
Gateway of last resort is not set
O 192.168.4.0/24 [110/2] via 192.168.3.1, 00:13:34, FastEthernet1/0 O 192.168.5.0/24 [110/3] via 192.168.3.1, 00:13:34, FastEthernet1/0 R 192.168.6.0/24 [120/1] via 192.168.2.2, 00:00:52, FastEthernet0/0 R 192.168.1.0/24 [120/1] via 192.168.2.2, 00:00:52, FastEthernet0/0 C 192.168.2.0/24 is directly connected, FastEthernet0/0 C 192.168.3.0/24 is directly connected, FastEthernet1/0
r3#192.168.5.2 Trying 192.168.5.2 ... Open Welcome to r4 r4>en Password: r4#show run Building configuration...
Current configuration : 1139 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname r4 ! boot-start-marker boot-end-marker ! enable secret 5 $1$6w.P$9QBG4qawc/Bim0GTP8zCf1 ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 description link to r5 ip address 192.168.6.2 255.255.255.0 duplex half ! interface FastEthernet1/0 description link to r2 ip address 192.168.5.2 255.255.255.0 duplex half ! router ospf 1 log-adjacency-changes redistribute rip metric 10 network 192.168.5.0 0.0.0.255 area 0 distance 130 distance 110 0.0.0.0 255.255.255.255 1 ! router rip redistribute ospf 1 metric 3 network 192.168.6.0 distance 130 distance 120 192.168.6.0 0.0.0.255 2 ! ip classless no ip http server ! ! access-list 1 permit 192.168.3.0 0.0.0.255 access-list 1 permit 192.168.4.0 0.0.0.255 access-list 2 permit 192.168.1.0 0.0.0.255 access-list 2 permit 192.168.2.0 0.0.0.255 ! ! ! ! ! ! ! gatekeeper shutdown ! banner motd ^CWelcome to r4^C ! line con 0 stopbits 1 line aux 0 line vty 0 4 no login ! ! end
r4# 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 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 route
Gateway of last resort is not set
O 192.168.4.0/24 [110/2] via 192.168.5.1, 00:07:43, FastEthernet1/0 C 192.168.5.0/24 is directly connected, FastEthernet1/0 C 192.168.6.0/24 is directly connected, FastEthernet0/0 R 192.168.1.0/24 [120/1] via 192.168.6.1, 00:00:17, FastEthernet0/0 R 192.168.2.0/24 [120/1] via 192.168.6.1, 00:00:17, FastEthernet0/0 O 192.168.3.0/24 [110/3] via 192.168.5.1, 00:07:43, FastEthernet1/0
r4#192.168.2.2 Trying 192.168.2.2 ... Open Welcome to r5 r5>en Password: r5#show run Building configuration...
Current configuration : 862 bytes ! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname r5 ! boot-start-marker boot-end-marker ! enable secret 5 $1$oGSI$ilvTLHMMLLcE8KjA9xBbZ0 ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 description test network segment ip address 192.168.1.1 255.255.255.0 ! interface FastEthernet0/0 description link to r4 ip address 192.168.6.1 255.255.255.0 duplex half ! interface FastEthernet1/0 description link to r3 ip address 192.168.2.2 255.255.255.0 duplex half ! router rip network 192.168.1.0 network 192.168.2.0 network 192.168.6.0 ! ip classless no ip http server ! ! ! ! ! ! ! ! ! gatekeeper shutdown ! banner motd ^CWelcome to r5^C ! line con 0 stopbits 1 line aux 0 line vty 0 4 no login ! ! end
r5#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 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 route
Gateway of last resort is not set
R 192.168.4.0/24 [120/3] via 192.168.2.1, 00:00:11, FastEthernet1/0 [120/3] via 192.168.6.2, 00:00:19, FastEthernet0/0 R 192.168.5.0/24 [120/3] via 192.168.2.1, 00:00:11, FastEthernet1/0 [120/3] via 192.168.6.2, 00:00:19, FastEthernet0/0 C 192.168.6.0/24 is directly connected, FastEthernet0/0 C 192.168.1.0/24 is directly connected, Loopback0 C 192.168.2.0/24 is directly connected, FastEthernet1/0 R 192.168.3.0/24 [120/3] via 192.168.2.1, 00:00:11, FastEthernet1/0 [120/3] via 192.168.6.2, 00:00:19, FastEthernet0/0
r4#traceroute 192.168.3.2
Type escape sequence to abort. Tracing the route to 192.168.3.2
1 192.168.5.1 132 msec 92 msec 92 msec 2 192.168.4.1 212 msec 188 msec 188 msec 3 192.168.3.2 236 msec * 308 msec
r4#traceroute 192.168.1.1
Type escape sequence to abort. Tracing the route to 192.168.1.1
1 192.168.6.1 108 msec * 140 msec
r3#traceroute 192.168.5.2
Type escape sequence to abort. Tracing the route to 192.168.5.2
1 192.168.3.1 348 msec 240 msec 188 msec 2 192.168.4.2 284 msec 284 msec 284 msec 3 192.168.5.2 568 msec * 596 msec
r2#traceroute 192.168.1.1
Type escape sequence to abort. Tracing the route to 192.168.1.1
1 192.168.5.2 100 msec 116 msec 68 msec 2 192.168.6.1 164 msec * 188 msec
±¾Îijö×Ô ¡°ÈËÀàһ˼¿¼£¬Éϵ۶¼·¢Ð¦¡± ²©¿Í£¬×ªÔØÇëÓë×÷ÕßÁªÏµ£¡ ±¾Îijö×Ô 51CTO.COM¼¼Êõ²©¿Í |