OSPF综合试验
R1域配置
Router>ena
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip do lo
Router(config)#line co 0
Router(config-line)#pass cisco
Router(config-line)#login
Router(config-line)#no exec-t
Router(config-line)#logg s
Router(config-line)#ho r1
r1(config)#int lo 0
r1(config-if)#ip ad 1.1.1.1 255.255.255.0
r1(config-if)#int s2/2
r1(config-if)#ip ad 15.0.0.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#
*Jul  9 14:15:50.887: %LINK-3-UPDOWN: Interface Serial2/2, changed state to up
r1(config-if)#
*Jul  9 14:15:51.891: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to up
r1(config-if)#
*Jul  9 14:16:13.715: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to down
r1(config-if)#int s3/0
r1(config-if)#ip ad 192.168.0.1 255.255.255.0
r1(config-if)#en
r1(config-if)#encapsulation fram
r1(config-if)#ip ospf pr
r1(config-if)#ip ospf priority 0
r1(config-if)#fram
r1(config-if)#frame-relay map ip 192.168.0.2 102 b
r1(config-if)#frame-relay map ip 192.168.0.3 102 b
r1(config-if)#no fram inv
r1(config-if)#router ospf 100
r1(config-router)#net 1.1.1.1 0.0.0.0 a 0
r1(config-router)#net 15.0.0.1 0.0.0.0 a 0
r1(config-router)#net 192.168.0.1 0.0.0.0 a 123
r1(config-router)#
*Jul  9 14:41:13.695: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to up
r1(config-router)#
*Jul  9 14:42:37.199: %OSPF-5-ADJCHG: Process 100, Nbr 10.10.10.1 on Serial2/2 from LOADING to FULL, Loading Done
r1(config-router)#^Z
r1#
*Jul  9 14:43:47.143: %SYS-5-CONFIG_I: Configured from console by console
r1#
 
 
R2域配置
Router>ena
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip do lo
Router(config)#line co 0
Router(config-line)#pass cisco
Router(config-line)#login
Router(config-line)#no exec-t
Router(config-line)#logg s
Router(config-line)#ho r2
r2(config)#int lo 0
r2(config-if)#ip ad 2.2.0.2 255.255.255.0
r2(config-if)#int lo 1                  
r2(config-if)#ip ad 2.2.1.2 255.255.255.0
r2(config-if)#int lo 2                  
r2(config-if)#ip ad 2.2.2.2 255.255.255.0
r2(config-if)#int lo 3                  
r2(config-if)#ip ad 2.2.3.2 255.255.255.0
r2(config-if)#int f0/0
r2(config-if)#ip ad 172.16.0.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#
*Jul  9 14:24:54.307: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Jul  9 14:24:55.307: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
r2(config-if)#int s3/0
r2(config-if)#en fram
r2(config-if)#no sh
r2(config-if)#no fram
*Jul  9 14:25:23.827: %LINK-3-UPDOWN: Interface Serial3/0, changed state to up
r2(config-if)#no fram inv
r2(config-if)#int s3/0.1
*Jul  9 14:25:34.831: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/0, changed state to up
r2(config-if)#int s3/0.1 mu
r2(config-subif)#ip ad 192.168.0.2 255.255.255.0
r2(config-subif)#fram map ip 192.168.0.1 201 b
r2(config-subif)#fram map ip 192.168.0.3 203 b
r2(config-subif)#no fram inv
r2(config-subif)#no sh
r2(config-subif)#exit
r2(config)#router ospf 100
r2(config-router)#net 2.2.0.0 255.255.252.0 a 123
r2(config-router)#net 192.168.0.2 0.0.0.0 a 123
r2(config-router)#net 172.16.0.2 0.0.0.0 a 25
r2(config-router)#nei 192.168.0.3
r2(config-router)#nei 192.168.0.1
r2(config-router)#
*Jul  9 14:32:07.019: %OSPF-5-ADJCHG: Process 100, Nbr 0.0.0.0 on Serial3/0.1 from ATTEMPT to DOWN, Neighbor Down: Dead timer expired
*Jul  9 14:32:07.023: %OSPF-5-ADJCHG: Process 100, Nbr 0.0.0.0 on Serial3/0.1 from ATTEMPT to DOWN, Neighbor Down: Dead timer expired
r2(config-router)#
*Jul  9 14:38:04.179: %OSPF-5-ADJCHG: Process 100, Nbr 4.4.4.4 on FastEthernet0/0 from LOADING to FULL, Loading Done
r2(config-router)#
*Jul  9 14:42:54.267: %OSPF-5-ADJCHG: Process 100, Nbr 10.10.10.1 on FastEthernet0/0 from LOADING to FULL, Loading Done
r2(config-router)#^Z
r2#
*Jul  9 14:43:46.187: %SYS-5-CONFIG_I: Configured from console by console
r2#
 
 
R3域配置
Router>ena
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip do lo
Router(config)#line co 0
Router(config-line)#pass cisco
Router(config-line)#login
Router(config-line)#no exec-t
Router(config-line)#logg s
Router(config-line)#ho r3
r3(config)#int lo 0
r3(config-if)#ip ad 3.3.0.3 255.255.255.0
r3(config-if)#int lo 1                  
r3(config-if)#ip ad 3.3.1.3 255.255.255.0
r3(config-if)#int lo 2                  
r3(config-if)#ip ad 3.3.2.3 255.255.255.0
r3(config-if)#int lo 3                  
r3(config-if)#ip ad 3.3.3.3 255.255.255.0
r3(config-if)#int s2/2
r3(config-if)#ip ad 34.0.0.3 255.255.255.0
r3(config-if)#no sh
r3(config-if)#
*Jul  9 14:31:46.039: %LINK-3-UPDOWN: Interface Serial2/2, changed state to up
r3(config-if)#
*Jul  9 14:31:47.043: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to up
r3(config-if)#int s3/0
r3(config-if)#en fram
r3(config-if)#fram
*Jul  9 14:32:07.587: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to down
r3(config-if)#no fram
% Incomplete command.
 
