You are on page 1of 34

OSPF http://ccieh3c.taobao.

co
m
ISSUE 1.0



RIP

RIP

OSPF RIP



OSPF
OSPF
OSPF

RIP
OSPF
OSPF
OSPF

RTA Routing Table

10.2.0.0 S0/1 1

RTA RTB
64Kbps
10.1.0.0/24 10.2.0.0/24
S0/1
S0/0
2Mbps 2Mbps

2Mbps
RTC RTD

2Mbps

2Mbps
t = = 32 s
64Kbps

RTA S0/0 3s
www.h3c.com
16

4 5 12 13

3 6 11 14

2 7 10 15

8 16
1

RTA RTB
RTA

RIP 16
www.h3c.com

Routing Table 10
11
12
1
2
9 3

8
7
6
5
4

10.1.0.0 E1/0 Inf

RTB 10.2.0.0/24

10.1.0.0, Metric 2

RTA

10
11
12
1
2
Routing Table
9 3
8
7
6
5
4

10.1.0.0 E1/0 Inf
10.1.0.0/24 10.1.0.0, Metric 1

RTC

RTA RTB
RTA RTB

www.h3c.com

RTA RTB
64Kbps

Routing Table Routing Table



10.1.0.0 E1/0 5 20.1.0.0 E1/0 5
10.2.0.0 E0/0 2 20.2.0.0 E0/0 2

10.100.0.0 S0/0 8 20.100.0.0 S0/0 8

12 12

30s
11 1 11 1
10 2 10 2
9 3 9 3
8 4 8 4
7 5 7 5
6 6

RTA RTB 1000 20


RTA RTB 160Kb

www.h3c.com

RIP
OSPF
OSPF
OSPF

www.h3c.com
OSPF

OSPF Open Shortest Path First


IETF

OSPF

OSPF IP IP
89
OSPF

www.h3c.com
OSPF
OSPF


OSPF

DR/BDR
Hello
Full


DR/BDR DR/BDR
Hello 2-WAY

DR/BDR

OSPF

www.h3c.com

Router ID 1.1.1.1 Router ID 2.2.2.2

10.1.0.1/24 10.1.0.2/24
RTA RTB
ID ID

Hello Hello
Hello

Hello Hello Hello


ID ID

2.2.2.2 10.1.0.2 init 1.1.1.1 10.1.0.1 init
Hello

ID ID

2.2.2.2 10.1.0.2 2-way 1.1.1.1 10.1.0.1 2-way
2-way RTA RTB

www.h3c.com

RTA RTB

Hello Hello

Hello Hello Hello

RTC RTD RTE

RTA RTB RTA(DR) RTB(BDR)

DR/BDR

RTC RTE RTC RTE


RTD RTD
R n (n-1) R =2 (n-2) + 1
= 2
www.h3c.com
DR BDR
RTA RTB
DR BDR

Hello: Pri=5 Hello: Pri=3

Hello: Pri=2 Hello: Pri=1 Hello: Pri=0

DRothers DRothers

RTC RTD RTE

Hello 0

BDR DR
DR BDR OSPF
DR BDR
DR BDR
www.h3c.com

Router ID 1.1.1.1 Router ID 2.2.2.2

10.1.0.1/24 10.1.0.2/24
RTA RTB

ID ID
2.2.2.2 10.1.0.2 2-way 1.1.1.1 10.1.0.1 2-way
11
12
1
10 2

RTA LSA
9 3
30min 8
7 5
4
RTA
6
RTB
RTB LSA

RTB LSA
RTB


ID ID
2.2.2. 10.1.0.2 Full 1.1.1.1 10.1.0.1 Full
2
RTB RTA LSA RTA RTB LSA
RTB RTA LSA RTA RTB Full

www.h3c.com

Router ID 1.1.1.1 Router ID 2.2.2.2

10.1.0.1/24 10.1.0.2/24
RTA RTB
10
11
12
1
2
RTA
LSA
9 3
8 4
7 5
6

RTA

LSA
12

RTA LSA
11 1
10 2
9 3

RTA
8 4
7 5
6

RTA LSA

RTA

OSPF
OSPF
LSA VLSM
www.h3c.com

