#amazon(4844322214)
設定 †
基本 †
- ルータコンフィグレーションモードに入る
rt(config)# router ospf process-id
- process-id
- 1~65535
- ルータ内部で識別するための ID
- ルータ内部で一意であれば、なんでもいい
- OSPFを有効化
rt(config-router)# network net-addr wildcard-mask area area-id
- net-addr
- ルーティング情報をアドバタイズするネットワーク アドレス
- wildcard-mask
- area-id
- エリア ID
- 0~0~4,294,967,295
- 0 はバックボーン エリア
NBMA タイプ †
rt(config)# interface type mod/num
rt(config-if)# ip ospf network type
- type
- broadcast … Broadcast
- nonbroadcast … NBMA
- point-to-multipoint … P2MP
- point-to-multipoint nonbroadcast … P2P None Broadcast
- point-to-point … P2P
ロギング †
デフォルト値の変更 †
コストの変更 †
- 回線帯域から変更
rt(config-if)# bandwidth
プライオリティの設定 †
ルータ ID の設定 †
SPF 再計算時間 †
LSA 送信時間 †
認証 †
インターフェース単位の設定 †
- 認証を行うインターフェースの選択
rt(config)# interface type mod/num
- 認証を宣言
rt(config-if)# ip ospf authentication [message-digest]
- 認証鍵の設定 (平文)
rt(config-if)# ip ospf authentication-key key
- 認証鍵の設定 (MD5)
rt(config-if)# ip ospf message-digest-key 1 md5 key
エリア単位の設定 †
- 認証を宣言
rt(config)# router ospf process-id
rt(config-router)# area area-id authentication [message-digest]
- インターフェースの選択 (なんでもいい?)
rt(config)# interface type mod/num
- 認証鍵の設定 (平文)
rt(config-if)# ip ospf authentication-key key
- 認証鍵の設定 (MD5)
rt(config-if)# ip ospf message-digest-key 1 md5 key
仮想リンクでの設定 †
- Area 0 側
rt1(config)# router ospf process-id
- Area 0 での認証設定
rt1(config-router)# area 0 authentication [message-digest]
- 認証、キーの設定 (平文)
rt1(config-router)# area tran-area virtual-link ip-addr authentication-key key
- 認証、キーの設定 (MD5)
rt1(config-router)# area tran-area virtual-link ip-addr message-digest-key 1 md5 key
- Area 2 側
rt2(config)# router ospf process-id
- Area 0 での認証設定
rt1(config-router)# area 0 authentication [message-digest]
- 認証、キーの設定 (平文)
rt2(config-router)# area tran-area virtual-link ip-addr authentication-key key
- 認証、キーの設定 (MD5)
rt2(config-router)# area tran-area virtual-link ip-addr message-digest-key 1 md5 key
集約 †
エリア外ルートの集約 †
{192.168.0.0/25}---+
{192.168.0.128/26}---+---{Area1}-----[rt]-----{Area0}
{192.168.0.192/26}---+ 集約→
192.168.0.0/24
AS 外ルートの集約 †
- 他ルーティング プロトコルを集約する
- ASBR で使用可能
rt(config-router)# summary-address ip-addr netmask
再配布 †
ASBR
---{EIGRP}-----[rt]-----{OSPF}---
再配布→
再配布 †
- 他ルーティング プロトコルの OSPF への再配布
rt(config)# router ospf process-id
rt(config-router)# redistribute protocol [metric metric] [metric-type metric-type] [route-map map] [subnets]
- protocol
- static, rip, eigrp as-num... (iBGP からの再配布は
別途設定が必要)
- metric
- シード メトリック、再配布時のコスト
- デフォルトは 20 (BGP からの場合は 1)
- metric-type
- OSPF の外部ルート タイプ
- 1、2 (デフォルトは 2)
- map
- ルート マップを使用する場合
- 一致しないルートは再配布されない
- 一致しないルートは再配布されない (暗黙の deny も有効)
- subnets
- メトリックの一括設定
rt(config-router)# default-metric metric
- metric
- シード メトリック、再配布時のコスト
- 再配布のシード メトリックを一括で指定する
デフォルト ルートの再配布 †
ディスタンスの変更 †
エリア †
スタブ エリア †
rt(config)# router ospf process-id
rt(config-router)# area area-id stub
- area-id
- スタブ エリアにするエリア ID
- エリア内の全ルータに設定が必要
完全スタブ エリア †
- ABR の設定
rt(config-router)# area area-id stub no-summary
- エリア内ルータの設定
rt(config-router)# area area-id stub
- area-id
- 完全スタブ エリアにするエリア ID
- エリア内の全ルータに設定が必要
NSSA †
rt(config-router)# area area-id nssa trans option
- trans
- translate-always … LSA Type 7 を Type 5 に変換して転送する (デフォルト)
- translate-never … 転送しない
- option
- no-redistribution …
- default-information-originate … デフォルト ルートを Type 7 でエリア内にアドバタイズする
- no-summary … NSSA 完全スタブ エリアにする
スタブ エリアのデフォルト ルート コスト †
rt(config-router)# area area-id default-cost cost
仮想リンク †
rt1(config-router)# area area-id virtual-link router-id
rt2(config-router)# area 1 virtual-link 192.168.0.1
NBMA †
- NBMA モードの設定
rt(config)# interface type mod/num
rt(config-if)# ip ospf network mode
- mode
- broadcast … Broadcast
- non-broadcast … NBMA (デフォルト)
- point-to-multipoint … P2MP
- point-to-multipoint non-broadcast … P2MP None Broadcast
- point-to-point … P2P
- ネイバーの設定
rt(config)# router ospf process-id
rt(config-router)# neighbor ip_addr
- ip_addr
- ネイバーの IP アドレス (NBMA、P2MP None Broadcast の場合のみ)
クリア †
プロセスの再起動 †
確認 †
rt# sh ip protocols
Routing Protocol is "ospf 1" プロセスID
Outgoing update filter list for all interfaces is not set OUT方向のディストリビュート リスト
Incoming update filter list for all interfaces is not set IN方向のディストリビュート リスト
Router ID 192.168.0.1 ルータID
It is an area border and autonomous system boundary router ルータ タイプ (ABR, ASBR)
Redistributing External Routes from, 再配送の設定
connected, includes subnets in redistribution
static, includes subnets in redistribution
Number of areas in this router is 2. 2 normal 0 stub 0 nssa
Address Summarization:
Maximum path: 4
Routing for Networks:
192.168.0.0 0.0.0.255 area 0 networkの設定
Routing Information Sources:
Gateway Distance Last Update
(this router) 110 1y28w ネイバー情報
192.168.0.2 110 1w2d
192.168.0.253 110 1w2d
192.168.0.254 110 1w2d
Distance: (default is 110)
rt# show ip ospf
Routing Process "ospf 1" with ID 192.168.0.1
Supports only single TOS(TOS0) routes
Supports opaque LSA
It is an area border and autonomous system boundary router
Redistributing External Routes from, 再配送の設定
connected, includes subnets in redistribution
static, includes subnets in redistribution
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
Number of external LSA 645. Checksum Sum 0x1234ABC
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 2. 2 normal 0 stub 0 nssa
External flood list length 0
Area BACKBONE(0) ルータが接しているエリア毎の情報
Number of interfaces in this area is 1
Area has simple password authentication
SPF algorithm executed 188 times SFP再計算の回数
Area ranges are
Number of LSA 47. Checksum Sum 0x1234ABC
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
rt# show ip ospf interface
FastEthernet0/0 is up, line protocol is up
Internet Address 192.168.0.1/24, Area 0
Process ID 1, Router ID 192.168.0.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DROTHER, Priority 1
Designated Router (ID) 192.168.0.254, Interface address 192.168.0.4 DR
Backup Designated router (ID) 192.168.0.253, Interface address 192.168.0.3 BDR
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 タイマ
Hello due in 00:00:00
Index 1/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 41
Last flood scan time is 0 msec, maximum is 9 msec
Neighbor Count is 11, Adjacent neighbor count is 2
Adjacent with neighbor 192.168.0.253 (Backup Designated Router)
Adjacent with neighbor 192.168.0.254 (Designated Router)
Suppress hello for 0 neighbor(s)
Simple password authentication enabled
ネイバー テーブル †
rt# show ip ospf neigbor
Neighbor ID Pri State Dead Time Address Interface
192.168.0.1 1 2WAY/DROTHER 00:00:32 192.168.0.1 FastEthernet0/0
192.168.0.2 1 2WAY/DROTHER 00:00:33 192.168.0.2 FastEthernet0/0
192.168.0.253 1 FULL/BDR 00:00:37 192.168.0.3 FastEthernet0/0
192.168.0.254 1 FULL/DR 00:00:33 192.168.0.4 FastEthernet0/0
- Neighbor ID
- Pri
- State
- Dead Time
- Address
- Interface
トポロジ テーブル †
LSA の情報 †
rt# show ip ospf database
OSPF Router with ID (192.168.0.1) (Process ID 1)
Router Link States (Area 0) LSA Type 1: ルータの各I/Fの情報、エリア内ルータの台数分ある
Link ID ADV Router Age Seq# Checksum Link count
172.16.0.0 192.168.0.2 1519 0x800080B6 0x008469 1
Net Link States (Area 0) LSA Type 2: エリア内のルータの一覧、DRの台数分ある
Link ID ADV Router Age Seq# Checksum
172.16.1.0 192.168.0.4 1933 0x80003397 0x008C02
Summary Net Link States (Area 0) LSA Type 3:
Link ID ADV Router Age Seq# Checksum
10.0.0.0 192.168.0.4 19 0x80006DCE 0x00241A
Summary ASB Link States (Area 0) LSA Type 4:
Link ID ADV Router Age Seq# Checksum
10.1.0.0 192.168.0.2 441 0x80002030 0x00DFD8
Type-5 AS External Link States LSA Type 5:
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 192.168.0.4 19 0x80002076 0x000572 1
- Link ID
- ADV Router
- Age
- LSA が発行されてからの時間
- 最大 3600 秒 (1 時間)
- 1800 秒 (30 分) ごとに発行されるはずなので、それ以上だと異常の可能性あり
- Seq#
- Checksum
- Link count
LSA Type 1 の情報 †
rt# show ip ospf database router [link-id]
OSPF Router with ID (192.168.0.1) (Process ID 1)
Router Link States (Area 0)
Routing Bit Set on this LSA
LS age: 1862
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 192.168.0.8
Advertising Router: 192.168.0.8
LS Seq Number: 8000AA38
Checksum: 0xCD26
Length: 60
Area Border Router
AS Boundary Router
Number of Links: 3
Link connected to: a Transit Network
(Link ID) Designated Router address: 192.168.0.128
(Link Data) Router Interface address: 192.168.0.129
Number of TOS metrics: 0
TOS 0 Metrics: 10
LSA Type 2 の情報 †
rt# show ip ospf database network [link-id]
LSA Type 3 の情報 †
rt# show ip ospf database summary [link-id]
LSA Type 4 の情報 †
rt# show ip ospf database asbr-summary [link-id]
LSA Type 5 の情報 †
rt# show ip ospf database external [link-id]
ルーティング テーブル †
rt# 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 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, 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.254 to network 0.0.0.0
192.168.0.0/24 is variably subnetted, 2 subnets, 2 masks
O E2 172.16.0.0/24 [110/20] via 192.168.0.10, 1w3d, FastEthernet0/0
- Codes
- O … エリア内ルート (LSA Type 1, 2)
- O IA … エリア外ルート (LSA Type 3, 4)
- O E1 … AS 外ルート タイプ 1 (LSA Type 5)
- O E2 … AS 外ルート タイプ 2 (LSA Type 5)
- O N1 … NSSA AS 外ルート タイプ 1 (LSA Type 7)
- O N2 … NSSA AS 外ルート タイプ 2 (LSA Type 7)
デバッグ †
rt# debug ip ospf packet
Jan 1 00:00:00: OSPF: rcv. v:2 t:5 l:724 rid:192.168.0.1
aid:0.0.0.1 chk:3571 aut:1 auk: from FastEthernet0/1
Jan 1 00:00:00: OSPF: rcv. v:2 t:1 l:48 rid:192.168.0.1
aid:0.0.0.1 chk:D53C aut:1 auk: from FastEthernet0/1
Jan 1 00:00:00: OSPF: rcv. v:2 t:4 l:172 rid:192.168.0.1
aid:0.0.0.1 chk:1901 aut:1 auk: from FastEthernet0/1
フィールド | 意味 | 値 | 説明 |
v | version | - | バージョン |
t | type | 1 | Hello |
2 | DBD |
3 | LSR |
4 | LSU |
5 | LSAck |
l | length | - | パケット長 |
rid | router id | - | ルータ ID |
aid | area id | - | エリア ID |
chk | checksum | - | チェックサム |
aut | authentication | 0 | 認証なし |
1 | プレーン テキスト認証 |
2 | MD5 認証 |
auk | authentication key | - | 認証キー |
keyed | key | - | MD5 キー ID |
seq | sequence | - | シーケンス番号 |
rt# debug ip ospf adj
rt# debug ip ospf events