OSPF实验

2018-8-6

 

Link ID 本路由器ID  ADV Router 通告路由器ID Age 维持时间   Seq#    Checksum    Link count连接数量

 

Router Link States (Area 0)        

路由器的LSA   1类LSA

//通告三元祖信息:直连网段、邻居、到邻居的距离(metric)

OSPF的lsa

路由/网段LSA——将网段/路由形成LSA来发送 更新 同步

路由器LSA——帮助数据包去找到DR ABR ASBR

Link ID ADV Router Age Seq# Checksum Link count
172.16.23.1 172.16.23.1 1774 0x80000002 0x009f60 1
172.16.34.1 172.16.34.1 1313 0x8000000b 0x00ac64 2
172.16.45.1 172.16.45.1 1266 0x80000005 0x00ae02 1

Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.23.1 172.16.23.1 1774 0x80000001 0x00e21b
172.16.34.1 172.16.34.1 1313 0x80000002 0x00521c

Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.12.0 172.16.23.1 33 0x80000002 0x004d72
172.16.45.0 172.16.45.1 1736 0x80000001 0x004841
1.1.1.1 172.16.23.1 7 0x80000003 0x003151
11.11.11.11 172.16.23.1 7 0x80000004 0x0061f7

Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
172.16.23.1 172.16.23.1 37 0x80000004 0x00b55d 1
172.16.12.1 172.16.12.1 12 0x80000005 0x00a235 3

Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
172.16.12.1 172.16.12.1 37 0x80000002 0x006d47


Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
172.16.23.0 172.16.23.1 33 0x80000008 0x00c7e6
172.16.34.0 172.16.23.1 1562 0x80000005 0x005e47
172.16.45.0 172.16.23.1 1262 0x80000007 0x00eaac





Router#show ip ospf database router //形成直连网段,通告给
OSPF Router with ID (172.16.23.1) (Process ID 100)

Router Link States (Area 0)
LS age: 780
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
Advertising Router: 1.1.1.1
LS Seq Number: 80000004
Checksum: 0x63ff
Length: 60
Number of Links: 3
Link connected to: a Transit Network
(Link ID) Designated Router address: 172.16.12.2
(Link Data) Router Interface address: 172.16.12.1
Number of TOS metrics: 0
TOS 0 Metrics: 1



Link connected to: a Stub Network   (Link ID) Network/subnet number: 1.1.1.1
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Stub Network
(Link ID) Network/subnet number: 11.11.11.11
(Link Data) Network Mask: 255.255.255.255
Number of TOS metrics: 0
TOS 0 Metrics: 1

//STUB NETWORK会自动将掩码修正为32位

//将接口设为PtP方式则会将掩码改回

Router#show ip ospf database ?

asbr-summary ASBR summary link states
external External link states
network Network link states
router Router link states
summary Network summary link states



Router#show ip os int f0/0           //查看接口下的网络类型

FastEthernet0/0 is up, line protocol is up
Internet address is 172.16.23.1/24, Area 0
Process ID 100, Router ID 172.16.23.1, Network Type BROADCAST, Cost: 1//
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 172.16.23.1, Interface address 172.16.23.1
Backup Designated Router (ID) 172.16.34.1, Interface address 172.16.23.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:03
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 172.16.34.1 (Backup Designated Router)
Suppress hello for 0 neighbor(s)

 

//二类LSA帮助指向DR,BDR在区域内泛洪

 

//三类LSA将一类路由转为三类路由发送

Summary Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
172.16.12.0 172.16.23.1 1136 0x80000009 0x003f79
11.11.11.11 172.16.23.1 1136 0x8000000a 0x0055fd
1.1.1.0 172.16.23.1 1800 0x80000008 0x00314d
172.16.45.0 172.16.45.1 1416 0x80000002 0x004642
2.2.2.2 172.16.23.1 660 0x8000000b 0x00f283
1.0.0.0/24 is subnetted, 1 subnets 
O 1.1.1.0 [110/2] via 172.16.12.1, 00:29:57, FastEthernet0/1     

//0类型在同区域内,优先度最高选择一类LSA

2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 172.16.12.1, 00:10:51, FastEthernet0/1
11.0.0.0/32 is subnetted, 1 subnets
O 11.11.11.11 [110/2] via 172.16.12.1, 00:48:59, FastEthernet0/1
172.16.0.0/24 is subnetted, 4 subnets
O 172.16.34.0 [110/2] via 172.16.23.2, 01:20:52, FastEthernet0/0

 

重分发;充分发的设备:在一台运行多协议,有多协议路由的路由器上进行路由的重分发

重分发的关系:

EX:将OSPF路由器分发进RIP

在RIP的进程域下,对OSPF路由进行充分发,并且考虑度量值的问题

将A路由协议/A进程的路由,重分发进B路由协议/B进程

在B进程下进行配置


Router(config)#router os 100

Router(config-router)#redistribute ?
bgp Border Gateway Protocol (BGP)
connected Connected
eigrp Enhanced Interior Gateway Routing Protocol (EIGRP)
metric Metric for redistributed routes
ospf Open Shortest Path First (OSPF)
rip Routing Information Protocol (RIP)
static Static routes
Router(config-router)#redistribute ospf ?
<1-65535> Process ID
Router(config-router)#redistribute ospf 10 ?
match Redistribution of OSPF routes
metric Metric for redistributed routes
metric-type OSPF/IS-IS exterior metric type for redistributed routes
subnets Consider subnets for redistribution into OSPF
tag Set tag for routes redistributed into OSPF
<cr>
Router(config-router)#redistribute ospf 10 sub
Router(config-router)#redistribute ospf 10 subnets //不加SUBNET则至重分发主类路由

----------------产生5类LSA------------------------------

Router(config-router)# do show ip os da

Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
4.4.4.4 172.16.45.1 87 0x80000001 0x003c89 0
5.5.5.5 172.16.45.1 87 0x80000001 0x000eb3 0
6.6.6.6 172.16.45.1 87 0x80000001 0x00dfdd 0
192.168.1.0 172.16.45.1 87 0x80000001 0x003833 0

ASBR自制系统边界路由器

//将OSPF10的路由重分发至OSPF100                当其他协议EIGRP,RIP路由重分发进OSPF是度量值不发生变化

 

EIGPR重分发修改METRIC值

Router(config-router)#redistribute eigrp 100 metric-type 1 subnets

O E1度量值会进行累加,更有利内部对域外进行选路。

  Routing Bit Set on this LSA
  LS age: 1660
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 6.6.6.6 (External Network Number )
  Advertising Router: 172.16.45.1
  LS Seq Number: 80000002
  Checksum: 0xddde
  Length: 36
  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 0

查询ABR,ASBR 

Router#show ip ospf border-routers 
OSPF Process 100 internal Routing Table

Codes: i - Intra-area route, I - Inter-area route

i 172.16.23.1 [1] via 172.16.23.1, FastEthernet0/1, ABR, Area 0, SPF 1
i 172.16.45.1 [1] via 172.16.34.2, FastEthernet0/0, ABR, Area 0, SPF 1

猜你喜欢

转载自blog.csdn.net/qq_39524009/article/details/81453337