r3(config-if)#no fram inv
r3(config-if)#ip ad 192.168.0.3 255.255.255.0
r3(config-if)#fram map ip 192.168.0.1 302 b
r3(config-if)#fram map ip 192.168.0.2 302 b
r3(config-if)#ip ospf pr 0
r3(config-if)#router ospf 100
r3(config-router)#net 34.0.0.3 0.0.0.0 a 34
r3(config-router)#net 192.168.0.3 0.0.0.0 a 123
r3(config-router)#^Z
r3#
*Jul  9 14:43:48.883: %SYS-5-CONFIG_I: Configured from console by console
r3#
 
R4域配置
Router>ena
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip do lo
Router(config)#line co 0
Router(config-line)#pass cisco
Router(config-line)#login
Router(config-line)#no exec-t
Router(config-line)#logg s
Router(config-line)#ho r4
r4(config)#int lo 0
r4(config-if)#ip ad 4.4.4.4 255.255.255.0
r4(config-if)#int f0/0
r4(config-if)#ip ad 172.16.0.4 255.255.255.0
r4(config-if)#no sh
r4(config-if)#ip o
*Jul  9 14:36:33.451: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Jul  9 14:36:34.451: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
r4(config-if)#ip ospf pr 0
r4(config-if)#router ospf 100
r4(config-router)#net 34.0.0.4 0.0.00.0 a 34
r4(config-router)#net 172.16.0.4 0.0.0.0 a 25
r4(config-router)#
*Jul  9 14:38:04.155: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.3.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
r4(config-router)#router rip
r4(config-router)#net 4.4.4.4
r4(config-router)#ve
r4(config-router)#version 2
r4(config-router)#^Z
r4#
*Jul  9 14:43:50.991: %SYS-5-CONFIG_I: Configured from console by console
r4#
R5域配置
Router>ena
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip do lo
Router(config)#line co 0
Router(config-line)#pass cisco
Router(config-line)#login
Router(config-line)#no exec-t
Router(config-line)#logg s
Router(config-line)#ho r5
r5(config)#int lo 0
r5(config-if)#ip ad 5.5.5.5 255.255.255.0
r5(config-if)#int lo 1
r5(config-if)#ip ad 10.10.10.1 255.255.255.0
r5(config-if)#int f0/0
r5(config-if)#ip ad 172.16.0.5 255.255.255.0
r5(config-if)#no sh
r5(config-if)#i
*Jul  9 14:40:18.027: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Jul  9 14:40:19.027: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
r5(config-if)#ip ospf pr 0
r5(config-if)#int s2/1
r5(config-if)#ip ad 15.0.0.5 255.255.255.0
r5(config-if)#no sh
r5(config-if)#
*Jul  9 14:41:04.707: %LINK-3-UPDOWN: Interface Serial2/1, changed state to up
r5(config-if)#
*Jul  9 14:41:05.711: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed state to up
r5(config-if)#router ospf 100
r5(config-router)#net 5.5.5.5 0.0.0.0 a 0
r5(config-router)#net 15.0.0.5 0.0.0.0 a 0
r5(config-router)#n
*Jul  9 14:42:32.071: %OSPF-5-ADJCHG: Process 100, Nbr 1.1.1.1 on Serial2/1 from LOADING to FULL, Loading Done
r5(config-router)#net 172.16.0.5 0.0.0.0 a 25
r5(config-router)#
*Jul  9 14:42:52.931: %OSPF-5-ADJCHG: Process 100, Nbr 2.2.3.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
r5(config-router)#de
r5(config-router)#default-i
r5(config-router)#default-information ori alw
r5(config-router)#^Z
r5#
*Jul  9 14:43:51.503: %SYS-5-CONFIG_I: Configured from console by console
r5#
 
 
 
 
 
