1、OSPF域间汇总 实验目的:了解并掌握域间汇总的配置 实验拓扑图: 基本配置 R1(config)#int s2/1 R1(config-if)#ip ad 12.0.0.1 255.255.255.0 R1(config-if)#int lo 0 R1(config-if)#ip ad 1.1.0.1 255.255.255.0 R1(config-if)#int lo 1 R1(config-if)#ip ad 1.1.1.1 255.255.255.0 R1(config-if)#int lo 2 R1(config-if)#ip ad 1.1.2.1 255.
2、255.255.0 R1(config-if)#int lo 3 R1(config-if)#ip ad 1.1.3.1 255.255.255.0 R1(config-if)#int s2/1 R1(config-if)#no sh R1(config-if)# 00:02:54: %LINK-3-UPDOWN: Interface Serial2/1, changed state to up R1(config-if)# 00:02:55: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed
3、state to up R1(config-if)#router ospf 10 R1(config-router)#net 12.0.0.0 0.0.0.255 a 0 R1(config-router)#no net 12.0.0.0 0.0.0.255 a 0 R1(config-router)#net 12.0.0.0 0.0.0.255 a 1 R1(config-router)#net 1.1.0.0 0.0.0.255 a 1 R1(config-router)#net 1.1.1.0 0.0.0.255 a 1 R1(config-router)#net 1.1.
4、2.0 0.0.0.255 a 1 R1(config-router)#net 1.1.3.0 0.0.0.255 a 1 R2(config)#int s2/1 R2(config-if)#ip ad 12.0.0.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#int s2/2 R2(config-if)# 00:02:53: %LINK-3-UPDOWN: Interface Serial2/1, changed state to up R2(config-if)#ip ad 00:02:54: %LINEPROT
5、O-5-UPDOWN: Line protocol on Interface Serial2/1, changed state to up R2(config-if)#ip ad 23.0.0.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#int lo 0 00:03:05: %LINK-3-UPDOWN: Interface Serial2/2, changed state to up R2(config-if)#int lo 0 R2(config-if)#ip ad 00:03:06: %LINEPROTO-5-UPD
6、OWN: Line protocol on Interface Serial2/2, changed state to up R2(config-if)#ip ad 2.2.2.2 255.255.255.0 R2(config-if)# 00:03:33: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2, changed state to down R2(config-if)# 00:03:43: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/2,
7、changed state to up R2(config-if)#router ospf 10 R2(config-router)#net 12.0.0.0 0.0.0.255 a 1 R2(config-router)#net 2.2.2.2 0.0.0.0 a 00:05:35: %OSPF-5-ADJCHG: Process 10, Nbr 1.1.3.1 on Serial2/1 from LOADING to FULL, Loading Done R2(config-router)#net 2.2.2.2 0.0.0.0 a 0 R2(config-router)#ne
8、t 23.0.0.0 0.0.0.255 a 0 R3(config-if)#int s2/1 R3(config-if)#ip ad 23.0.0.3 255.255.255.0 R3(config-if)#no sh R3(config-if)# 00:03:41: %LINK-3-UPDOWN: Interface Serial2/1, changed state to up R3(config-if)# 00:03:42: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed state
9、to up R3(config-if)#int lo 0 R3(config-if)#ip ad 3.3.3.3 255.255.255.0 R3(config-if)#router ospf 10 R3(config-router)#net 23.0.0.0 0.0.0.255 a 0 R3(config-router)#int s/2 ^ % Invalid input detected at '^' marker. R3(config)# 00:07:07: %OSPF-5-ADJCHG: Process 10, Nbr
10、 2.2.2.2 on Serial2/1 from LOADING to FULL, Loading Done R3(config)#int s2/2 R3(config-if)#ip ad 34.0.0.03 255.255.255.0 R3(config-if)#no sh R3(config-if)#router o 00:07:23: %LINK-3-UPDOWN: Interface Serial2/2, changed state to upso R3(config-if)#router oso 00:07:24: %LINEPROTO-5-UPDOWN: Line
11、 protocol on Interface Serial2/2, changed state to up R3(config-if)#router ospf 10 R3(config-router)#net 34.0.0.0 0.0.0.255 a 2 R4(config)#int s2/1 R4(config-if)#ip ad 34.0.0.4 255.255.255.0 R4(config-if)#no sh R4(config-if)#int lo 0 R4(config-if)#ip ad 4.4.4.4 255.255.255.0 R4(config-if
12、)#router ospf 10 R4(config-router)#net 34.0.0.0 0.0.0.255 a 2 R4(config-router)#net 4.4.4.4 0.0.0.0 a 2 在R3、R4之间搭建一条虚链路, R3(config-router)#area 2 vir R3(config-router)#area 2 virtual-link 4.4.4.4 4.4.4.4为对端router-id,且在配之前双方都能ping通对端的router-id,这样虚链路就可以搭建起来。 R4(config)#router ospf 10 R4(con
13、fig-router)#area 2 virtual-link 3.3.3.3 R3#show ip ospf virtual-links Virtual Link OSPF_VL2 to router 4.4.4.4 is up Run as demand circuit DoNotAge LSA allowed. Transit area 2, via interface Serial2/2, Cost of using 64 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals
14、 configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:08 Adjacency State FULL (Hello suppressed) Index 2/3, retransmission queue length 1, number of retransmission 1 First 0x62C1C520(22)/0x0(0) Next 0x62C1C520(22)/0x0(0) Last retransmission scan length is
15、1, maximum is 1 Last retransmission scan time is 0 msec, maximum is 0 msec Link State retransmission due in 1516 msec R4#show ip ospf virtual-links Virtual Link OSPF_VL3 to router 3.3.3.3 is up Run as demand circuit DoNotAge LSA allowed. Transit area 2, via interface Serial2/1, Cos
16、t of using 64 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:03 Adjacency State FULL (Hello suppressed) Index 1/2, retransmission queue length 0, number of retransmission 0 First 0x0(0)/
17、0x0(0) Next 0x0(0)/0x0(0) Last retransmission scan length is 0, maximum is 0 Last retransmission scan time is 0 msec, maximum is 0 msec R3#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
18、area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 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, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR
19、 P - periodic downloaded static route Gateway of last resort is not set 34.0.0.0/24 is subnetted, 1 subnets C 34.0.0.0 is directly connected, Serial2/2 1.0.0.0/22 is subnetted, 1 subnets O IA 1.1.0.0 [110/129] via 23.0.0.2, 00:00:08, Serial2/1 2.0.0.0/32 is subnett
20、ed, 1 subnets O 2.2.2.2 [110/65] via 23.0.0.2, 00:00:08, Serial2/1 3.0.0.0/24 is subnetted, 1 subnets C 3.3.3.0 is directly connected, Loopback0 4.0.0.0/32 is subnetted, 1 subnets O 4.4.4.4 [110/65] via 34.0.0.4, 00:00:18, Serial2/2 5.0.0.0/32 is subnetted, 1 s
21、ubnets O IA 5.5.5.5 [110/129] via 34.0.0.4, 00:00:08, Serial2/2 通过虚链路,可以把几个区域互通起来 23.0.0.0/24 is subnetted, 1 subnets C 23.0.0.0 is directly connected, Serial2/1 12.0.0.0/24 is subnetted, 1 subnets O IA 12.0.0.0 [110/128] via 23.0.0.2, 00:00:09, Serial2/1 45.0.0.0/2
22、4 is subnetted, 1 subnets O IA 45.0.0.0 [110/128] via 34.0.0.4, 00:00:09, Serial2/2 我们在R3上给虚链路配置明文认证 R3(config-router)#area 2 virtual-link 4.4.4.4 authentication-key ? <0-7> Encryption type (0 for not yet encrypted, 7 for proprietary) LINE Authentication key (8 chars) R3(config-r
23、outer)#area 2 virtual-link 4.4.4.4 authentication-key shendu R3(config-router)#area 2 virtual-link 4.4.4.4 authentication ? authentication Set authentication type authentication-key Set authentication key dead-interval Dead router detection time hello-interval Hello
24、 packet interval
message-digest Message-digest authentication
message-digest-key Set message digest key
null No authentication
retransmit-interval LSA retransmit interval
transmit-delay LSA transmission delay
25、ink 4.4.4.4 authentication 启用认证,R4不配 R3(config-router)#^Z R3#ping 4.4.4.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 180/339/536 ms R3#debug ip ospf ajd
26、^ % Invalid input detected at '^' marker. R3#debug ip ospf adj OSPF adjacency events debugging is on R3#clear ip ospf pro Reset ALL OSPF processes? [no]: y R3# 02:00:41: OSPF: Interface OSPF_VL2 going Down 02:00:41: OSPF: 3.3.3.3 address 0.0.0.0 on OSPF_VL2 is dead, state DOWN 02:00:41: O
27、SPF: 4.4.4.4 address 34.0.0.4 on OSPF_VL2 is dead, state DOWN 02:00:41: %OSPF-5-ADJCHG: Process 10, Nbr 4.4.4.4 on OSPF_VL2 from FULL to DOWN, Neighbor Down: Interface down or detached 02:00:41: OSPF: Interface Loopback0 going Down 02:00:41: OSPF: 3.3.3.3 address 3.3.3.3 on Loopback0 is dead, sta
28、te DOWN 02:00:41: OSPF: Interface Serial2/1 going Down 02:00:41: OSPF: 3.3.3.3 address 23.0.0.3 on Serial2/1 is dead, state DOWN 02:00:41: OSPF: 2.2.2.2 address 23.0.0.2 on Serial2/1 is dead, state DOWN 02:00:41: %OSPF-5-ADJCHG: Process 10, Nbr 2.2.2.2 on Serial2/1 from FULL to DOWN, Neighbor Do
29、wn: Interface down or detached 02:00:41: OSPF: Interface Serial2/2 going Down 02:00:41: OSPF: 3.3.3.3 address 34.0.0.3 on Serial2/2 is dead, state DOWN 02:00:41: OSPF: 4.4.4.4 address 34.0.0.4 on Serial2/2 is dead, state DOWN 02:00:41: %OSPF-5-ADJCHG: Process 10 R3#, Nbr 4.4.4.4 on Serial2/2 fr
30、om FULL to DOWN, Neighbor Down: Interface down or detached 02:00:42: OSPF: Interface Loopback0 going Up 02:00:42: OSPF: Interface Serial2/1 going Up 02:00:42: OSPF: Interface Serial2/2 going Up 02:00:42: OSPF: Build router LSA for area 0, router ID 3.3.3.3, seq 0x80000001 02:00:42: OSPF: Build
31、router LSA for area 2, router ID 3.3.3.3, seq 0x80000001 02:00:42: OSPF: Build router LSA for area 1, router ID 3.3.3.3, seq 0x80000001 R3# 02:00:45: OSPF: 2 Way Communication to 4.4.4.4 on Serial2/2, state 2WAY 02:00:45: OSPF: Send DBD to 4.4.4.4 on Serial2/2 seq 0x1174 opt 0x42 flag 0x7 len 32
32、 02:00:46: OSPF: Rcv DBD from 4.4.4.4 on Serial2/2 seq 0x2450 opt 0x42 flag 0x7 len 32 mtu 1500 state EXSTART 02:00:46: OSPF: NBR Negotiation Done. We are the SLAVE 02:00:46: OSPF: Send DBD to 4.4.4.4 on Serial2/2 seq 0x2450 opt 0x42 flag 0x2 len 52 02:00:47: OSPF: Rcv DBD from 4.4.4.4 on Seria
33、l2/2 seq 0x2451 opt 0x42 flag 0x3 len 352 mtu 1500 state EXCHANGE 02:00:47: OSPF: Send DBD to 4.4.4.4 on Serial2/2 seq 0x2451 opt 0x42 flag 0x0 len 32 02:00:47: OSPF: Database request to 4.4.4.4 02:00:47: OSPF: sent LS REQ packet to 34.0.0.4, length 192 02:00:47: OSPF: Rcv DBD from 4.4.4.4 on
34、Serial2/2 seq 0x2452 opt 0x42 flag 0x1 len 32 mtu 1500 state EXCHANGE 02:00:47: OSPF: Exchange Done with 4.4.4.4 on Serial2/2 02:00:47: OSPF: Send DBD to 4.4.4.4 on Serial2/2 seq 0x2452 opt 0x42 flag 0x0 len 32 02:00:47: OSPF: Build rou R3#ter LSA for area 2, router ID 3.3.3.3, seq 0x80000003
35、02:00:47: OSPF: Synchronized with 4.4.4.4 on Serial2/2, state FULL 02:00:47: %OSPF-5-ADJCHG: Process 10, Nbr 4.4.4.4 on Serial2/2 from LOADING to FULL, Loading Done R3# 02:00:48: OSPF: 2 Way Communication to 2.2.2.2 on Serial2/1, state 2WAY 02:00:48: OSPF: Send DBD to 2.2.2.2 on Serial2/1 seq 0x
36、14F8 opt 0x42 flag 0x7 len 32 02:00:48: OSPF: Rcv DBD from 2.2.2.2 on Serial2/1 seq 0x2044 opt 0x42 flag 0x7 len 32 mtu 1500 state EXSTART 02:00:48: OSPF: First DBD and we are not SLAVE 02:00:48: OSPF: Rcv DBD from 2.2.2.2 on Serial2/1 seq 0x14F8 opt 0x42 flag 0x2 len 212 mtu 1500 state EXSTART
37、 02:00:48: OSPF: NBR Negotiation Done. We are the MASTER 02:00:48: OSPF: Send DBD to 2.2.2.2 on Serial2/1 seq 0x14F9 opt 0x42 flag 0x3 len 52 02:00:48: OSPF: Database request to 2.2.2.2 02:00:48: OSPF: sent LS REQ packet to 23.0.0.2, length 108 R3# 02:00:49: OSPF: Rcv DBD from 2.2.2.2 on Seri
38、al2/1 seq 0x14F9 opt 0x42 flag 0x0 len 32 mtu 1500 state EXCHANGE 02:00:49: OSPF: Send DBD to 2.2.2.2 on Serial2/1 seq 0x14FA opt 0x42 flag 0x1 len 32 02:00:50: OSPF: Rcv DBD from 2.2.2.2 on Serial2/1 seq 0x14FA opt 0x42 flag 0x0 len 32 mtu 1500 state EXCHANGE 02:00:50: OSPF: Exchange Done with
39、 2.2.2.2 on Serial2/1 02:00:50: OSPF: Synchronized with 2.2.2.2 on Serial2/1, state FULL R3# 02:00:50: %OSPF-5-ADJCHG: Process 10, Nbr 2.2.2.2 on Serial2/1 from LOADING to FULL, Loading Done R3# 02:00:50: OSPF: Build router LSA for area 0, router ID 3.3.3.3, seq 0x80000002 R3# 02:00:52: OSPF:
40、 Build router LSA for area 2, router ID 3.3.3.3, seq 0x80000004 R3# 02:00:56: OSPF: Build router LSA for area 0, router ID 3.3.3.3, seq 0x80000005 R3# 02:01:02: OSPF: Interface OSPF_VL2 going Up R3# 02:01:04: OSPF: Rcv pkt from 34.0.0.4, OSPF_VL2 : Mismatch Authentication type. Input packet sp
41、ecified type 0, we use type 1 认证匹配不上 R3# 02:01:14: OSPF: Rcv pkt from 34.0.0.4, OSPF_VL2 : Mismatch Authentication type. Input packet specified type 0, we use type 1 R3# 02:01:23: OSPF: Rcv pkt from 34.0.0.4, OSPF_VL2 : Mismatch Authentication type. Input packet specified type 0, we use ty
42、pe 1 R3# 02:01:34: OSPF: Rcv pkt from 34.0.0.4, OSPF_VL2 : Mismatch Authentication type. Input packet specified type 0, we use type 1 R4#ping 3.3.3.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 256/445/772 ms 在R4上ping依旧可以ping通