LSDB
RTA 1 RTB A 1 B
RTA LSA
2 5 2 5
RTB LSA
RTC C
3 RTC LSA 3
RTD D
RTD LSA

( ) ( ) LSDB ( ) LSDB

A 1 B 1 A 1 B A 1 B
A B
2 2 2 2

C C C C
3 3 3 3

D D D D

( )

www.h3c.com
OSPF
0

1 10.0.0.1

www.h3c.com
OSPF LSA
0

OSPF

10.0.0.1
LSA
1 20.1.0.0/16
LSA
0 1
LSA
0 10.0.0.1
LSA
20.1.0.1/24
20.1.2.1/24
20.1.0.2/24
20.1.2.2/24 20.1.1.2/24

20.1.1.1/24
1 10.0.0.1

www.h3c.com

RIP
OSPF
OSPF
OSPF

www.h3c.com
OSPF
Router ID
[Router]router id ip-address
OSPF
[Router]ospf [ process-id ]
OSPF
<Router>reset ospf [ process-id ]
OSPF
[Router-ospf-100]area area-id
OSPF
[Router-ospf-1-area-0.0.0.0] network network-address
wildcard-mask

www.h3c.com
OSPF

OSPF
[Router-Ethernet0/0] ospf dr-priority priority

OSPF Cost
[Router-Ethernet0/0] ospf cost value

www.h3c.com
OSPF
0
RTA RTB
Router ID 1.1.1.1 Eth0/0 Router ID 2.2.2.2
10.0.0.2/24
Eth0/0
Eth0/1 10.0.0.1/24 Eth0/1
20.0.0.1/24 30.0.0.1/24

Eth0/1 Eth0/0
20.0.0.2/24 30.0.0.2/24

RTC Router ID 3.3.3.3

[RTA]interfaceloopback0
[RTAloopback0]ipaddress1.1.1.1255.255.255.255
[RTAloopback0]quit
[RTA]routerid1.1.1.1
[RTA]ospf1
[RTAospf1]area0
[RTAospf1area0.0.0.0]network1.1.1.10.0.0.0
[RTAospf1area0.0.0.0]network10.0.0.00.0.0.255
[RTAospf1area0.0.0.0]network20.0.0.00.0.0.255

www.h3c.com
OSPF
[RTB]interfaceloopback0
0 [RTBloopback0]ipaddress2.2.2.2
RTA RTB
255.255.255.255
Router ID 1.1.1.1 Eth0/0 Router ID 2.2.2.2 [RTBloopback0]quit
10.0.0.2/24 [RTB]routeid2.2.2.2
[RTB]ospf1
Eth0/0 [RTBospf1]area0
Eth0/1 10.0.0.1/24 Eth0/1 [RTBospf1area0.0.0.0]network
2.2.2.20.0.0.0
20.0.0.1/24 30.0.0.1/24 [RTBospf1area0.0.0.0]network
10.0.0.00.0.0.255
Eth0/1 Eth0/0 [RTBospf1area0.0.0.0]network
20.0.0.2/24 30.0.0.2/24 30.0.0.00.0.0.255

RTC Router ID 3.3.3.3

[RTC]interfaceloopback0
[RTCloopback0]ipaddress3.3.3.3255.255.255.255 RTA Eth0/0 RTB Eth0/0
[RTCloopback0]quit
[RTC]routerid3.3.3.3 RTA Eth0/1 RTC Eth0/1
[RTC]ospf1
[RTCospf1]area0 RTB Eth0/1 RTC Eth0/0
[RTCospf1area0.0.0.0]network3.3.3.30.0.0.0
[RTCospf1area0.0.0.0]network20.0.0.0 RTA,B,C
0.0.0.255
[RTCospf1area0.0.0.0]network30.0.0.0
0.0.0.255

www.h3c.com
OSPF
Cost
0
[RTA]interfaceethernet0/0 RTA RTB
[RTAethernet0/0]ospfdr Router ID 1.1.1.1 Eth0/0 Router ID 2.2.2.2
priority0 10.0.0.2/24
[RTAethernet0/0]ospfcost50 Eth0/0
[RTAethernet0/0]quit
Eth0/1 10.0.0.1/24 Eth0/1
[RTA]interfaceethernet0/1
[RTAethernet0/1]ospfdr 20.0.0.1/24 30.0.0.1/24
priority0
[RTAethernet0/1]ospfcost10 Eth0/1 Eth0/0
20.0.0.2/24 30.0.0.2/24