域配置后R1的路由表
 
r1#sh ip rout
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 15.0.0.5 to network 0.0.0.0
 
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O       2.2.2.2/32 [110/5209] via 192.168.0.2, 00:00:19, Serial3/0
O       2.2.0.0/22 is a summary, 00:00:19, Null0
O       2.2.3.2/32 [110/5209] via 192.168.0.2, 00:00:19, Serial3/0
O       2.2.0.2/32 [110/5209] via 192.168.0.2, 00:00:19, Serial3/0
O       2.2.1.2/32 [110/5209] via 192.168.0.2, 00:00:19, Serial3/0
     3.0.0.0/22 is subnetted, 1 subnets
O E2    3.3.0.0 [110/0] via 192.168.0.3, 00:00:19, Serial3/0
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/1563] via 15.0.0.5, 00:00:19, Serial2/2
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.0.0 [110/1563] via 15.0.0.5, 00:00:20, Serial2/2
C    192.168.0.0/24 is directly connected, Serial3/0
     15.0.0.0/24 is subnetted, 1 subnets
C       15.0.0.0 is directly connected, Serial2/2
O*E2 0.0.0.0/0 [110/1] via 15.0.0.5, 00:00:20, Serial2/2
r1#
域配置后R2的路由表
r2#sh ip rout
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 172.16.0.5 to network 0.0.0.0
 
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/65] via 192.168.0.1, 00:04:34, Serial3/0.1
     2.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C       2.2.0.0/24 is directly connected, Loopback0
O IA    2.2.0.0/22 [110/5274] via 172.16.0.5, 00:04:34, FastEthernet0/0
C       2.2.1.0/24 is directly connected, Loopback1
C       2.2.2.0/24 is directly connected, Loopback2
C       2.2.3.0/24 is directly connected, Loopback3
     3.0.0.0/22 is subnetted, 1 subnets
O E2    3.3.0.0 [110/0] via 192.168.0.3, 00:04:24, Serial3/0.1
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/2] via 172.16.0.5, 00:04:34, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.0.0 is directly connected, FastEthernet0/0
C    192.168.0.0/24 is directly connected, Serial3/0.1
     15.0.0.0/24 is subnetted, 1 subnets
O IA    15.0.0.0 [110/65] via 172.16.0.5, 00:04:35, FastEthernet0/0
O*E2 0.0.0.0/0 [110/1] via 172.16.0.5, 00:04:25, FastEthernet0/0
r2#
域配置后R3的路由表
r3#sh 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 192.168.0.1 to network 0.0.0.0
 
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/65] via 192.168.0.1, 00:00:37, Serial3/0
     2.0.0.0/32 is subnetted, 4 subnets
