---
description: ospf
---

# 20191105

```
OSPF(open shortest path first):每30分鐘會傳遞訊息其他人
OSPFv2:IPv4
OSPFv3:IPv6

動態路由
IGP:interior gateway potorol (RIP、OSPF、EIGP、ISB)
支持VLSM(超網化)和CIDR(子網路切割)
Link State
---------
|IP|OSPF|  IP potorol=89 → OSPF
---------  potorol=88 → EIGRP
```

```
DV:distance vector(倆倆交換資訊，得到路由資訊) (只知道旁邊鄰居的node)
LS:link state ↓
LSA link state advertisement floud 到是個網路，所以網路中每個mode都有相同的LSDB，透過此LSDR建構shortest path tree(SPT)以得到從自己到不同node的最短路徑
A-----B-----C-----D
◎----◎----◎----◎
   ←     ←
  metoric=1
```

```
OSPF有三張表:
鄰居表
LSDB表
路由表
```

```
DR:指定
BDR:被指定
DR other
*當DR掛掉，BDR自動補上DR位置

         224.0.0.6
DR other      →    DR
    224.0.0.5
DR      →     DR other

```

```
priority
router id ↓
手動設定
loopback
up實體介面ip
```

![](https://1005948644-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZgzp55XQBZ7U2SrFtZ%2F-Lsu2qAqClTwLIa8Wmbo%2F-LsuHSznQ-UlJ2fUhE_3%2Fimage.png?alt=media\&token=c2d6d009-f288-420e-a0e8-d09083645d01)

![](https://1005948644-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZgzp55XQBZ7U2SrFtZ%2F-Lsu2qAqClTwLIa8Wmbo%2F-LsuHYzgQtrRFc_913R_%2Fimage.png?alt=media\&token=0cd5d155-fdaf-4850-942a-d78cdedeb854)

![](https://1005948644-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZgzp55XQBZ7U2SrFtZ%2F-Lsu2qAqClTwLIa8Wmbo%2F-LsuSdgPkslDH9WBnXUq%2Fimage.png?alt=media\&token=d8b3f063-93fb-49c0-ae3d-2f21920bdd21)

![](https://1005948644-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZgzp55XQBZ7U2SrFtZ%2F-Lsu2qAqClTwLIa8Wmbo%2F-LsuSoI4otjTDSWfDZZ9%2Fimage.png?alt=media\&token=9df079a8-6acc-4aff-bd57-ca34dc62d24f)

![](https://1005948644-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZgzp55XQBZ7U2SrFtZ%2F-Lsu2qAqClTwLIa8Wmbo%2F-LsuSym1YFTTqyOmAfGw%2Fimage.png?alt=media\&token=753c6e83-d6b4-4821-8634-3188a403ac65)

![](https://1005948644-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZgzp55XQBZ7U2SrFtZ%2F-Lsu2qAqClTwLIa8Wmbo%2F-LsuTAyo5ljTi28He-oM%2Fimage.png?alt=media\&token=e056627f-75f2-4e00-b644-630bdc268022)

![](https://1005948644-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZgzp55XQBZ7U2SrFtZ%2F-Lsu2qAqClTwLIa8Wmbo%2F-LsuTOMnLkzQeQdlDvsx%2Fimage.png?alt=media\&token=3fcb69cd-c463-44f4-8b8a-447a1e0d22f0)

![](https://1005948644-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZgzp55XQBZ7U2SrFtZ%2F-Lsu2qAqClTwLIa8Wmbo%2F-LsuTaSY6EZXGJlXb8ZE%2Fimage.png?alt=media\&token=403edb32-04b8-48d9-8efc-7686c75af33a)

{% embed url="https://www.jannet.hk/zh-Hant/post/open-shortest-path-first-ospf/" %}

![](https://1005948644-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZgzp55XQBZ7U2SrFtZ%2F-Lsu2qAqClTwLIa8Wmbo%2F-LsuRmS4D3MlmWmgW_eY%2Fimage.png?alt=media\&token=25e96d82-7599-482a-96e5-80d2c332c5ca)

![](https://1005948644-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZgzp55XQBZ7U2SrFtZ%2F-Lsu2qAqClTwLIa8Wmbo%2F-LsueZvczmEp_610t5aG%2Fimage.png?alt=media\&token=691c64c2-132c-42cc-bd8d-4aae72dcba76)