RTC Router ID 3.3.3.3


RTA Eth0/0 RTB Eth0/0
RTA Eth0/1 RTC Eth0/1
[RTB]interfaceethernet0/0
RTB Eth0/1 RTC Eth0/0 [RTBethernet0/0]ospfcost100
[RTBethernet0/0]quit
RTC [RTB]interfaceethernet0/1
[RTBethernet0/1]ospfcost10

www.h3c.com
OSPF
192.168.10.1
0
RTA Router ID 1.1.1.1 Eth0/0 Eth0/1 RTC Router ID 3.3.3.3
10.0.0.2/24 20.0.0.2/24
Eth0/0 Eth0/0
10.0.0.1/24 20.0.0.1/24
RTB Router ID 2.2.2.2

[RTB]interfaceloopback0
[RTBloopback0]ipaddress2.2.2.2255.255.255.255
[RTBloopback0]quit
[RTB]routeid2.2.2.2
[RTB]ospf100
[RTBospf100]area0
[RTBospf100area0.0.0.0]network2.2.2.20.0.0.0
[RTBospf100area0.0.0.0]network10.0.0.00.0.0.255
[RTBospf100area0.0.0.0]quit
[RTBospf100]area192.168.10.1
[RTBospf100area192.168.10.1]network20.0.0.00.0.0.255

RTA RTC OSPF


RTB RTA RTC

www.h3c.com

RIP
OSPF
OSPF
OSPF

www.h3c.com
OSPF

OSPF Router ID

[H3C]displayospfpeer

OSPFProcess1withRouterID1.1.1.1
NeighborBriefInformation

Area:0.0.0.0
RouterIDAddressPriDeadTimeInterfaceState
3.3.3.350.50.50.310035Eth0/0Full/BDR
4.4.4.450.50.50.41034Eth0/0Full/DR
2.2.2.250.50.50.110038Eth0/02way/

Router ID
3.3.3.3 50.50.50.0/24 BDR
4.4.4.4 50.50.50.0/24 DR
2.2.2.2 DR/BDR 2-way

www.h3c.com
OSPF

ID

<H3C>displayospflsdb

OSPFProcess1withRouterID1.1.1.1
LinkStateDatabase

Area:0.0.0.0
TypeLinkStateIDAdvRouterAgeLenSequenceMetric
Router3.3.3.33.3.3.3156448800000C70
Router1.1.1.11.1.1.180448800000F20
Router4.4.4.44.4.4.4152048800000C90
Router2.2.2.22.2.2.2127648800000C80
Network50.50.50.44.4.4.4152040800000C80


DR LSA

LSA

www.h3c.com
OSPF

<H3C>displayospfrouting

OSPFProcess1withRouterID1.1.1.1
RoutingTables

RoutingforNetwork
DestinationCostTypeNextHopAdvRouterArea
50.50.50.0/241Transit50.50.50.14.4.4.40.0.0.0


4.4.4.4/322Stub50.50.50.44.4.4.40.0.0.0
3.3.3.3/322Stub50.50.50.33.3.3.30.0.0.0
2.2.2.2/322Stub50.50.50.22.2.2.20.0.0.0
1.1.1.1/320Stub1.1.1.11.1.1.10.0.0.0


LSA

Stub OSPF ID
Transit

www.h3c.com
OSPF

OSPF
[Router] display ospf brief

OSPF
[Router] display ospf interface

OSPF
[Router] display ospf error

OSPF
[Router] display ospf INTEGER<1-16635>

www.h3c.com
OSPF
OSPF
<Router> debugging ospf event
OSPF
<Router> debugging ospf lsa

OSPF
<Router> debugging ospf packet

OSPF
<Router> debugging ospf spf

OSPF
<Router> debugging ospf INTEGER<1-65535>

www.h3c.com

OSPF SPF

OSPF DR/BDR
DR/BDR
OSPF
OSPF
VLSM


www.h3c.com

You might also like