O       2.2.2.2 [110/65] via 192.168.0.2, 00:00:37, Serial3/0
O       2.2.3.2 [110/65] via 192.168.0.2, 00:00:37, Serial3/0
O       2.2.0.2 [110/65] via 192.168.0.2, 00:00:37, Serial3/0
O       2.2.1.2 [110/65] via 192.168.0.2, 00:00:37, Serial3/0
     3.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C       3.3.0.0/24 is directly connected, Loopback0
O       3.3.0.0/22 is a summary, 00:05:31, Null0
C       3.3.1.0/24 is directly connected, Loopback1
C       3.3.2.0/24 is directly connected, Loopback2
C       3.3.3.0/24 is directly connected, Loopback3
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/1627] via 192.168.0.1, 00:00:38, Serial3/0
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.0.0 [110/1627] via 192.168.0.1, 00:00:38, Serial3/0
C    192.168.0.0/24 is directly connected, Serial3/0
     15.0.0.0/24 is subnetted, 1 subnets
O IA    15.0.0.0 [110/1626] via 192.168.0.1, 00:00:38, Serial3/0
O*E2 0.0.0.0/0 [110/1] via 192.168.0.1, 00:00:28, Serial3/0
r3#
域配置后R4的路由表
r4#sh ip rout
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 172.16.0.5 to network 0.0.0.0
 
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/66] via 172.16.0.5, 00:06:41, FastEthernet0/0
     2.0.0.0/22 is subnetted, 1 subnets
O IA    2.2.0.0 [110/5274] via 172.16.0.5, 00:00:43, FastEthernet0/0
     3.0.0.0/22 is subnetted, 1 subnets
O E2    3.3.0.0 [110/0] via 172.16.0.5, 00:00:38, FastEthernet0/0
     4.0.0.0/24 is subnetted, 1 subnets
C       4.4.4.0 is directly connected, Loopback0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/2] via 172.16.0.5, 01:00:45, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.0.0 is directly connected, FastEthernet0/0
O IA 192.168.0.0/24 [110/5273] via 172.16.0.5, 00:00:43, FastEthernet0/0
     15.0.0.0/24 is subnetted, 1 subnets
O IA    15.0.0.0 [110/65] via 172.16.0.5, 01:00:45, FastEthernet0/0
O*E2 0.0.0.0/0 [110/1] via 172.16.0.5, 00:00:38, FastEthernet0/0
 
域配置后R5的路由表
r5#sh 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
 
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/65] via 15.0.0.1, 00:03:57, Serial2/1
     2.0.0.0/22 is subnetted, 1 subnets
O IA    2.2.0.0 [110/129] via 15.0.0.1, 00:03:46, Serial2/1
     3.0.0.0/22 is subnetted, 1 subnets
O E2    3.3.0.0 [110/0] via 15.0.0.1, 00:02:34, Serial2/1
     5.0.0.0/24 is subnetted, 1 subnets
C       5.5.5.0 is directly connected, Loopback0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.0.0 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, Loopback1
O IA 192.168.0.0/24 [110/128] via 15.0.0.1, 00:03:40, Serial2/1
     15.0.0.0/24 is subnetted, 1 subnets
C       15.0.0.0 is directly connected, Serial2/1
r5#
 
R1上的配置信息
r1#sh run
Building configuration...
 
Current configuration : 1723 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
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
!
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 ip address 15.0.0.1 255.255.255.0
 ip ospf authentication message-digest //启用认证
 ip ospf message-digest-key 1 md5 cisco  //采用密文认证,密码为cisco
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 ip address 192.168.0.1 255.255.255.0
 encapsulation frame-relay  //封装帧中继
 ip ospf priority 0  //优先级设为0,保证R2永远为DR(也可在R2上做定义route-id为255.255.255.255)
 serial restart-delay 0
 frame-relay map ip 192.168.0.2 102 broadcast
 frame-relay map ip 192.168.0.3 102 broadcast
 no frame-relay inverse-arp
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
router ospf 100
 log-adjacency-changes
 no auto-cost
 area 123 range 2.2.0.0 255.255.252.0 //域间路由汇总
 area 123 virtual-link 2.2.3.2  //配置虚电路
 area 123 virtual-link 3.3.3.3  //配置虚电路
 network 1.1.1.1 0.0.0.0 area 0
 network 15.0.0.1 0.0.0.0 area 0
 network 192.168.0.1 0.0.0.0 area 123
!
ip classless
no ip http server
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 password cisco
 logging synchronous
 login
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
!
!
end
 
r1#
 
R2上的配置信息
 
r2#sh run
Building configuration...
 
Current configuration : 2010 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
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
interface Loopback0
 ip address 2.2.0.2 255.255.255.0
!
interface Loopback1
 ip address 2.2.1.2 255.255.255.0
!
interface Loopback2
 ip address 2.2.2.2 255.255.255.0
!
interface Loopback3
 ip address 2.2.3.2 255.255.255.0
!
interface FastEthernet0/0
 ip address 172.16.0.2 255.255.255.0
 duplex half
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 no ip address
 encapsulation frame-relay  //封装帧中继
 serial restart-delay 0
 no frame-relay inverse-arp  //关闭IARP
!
interface Serial3/0.1 multipoint
 ip address 192.168.0.2 255.255.255.0
 frame-relay map ip 192.168.0.1 201 broadcast
 frame-relay map ip 192.168.0.3 203 broadcast
 no frame-relay inverse-arp
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
router ospf 100
 log-adjacency-changes
area 25 virtual-link 10.10.10.1
area 123 virtual-link 1.1.1.1
 network 2.2.0.2 0.0.0.0 area 123
 network 2.2.1.2 0.0.0.0 area 123
 network 2.2.2.2 0.0.0.0 area 123
 network 2.2.3.2 0.0.0.0 area 123
 network 172.16.0.2 0.0.0.0 area 25
 network 192.168.0.2 0.0.0.0 area 123
 neighbor 192.168.0.3
 neighbor 192.168.0.1
!
ip classless
no ip http server
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 password cisco
 logging synchronous
 login
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
!        
!
End
 
 
R3上的配置信息
 
r3#sh run
Building configuration...
 
Current configuration : 1814 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
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
interface Loopback0
 ip address 3.3.0.3 255.255.255.0
!
interface Loopback1
 ip address 3.3.1.3 255.255.255.0
!
interface Loopback2
 ip address 3.3.2.3 255.255.255.0
!
interface Loopback3
 ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 ip address 34.0.0.3 255.255.255.0
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 ip address 192.168.0.3 255.255.255.0
 encapsulation frame-relay 
 ip ospf priority 0
 serial restart-delay 0
 frame-relay map ip 192.168.0.1 302 broadcast
 frame-relay map ip 192.168.0.2 302 broadcast
 no frame-relay inverse-arp
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
router eigrp 100
 network 3.0.0.0
 no auto-summary
!
router ospf 100
 log-adjacency-changes
 area 34 nssa
 area 123 virtual-link 1.1.1.1
 summary-address 3.3.0.0 255.255.252.0 //域外路由汇总
 redistribute eigrp 100 metric 0 subnets //重分布EIGRP到OSPF里
 network 34.0.0.3 0.0.0.0 area 34
 network 192.168.0.3 0.0.0.0 area 123
!
ip classless
no ip http server
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 password cisco
 logging synchronous
 login
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
!
!
end
 
r3#
 
R4上的配置信息
 
r4#sh run
Building configuration...
 
Current configuration : 1373 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
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
!
interface Loopback0
 ip address 4.4.4.4 255.255.255.0
!
interface FastEthernet0/0
 ip address 172.16.0.4 255.255.255.0
 ip ospf priority 0
 duplex half
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 ip address 34.0.0.4 255.255.255.0
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
router ospf 100
 log-adjacency-changes
 area 34 nssa   //NSSA区域
 network 34.0.0.4 0.0.0.0 area 34
 network 172.16.0.4 0.0.0.0 area 25
!
router rip
 version 2
 network 4.0.0.0
!        
ip classless
no ip http server
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 password cisco
 logging synchronous
 login
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
!
!
end
 
r4#
 
 
R5上的配置信息
r5#sh run
Building configuration...
 
Current configuration : 1585 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
!
!
no aaa new-model
ip subnet-zero
!
!
ip cef
no ip domain lookup
!
!
!
!
interface Loopback0
 ip address 5.5.5.5 255.255.255.0
!
interface Loopback1
 ip address 10.10.10.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 172.16.0.5 255.255.255.0
 ip ospf priority 0
 duplex half
!        
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 ip address 15.0.0.5 255.255.255.0
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 cisco
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial3/3
 no ip address
 shutdown
 serial restart-delay 0
!
router ospf 100
 log-adjacency-changes
 area 25 virtual-link 2.2.3.2
 area 25 virtual-link 2.2.2.2
 network 5.5.5.5 0.0.0.0 area 0
 network 15.0.0.5 0.0.0.0 area 0
 network 172.16.0.5 0.0.0.0 area 25
 default-information originate always //创建默认路由
!
ip classless
no ip http server
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 password cisco
 logging synchronous
 login
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
!
!
end
 
虚电路配置
r1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
r1(config)#router ospf 100
r1(config-router)#area 123 virtual-link ?
  A.B.C.D  ID (IP addr) associated with virtual link neighbor
 
r1(config-router)#area 123 virtual-link 2.2.3.2 ?
  authentication       Set authentication type
  authentication-key   Set authentication key
  dead-interval        Dead router detection time
  hello-interval       Hello packet interval
  message-digest-key   Set message digest key
  retransmit-interval  LSA retransmit interval
  transmit-delay       LSA transmission delay
  <cr>
 
r1(config-router)#area 123 virtual-link 2.2.3.2
r1(config-router)#area 123 virtual-link 3.3.3.3
r1(config-router)#^Z
 
 
 
 
 
 
r2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
r2(config)#router ospf 100
r2(config-router)#ar 123 v 1.1.1.1
r2(config-router)#ar 25 v 10.10.10.1
r2(config-router)#^Z
r2#
*Jul  9 16:00:07.035: %SYS-5-CONFIG_I: Configured from console by console
r2#
 
r1#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial2/0                  unassigned      YES unset  administratively down down   
Serial2/1                  unassigned      YES unset  administratively down down   
Serial2/2                  15.0.0.1        YES manual administratively down down   
Serial2/3                  unassigned      YES unset  administratively down down   
Serial3/0                  192.168.0.1     YES manual up                    up     
Serial3/1                  unassigned      YES unset  administratively down down   
Serial3/2                  unassigned      YES unset  administratively down down   
Serial3/3                  unassigned      YES unset  administratively down down   
Loopback0                  1.1.1.1         YES manual up                    up     
r1#ping 5.5.5.5
//R1和R5之间断开依然可ping通5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/64/116 ms
r1#
配置完成后的路由表信息,且都可ping通10.10.10.1
R1
r1#sh ip rout
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 15.0.0.5 to network 0.0.0.0
 
     34.0.0.0/24 is subnetted, 1 subnets
O IA    34.0.0.0 [110/5272] via 192.168.0.3, 00:07:20, Serial3/0
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O       2.2.2.2/32 [110/5209] via 192.168.0.2, 00:31:18, Serial3/0
O       2.2.0.0/22 is a summary, 00:31:18, Null0
O       2.2.3.2/32 [110/5209] via 192.168.0.2, 00:31:18, Serial3/0
O       2.2.0.2/32 [110/5209] via 192.168.0.2, 00:31:18, Serial3/0
O       2.2.1.2/32 [110/5209] via 192.168.0.2, 00:31:18, Serial3/0
     3.0.0.0/22 is subnetted, 1 subnets
O E2    3.3.0.0 [110/0] via 192.168.0.3, 00:03:19, Serial3/0
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/1563] via 15.0.0.5, 00:07:21, Serial2/2
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.0.0 [110/1563] via 15.0.0.5, 00:07:21, Serial2/2
C    192.168.0.0/24 is directly connected, Serial3/0
     15.0.0.0/24 is subnetted, 1 subnets
C       15.0.0.0 is directly connected, Serial2/2
O*E2 0.0.0.0/0 [110/1] via 15.0.0.5, 00:07:10, Serial2/2
r1#ping 10.10.10.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/49/112 ms
r1#
R2
r2#sh 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 172.16.0.5 to network 0.0.0.0
 
     34.0.0.0/24 is subnetted, 1 subnets
O IA    34.0.0.0 [110/5336] via 192.168.0.1, 00:07:46, Serial3/0.1
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/65] via 192.168.0.1, 00:07:46, Serial3/0.1
     2.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C       2.2.0.0/24 is directly connected, Loopback0
O IA    2.2.0.0/22 [110/5273] via 192.168.0.1, 00:07:46, Serial3/0.1
C       2.2.1.0/24 is directly connected, Loopback1
C       2.2.2.0/24 is directly connected, Loopback2
C       2.2.3.0/24 is directly connected, Loopback3
     3.0.0.0/22 is subnetted, 1 subnets
O E2    3.3.0.0 [110/0] via 192.168.0.3, 00:03:45, Serial3/0.1
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/2] via 172.16.0.5, 00:07:46, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.0.0 is directly connected, FastEthernet0/0
C    192.168.0.0/24 is directly connected, Serial3/0.1
     15.0.0.0/24 is subnetted, 1 subnets
O       15.0.0.0 [110/65] via 172.16.0.5, 00:07:47, FastEthernet0/0
O*E2 0.0.0.0/0 [110/1] via 172.16.0.5, 00:07:37, FastEthernet0/0
r2#ping 10.10.10.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/45/84 ms
r2#
 
R3
r3#sh 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 192.168.0.1 to network 0.0.0.0
 
     34.0.0.0/24 is subnetted, 1 subnets
C       34.0.0.0 is directly connected, Serial2/2
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/65] via 192.168.0.1, 00:02:01, Serial3/0
     2.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O       2.2.2.2/32 [110/65] via 192.168.0.2, 00:02:01, Serial3/0
O IA    2.2.0.0/22 [110/5273] via 192.168.0.1, 00:01:26, Serial3/0
O       2.2.3.2/32 [110/65] via 192.168.0.2, 00:02:01, Serial3/0
O       2.2.0.2/32 [110/65] via 192.168.0.2, 00:02:01, Serial3/0
O       2.2.1.2/32 [110/65] via 192.168.0.2, 00:02:01, Serial3/0
     3.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C       3.3.0.0/24 is directly connected, Loopback0
O       3.3.0.0/22 is a summary, 00:01:25, Null0
C       3.3.1.0/24 is directly connected, Loopback1
C       3.3.2.0/24 is directly connected, Loopback2
C       3.3.3.0/24 is directly connected, Loopback3
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/1627] via 192.168.0.1, 00:02:02, Serial3/0
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.0.0 [110/1627] via 192.168.0.1, 00:01:27, Serial3/0
C    192.168.0.0/24 is directly connected, Serial3/0
     15.0.0.0/24 is subnetted, 1 subnets
O       15.0.0.0 [110/1626] via 192.168.0.1, 00:02:02, Serial3/0
O*E2 0.0.0.0/0 [110/1] via 192.168.0.1, 00:01:27, Serial3/0
r3#ping 10.10.10.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/64/84 ms
r3#
 
R4
r4#sh 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 172.16.0.5 to network 0.0.0.0
 
     34.0.0.0/24 is subnetted, 1 subnets
C       34.0.0.0 is directly connected, Serial2/1
     1.0.0.0/32 is subnetted, 1 subnets
O IA    1.1.1.1 [110/66] via 172.16.0.2, 00:00:05, FastEthernet0/0
                [110/66] via 172.16.0.5, 00:00:05, FastEthernet0/0
     2.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O IA    2.2.2.2/32 [110/2] via 172.16.0.2, 00:00:05, FastEthernet0/0
O IA    2.2.0.0/22 [110/5274] via 172.16.0.2, 00:00:05, FastEthernet0/0
                   [110/5274] via 172.16.0.5, 00:00:05, FastEthernet0/0
O IA    2.2.3.2/32 [110/2] via 172.16.0.2, 00:00:05, FastEthernet0/0
O IA    2.2.0.2/32 [110/2] via 172.16.0.2, 00:00:05, FastEthernet0/0
O IA    2.2.1.2/32 [110/2] via 172.16.0.2, 00:00:05, FastEthernet0/0
     3.0.0.0/22 is subnetted, 1 subnets
O N2    3.3.0.0 [110/0] via 34.0.0.3, 00:00:06, Serial2/1
     4.0.0.0/24 is subnetted, 1 subnets
C       4.4.4.0 is directly connected, Loopback0
     5.0.0.0/32 is subnetted, 1 subnets
O IA    5.5.5.5 [110/2] via 172.16.0.5, 00:00:06, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.0.0 is directly connected, FastEthernet0/0
O IA 192.168.0.0/24 [110/65] via 172.16.0.2, 00:00:06, FastEthernet0/0
     15.0.0.0/24 is subnetted, 1 subnets
O IA    15.0.0.0 [110/65] via 172.16.0.5, 00:00:06, FastEthernet0/0
O*E2 0.0.0.0/0 [110/1] via 172.16.0.5, 00:00:06, FastEthernet0/0
r4#ping 10.10.10.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/47/72 ms
r4#
 
R5
 
r5#sh ip rout
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
 
     34.0.0.0/24 is subnetted, 1 subnets
O IA    34.0.0.0 [110/5336] via 15.0.0.1, 00:04:36, Serial2/1
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/65] via 15.0.0.1, 00:04:36, Serial2/1
     2.0.0.0/22 is subnetted, 1 subnets
O IA    2.2.0.0 [110/130] via 172.16.0.5, 00:00:17, FastEthernet0/0
     3.0.0.0/22 is subnetted, 1 subnets
O E2    3.3.0.0 [110/0] via 15.0.0.1, 00:00:35, Serial2/1
     5.0.0.0/24 is subnetted, 1 subnets
C       5.5.5.0 is directly connected, Loopback0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.0.0 is directly connected, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, Loopback1
O IA 192.168.0.0/24 [110/65] via 172.16.0.2, 00:04:36, FastEthernet0/0
     15.0.0.0/24 is subnetted, 1 subnets
C       15.0.0.0 is directly connected, Serial2/1
r5#ping 10.10.10.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms
r5#
// 由于忘记重分布rip所以表中没有4.0.0.0 的路由,重分布后就可以看到
 
实验总结:
1、均能实验的8个要求:
(1)    实现全网互通
(2)    在R1、R5断开仍可实现全网互通
(3)    R2永远为DR
(4)    Area34 为 NSSA 区域
(5)    Area0 只出现2.2.0.0/22的路由条目
(6)    除R3为其它Router上均有3.3.0.0/22
(7)    Area0 的域内接口做了密文认证
(8)    R5上产生一条默认路由
2、所涉及到的知识点:
   (1)虚链路的搭建:共搭建了3条虚链路,分别为:R1----R3、R1---R2、R2---R5
(area area-id irtual-link route-id)
   (2)重分布两个:将EIGRP和RIP分别在OSPF中进行了重分布
   (3)帧中继的配置Hub-and-Spoke 点到多点子接口:在R1/R2/R3,即area123上进行搭建
   (4)路由汇总两次:在R3上进行域×××总(summary-add address mask ),在R1上进行域间汇总(area area-id renge adderss mask cost cost)
   (5)单区域和多区域的OSPF
   (6)DR/BDR选举:通过设定R1/R3/R4/R5的优先级,保持R2始终是DR
   (7)area34 配置为NSSA 区域(area area-id nssa)
   (8)默认路由:在R5上使用default-information origanate always来产生
   (9)在OSPF Area0内进行密文认证(ip ospf authentication message-digest
          ip ospf message-digest-key 1 md5 cisco)
   
问题:(1)是否可以用点到点子接口
     (2)为什么要搭建3条虚电路,搭建2条是否可以。
     (3)为什么不可以在lo 接口上配置255.255.255.254 的ip地址
(Not a valid host address - 255.255.255.254 什么原因)