2017年5月5日金曜日

OSPF ルート広告手法

◾️OSPF ルート広告手法

 【課題】
  ・R1,R2,R3のLoopbackアドレスをOSPFネットワークへ広告する。
    ※ただし、それぞれ異なる方法でルート広告する事
  
  【補足】
   OSPFネットワークにて経路広告する際、3つの手法がある。
   ①ルータコンフィグレーションモードでnetworkコマンドで設定する方法
   ②IFモードでip ospf xx area コマンドで設定する方法
   ③ルータコンフィグレーションモードでredistributeコマンドで設定する方法
   ※今回は以下の前提で設定する。
    R1ではnetworkコマンドにてルート広告
    R2ではip ospf xx area コマンドにてルート広告
    R3ではredistributeコマンドにてルート広告

◾️検証環境図















①検証環境 事前設定確認

(1)OSPFネイバー確認

 OSPFネイバーが正常に張れている事を確認する。
R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2         254   FULL/BDR        00:00:39    192.168.1.2     Ethernet0/0
3.3.3.3           0   FULL/DROTHER    00:00:38    192.168.1.3     Ethernet0/0


R2#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1         255   FULL/DR         00:00:35    192.168.1.1     Ethernet0/1
3.3.3.3           0   FULL/DROTHER    00:00:34    192.168.1.3     Ethernet0/1


R3#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1         255   FULL/DR         00:00:34    192.168.1.1     Ethernet0/2
2.2.2.2         254   FULL/BDR        00:00:33    192.168.1.2     Ethernet0/2

(2)OSPFエリア設定確認
 全てエリア0に属している事を確認する。
R1#show ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Et0/0        1     0               192.168.1.1/24     10    DR    2/2

R2#show ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Et0/1        1     0               192.168.1.2/24     10    BDR   2/2

R3#show ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Et0/2        1     0               192.168.1.3/24     10    DROTH 2/2


②設定変更1(ルータコンフィグレーションモードでnetworkコマンドで設定する方法)

(1)R1のLoopbackアドレスをnetworkコマンドにて広告する。
R1(config)#router ospf 1
R1(config-router)#network 1.1.1.1 255.255.255.255 area 0

(2)R2,R3のルーティングテーブルを確認し、R1のLoopbackアドレス経路が広告されている事を確認する
R2#sh ip route | include 1.1.1.1
O        1.1.1.1 [110/11] via 192.168.1.1, 00:03:54, Ethernet0/1

R3#sh ip route | include 1.1.1.1
O        1.1.1.1 [110/11] via 192.168.1.1, 00:03:37, Ethernet0/2

R2#sh ip route 1.1.1.1          
Routing entry for 1.1.1.1/32
  Known via "ospf 1", distance 110, metric 11, type intra area
  Last update from 192.168.1.1 on Ethernet0/1, 00:04:10 ago
  Routing Descriptor Blocks:
  * 192.168.1.1, from 1.1.1.1, 00:04:10 ago, via Ethernet0/1
      Route metric is 11, traffic share count is 1

R3#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
  Known via "ospf 1", distance 110, metric 11, type intra area
  Last update from 192.168.1.1 on Ethernet0/2, 00:04:15 ago
  Routing Descriptor Blocks:
  * 192.168.1.1, from 1.1.1.1, 00:04:15 ago, via Ethernet0/2
      Route metric is 11, traffic share count is 1


③設定変更2(IFモードでip ospf xx area コマンドで設定する方法)



(1)R2のLoopbackアドレスをip ospf xx areaコマンドにて広告する。
R2(config)#interface loopback 0
R2(config-if)#ip ospf 1 area 0

(2)R1,R3のルーティングテーブルを確認し、R2のLoopbackアドレス経路が広告されている事を確認する
R1#sh ip route | include 2.2.2.2
O        2.2.2.2 [110/11] via 192.168.1.2, 00:00:42, Ethernet0/0


R3#sh ip route | include 2.2.2.2
O        2.2.2.2 [110/11] via 192.168.1.2, 00:00:48, Ethernet0/2


R1#sh ip route 2.2.2.2
Routing entry for 2.2.2.2/32
  Known via "ospf 1", distance 110, metric 11, type intra area
  Last update from 192.168.1.2 on Ethernet0/0, 00:01:11 ago
  Routing Descriptor Blocks:
  * 192.168.1.2, from 2.2.2.2, 00:01:11 ago, via Ethernet0/0
      Route metric is 11, traffic share count is 1


R3#sh ip route 2.2.2.2                                         
Routing entry for 2.2.2.2/32
  Known via "ospf 1", distance 110, metric 11, type intra area
  Last update from 192.168.1.2 on Ethernet0/2, 00:02:29 ago
  Routing Descriptor Blocks:
  * 192.168.1.2, from 2.2.2.2, 00:02:29 ago, via Ethernet0/2
      Route metric is 11, traffic share count is 1



④設定変更3(R3ではredistributeコマンドにてルート広告)



(1)R3のLoopbackアドレスをredistributeコマンドにて広告する。
 ※シードメトリック値はそのまま(コスト加算せずに※metric-type2)伝搬させる事。
R3(config)#route-map Loopback_to_ospf permit 10
R3(config-route-map)#match interface loopback 0
R3(config)#router ospf 1
R3(config-router)#redistribute connected subnets route-map Loopback_to_ospf
//metric-typeはデフォルトで2です。
//subnetはサブネットワークをOSPFへ再配布したい際に設定するオプション設定です。

(2)R1,R2のルーティングテーブルを確認し、R2のLoopbackアドレス経路が広告されている事を確認する
R1#sh ip route | include 3.3.3.3
O E2     3.3.3.3 [110/20] via 192.168.1.3, 00:04:22, Ethernet0/0


R2#sh ip route | include 3.3.3.3
O E2     3.3.3.3 [110/20] via 192.168.1.3, 00:04:37, Ethernet0/1


R1#sh ip route 3.3.3.3  
Routing entry for 3.3.3.3/32
  Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10
  Last update from 192.168.1.3 on Ethernet0/0, 00:05:19 ago
  Routing Descriptor Blocks:
  * 192.168.1.3, from 3.3.3.3, 00:05:19 ago, via Ethernet0/0
      Route metric is 20, traffic share count is 1


R2#sh ip route 3.3.3.3 
Routing entry for 3.3.3.3/32
  Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10
  Last update from 192.168.1.3 on Ethernet0/1, 00:05:23 ago
  Routing Descriptor Blocks:
  * 192.168.1.3, from 3.3.3.3, 00:05:23 ago, via Ethernet0/1
      Route metric is 20, traffic share count is 1

(3)R1,R2のOSPFデータベースを確認する。
R1#show ip ospf database external 3.3.3.3

            OSPF Router with ID (1.1.1.1) (Process ID 1)

Type-5 AS External Link States

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 441
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 3.3.3.3 (External Network Number )
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000001
  Checksum: 0x385
  Length: 36
  Network Mask: /32
Metric Type: 2 (Larger than any link state path)
MTID: 0 
Metric: 20 
Forward Address: 0.0.0.0
External Route Tag: 0


⑤設定変更4(R3ではredistributeコマンドにてルート広告)


 ※シードメトリック値にコスト値を加算(metric-type1)伝搬させる事。
R3(config)#route-map Loopback_to_ospf permit 10
R3(config-route-map)#match interface loopback 0
R3(config)#router ospf 1
R3(config-router)#redistribute connected subnets route-map Loopback_to_ospf metric-type 1

(2)R1,R2のルーティングテーブルを確認し、R2のLoopbackアドレス経路が広告されている事を確認する
※R1-R3及びR2-R3間のOSPFコスト10が加算される。

R1#sh ip route | include 3.3.3.3         
E1     3.3.3.3 [110/30] via 192.168.1.3, 00:00:20, Ethernet0/0



R2#sh ip route | include 3.3.3.3 
E1     3.3.3.3 [110/30] via 192.168.1.3, 00:02:18, Ethernet0/1



R1#sh ip route 3.3.3.3
Routing entry for 3.3.3.3/32
  Known via "ospf 1", distance 110, metric 30type extern 1
  Last update from 192.168.1.3 on Ethernet0/0, 00:08:19 ago
  Routing Descriptor Blocks:
  * 192.168.1.3, from 3.3.3.3, 00:08:19 ago, via Ethernet0/0

      Route metric is 30, traffic share count is 1



R2#sh ip route 3.3.3.3
Routing entry for 3.3.3.3/32
  Known via "ospf 1", distance 110, metric 30, type extern 1
  Last update from 192.168.1.3 on Ethernet0/1, 00:08:28 ago
  Routing Descriptor Blocks:
  * 192.168.1.3, from 3.3.3.3, 00:08:28 ago, via Ethernet0/1

      Route metric is 30, traffic share count is 1



R1#show ip ospf database external 3.3.3.3

            OSPF Router with ID (1.1.1.1) (Process ID 1)

Type-5 AS External Link States

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 334
  Options: (No TOS-capability, DC, Upward)
  LS Type: AS External Link
  Link State ID: 3.3.3.3 (External Network Number )
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000002
  Checksum: 0x7D8A
  Length: 36
  Network Mask: /32
Metric Type: 1 (Comparable directly to link state metric)
MTID: 0 
Metric: 20     //再配布時のメトリック値
Forward Address: 0.0.0.0

External Route Tag: 0






OSPF コスト値変更

◾️OSPF コスト値変更

 【課題】
  ・R4からR2のLoopbackアドレスへ通信する際、R1経由に通信させる。
  
  【補足】
   OSPFのコスト値を変更する際、3つの手法がある。
   ①ip ospf costコマンドにて設定する方法
   ②bandwidthコマンドにて帯域幅にて設定する方法※100M/bandwidth
   ③auto-cost reference-bandwidthコマンドにてコスト計算式の分子を変更する方法

    ※デフォルトでは100M/bandwidth。尚、全ルータで設定する必要がある。

   今回は上記①②点別に検証を実施する。
   ※③はospfルータ全体に設定する必要があり。上記課題のようなcostによる通信制御
   は出来ない。


   >>オススメ記事:OSPF コストの計算式やコスト加算のタイミングを解説


◾️検証環境図





①検証環境 事前設定確認


(1)OSPFネイバー確認

 OSPFネイバーが正常に張れている事を確認する。
R1#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/DR         00:00:30    192.168.12.2    Ethernet0/1
4.4.4.4           1   FULL/DR         00:00:34    192.168.14.4    Ethernet0/0


R2#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/BDR        00:00:33    192.168.12.1    Ethernet0/1
3.3.3.3           1   FULL/DR         00:00:38    192.168.23.3    Ethernet0/0


R3#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
4.4.4.4           1   FULL/DR         00:00:36    192.168.34.4    Ethernet0/1
2.2.2.2           1   FULL/BDR        00:00:33    192.168.23.2    Ethernet0/0


R4#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   FULL/BDR        00:00:34    192.168.34.3    Ethernet0/1
1.1.1.1           1   FULL/BDR        00:00:37    192.168.14.1    Ethernet0/0


R4#show ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo0          1     0               4.4.4.4/32         1     LOOP  0/0
Et0/1        1     0               192.168.34.4/24    10    DR    1/1
Et0/0        1     0               192.168.14.4/24    10    DR    1/1  //Et0/0のcostを変更

(2)事前ルーティング確認


R4#show ip route | se 2.2.2.2     
O        2.2.2.2 [110/21] via 192.168.34.3, 00:18:17, Ethernet0/1
                 [110/21] via 192.168.14.1, 00:18:17, Ethernet0/0


R4#sh ip route 2.2.2.2
Routing entry for 2.2.2.2/32
  Known via "ospf 1", distance 110, metric 21, type intra area
  Last update from 192.168.14.1 on Ethernet0/0, 00:19:38 ago
  Routing Descriptor Blocks:
  * 192.168.34.3, from 2.2.2.2, 00:19:38 ago, via Ethernet0/1
      Route metric is 21, traffic share count is 1
    192.168.14.1, from 2.2.2.2, 00:19:38 ago, via Ethernet0/0

      Route metric is 21, traffic share count is 1
※現在はR1経由 /R4経由で等コストロードバランシング

R4#traceroute 2.2.2.2
Type escape sequence to abort.
Tracing the route to 2.2.2.2
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.14.1 9 msec
    192.168.34.3 7 msec
    192.168.14.1 7 msec
  2 192.168.23.2 9 msec
    192.168.12.2 12 msec

    192.168.23.2 8 msec

②設定変更1(ip ospf costコマンドにて設定する方法)


(1)R4にてコスト値を変更する。
R4(config)#int e0/0
R4(config-if)#ip ospf cost 1
(2)R4にてコスト値が変更されている事を確認する。
R4#show ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo0          1     0               4.4.4.4/32         1     LOOP  0/0
Et0/1        1     0               192.168.34.4/24    10    DR    1/1
Et0/0        1     0               192.168.14.4/24        DR    1/1


R4#show ip route | se 2.2.2.2
O        2.2.2.2 [110/12] via 192.168.14.1, 00:00:12, Ethernet0/0


R4#show ip route 2.2.2.2
Routing entry for 2.2.2.2/32
  Known via "ospf 1", distance 110, metric 12, type intra area
  Last update from 192.168.14.1 on Ethernet0/0, 00:03:32 ago
  Routing Descriptor Blocks:
  * 192.168.14.1, from 2.2.2.2, 00:03:32 ago, via Ethernet0/0
      Route metric is 12, traffic share count is 1

(3)R4からR2のLoopbackアドレス宛にtracerouteを実行する。
 R1経由で通信されることを確認する。
R4#traceroute 2.2.2.2
Type escape sequence to abort.
Tracing the route to 2.2.2.2
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.14.1 9 msec 5 msec 8 msec
  2 192.168.12.2 7 msec 9 msec 10 msec

③設定変更2(bandwidthコマンドにて帯域幅にて設定する方法)


(1)R4にてコスト値を変更する。
R4(config)#int e0/0      
R4(config-if)#bandwidth 100000

※ちなみに、帯域幅の設定はKbit単位で設定する必要があります。
R4(config)#int e0/0      
R4(config-if)#bandwidth ?   
  <1-10000000>   Bandwidth in kilobits

(2)R4にてコスト値が変更されている事を確認する。
R4#show ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo0          1     0               4.4.4.4/32         1     LOOP  0/0
Et0/1        1     0               192.168.34.4/24    10    DR    1/1
Et0/0        1     0               192.168.14.4/24    1     DR    1/1


R4#show ip route | se 2.2.2.2   
O        2.2.2.2 [110/12] via 192.168.14.1, 00:00:22, Ethernet0/0


R4#show ip route 2.2.2.2     
Routing entry for 2.2.2.2/32
  Known via "ospf 1", distance 110, metric 12, type intra area
  Last update from 192.168.14.1 on Ethernet0/0, 00:00:29 ago
  Routing Descriptor Blocks:
  * 192.168.14.1, from 2.2.2.2, 00:00:29 ago, via Ethernet0/0
      Route metric is 12, traffic share count is 1

(3)R4からR2のLoopbackアドレス宛にtracerouteを実行する。
 R1経由で通信されることを確認する。
R4#traceroute 2.2.2.2
Type escape sequence to abort.
Tracing the route to 2.2.2.2
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.14.1 10 msec 11 msec 10 msec
  2 192.168.12.2 10 msec 13 msec 8 msec

④設定変更2(auto-cost reference-bandwidthコマンドにてコスト計算式の分子を変更する方法)


(1)デフォルトの設定値を確認する。
R1#show run all | include auto-cost reference-bandwidth
 auto-cost reference-bandwidth 100
//デフォルトでは、分子100Mで設定されている。コスト=帯域幅/100M

※ちなみに、コスト計算で利用される帯域幅はMbit単位で設定する必要があります。
<注意>上記④の通り、IFモードで設定する帯域幅(bandwidth)はKbit単位です。
R1(config-router)#auto-cost reference-bandwidth ?
  <1-4294967>  The reference bandwidth in terms of Mbits per second

(2)コスト計算式の分母を変更する。
R1(config-router)#auto-cost reference-bandwidth 10
% OSPF: Reference bandwidth is changed. 
        Please ensure reference bandwidth is consistent across all routers.


R2(config-router)#auto-cost reference-bandwidth 10
% OSPF: Reference bandwidth is changed. 
        Please ensure reference bandwidth is consistent across all routers.

R3(config-router)#auto-cost reference-bandwidth 10
% OSPF: Reference bandwidth is changed. 
        Please ensure reference bandwidth is consistent across all routers.

R4(config-router)#auto-cost reference-bandwidth 10
% OSPF: Reference bandwidth is changed. 
        Please ensure reference bandwidth is consistent across all routers.


(3)R4にてコスト値が変更されている事を確認する。

R4#show ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo0          1     0               4.4.4.4/32             LOOP  0/0
Et0/1        1     0               192.168.34.4/24        DR    1/1
Et0/0        1     0               192.168.14.4/24        DR    1/1
※コストの計算式の分母が変わっている為、Et0/0のみでなくEt0/1も変わっている。

2017年5月4日木曜日

OSPF DR/BDR設定

◾️DR/BDR設定

 【やりたい事】
   ・R1をDR,R2をBDR,R3はDR/BDRに選出されないようにする。
   ・DR障害時及び復旧時のDR/BDRの選出方針を理解する。

◾️検証環境図















①検証環境 事前設定確認

(1)OSPFネイバー確認
 OSPFネイバーが正常に張れている事を確認する。
R1#sh ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/BDR        00:00:38    192.168.1.2     Ethernet0/0
3.3.3.3           1   FULL/DR         00:00:34    192.168.1.3     Ethernet0/0


R2#sh ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DROTHER    00:00:33    192.168.1.1     Ethernet0/1
3.3.3.3           1   FULL/DR         00:00:36    192.168.1.3     Ethernet0/1


R3#sh ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DROTHER    00:00:32    192.168.1.1     Ethernet0/2
2.2.2.2           1   FULL/BDR        00:00:39    192.168.1.2     Ethernet0/2

(2)OSPFインターフェース確認
 OSPFのエリア設定及びState(DR/BDR/DROTHER)値が正しく設定されている事を確認する。
R1#sh ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Et0/0        1     0               192.168.1.1/24     10    DROTH 2/2
※R1のEthernet0/0はDROTHER


R2#sh ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Et0/1        1     0               192.168.1.2/24     10    BDR   2/2
※R2のEthernet0/1はBDR


R3#sh ip ospf interface brief 
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Et0/2        1     0               192.168.1.3/24     10    DR    2/2
※R2のEthernet0/1はDR
 DR/BDRの選出は①priority値が最大(デフォルト1)②priorityが同じ場合はルータIDが最大のインターフェースのルータがDR/BDRに選出される。

②設定変更1(DR/BDR)

(1)R1,R2,R3 priorityを変更する。
R1(config)#int e0/0
R1(config-if)#ip ospf priority 255


R2(config)#int e0/1
R2(config-if)#ip ospf priority 254


R3(config)#int e0/2
R3(config-if)#ip ospf priority 0
※R3はDR/BDRにならないように明示的に「0」を設定する。
(2)R1,R2,R3 OSPFプロセスを再起動する。

R1#clear ip ospf process 


R2#clear ip ospf process 


R3#clear ip ospf process 

(3)OSPFインターフェース確認
R1#show ip ospf interface | include Priority
  Transmit Delay is 1 sec, State DR, Priority 255


R2#show ip ospf interface | include Priority
  Transmit Delay is 1 sec, State BDR, Priority 254

R3#show ip ospf interface | include Priority
  Transmit Delay is 1 sec, State DROTHER, Priority 0

(4)R1(DR)のインターフェースをDownする。※DRが故障した際の挙動確認。
R1(config)#int e0/0
R1(config-if)#shut
※その後、OSPF Deadインターバル(40秒)後、DRの再選出が行われる。

R2#debug ip ospf adj 
OSPF adjacency debugging is on
May  4 01:52:08.085: OSPF-1 ADJ   Et0/1: 1.1.1.1 address 192.168.1.1 is dead
May  4 01:52:08.086: OSPF-1 ADJ   Et0/1: 1.1.1.1 address 192.168.1.1 is dead, state DOWN
May  4 01:52:08.086: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Ethernet0/1 from FULL to DOWN, Neighbor Down: Dead timer expired
May  4 01:52:08.086: OSPF-1 ADJ   Et0/1: Neighbor change event
May  4 01:52:08.086: OSPF-1 ADJ   Et0/1: DR/BDR election
May  4 01:52:08.086: OSPF-1 ADJ   Et0/1: Elect BDR 0.0.0.0
May  4 01:52:08.086: OSPF-1 ADJ   Et0/1: Elect DR 2.2.2.2
May  4 01:52:08.086: OSPF-1 ADJ   Et0/1: DR: 2.2.2.2 (Id)   BDR: none  

R3はBDRへ昇格できない。(priorityが0である為)

R1#show ip ospf interface | include Priority
  Transmit Delay is 1 sec, State DOWN, Priority 255


R2#show ip ospf interface | include Priority
  Transmit Delay is 1 sec, State DR, Priority 254


R3#show ip ospf interface | include Priority
  Transmit Delay is 1 sec, State DROTHER, Priority 0

(4)R1をのインターフェースをUPする。。※元DRが復活した際の挙動確認。
R1(config)#int e0/0
R1(config-if)#no shut


R1#debug ip ospf adj 
OSPF adjacency debugging is on
May  4 02:01:35.614: OSPF-1 ADJ   Et0/0: Route adjust notification: UP/UP
May  4 02:01:35.614: OSPF-1 ADJ   Et0/0: Interface going Up
May  4 02:01:35.614: OSPF-1 ADJ   Et0/0: Interface state change to UP, new ospf state WAIT
May  4 02:01:35.616: OSPF-1 ADJ   Et0/0: 2 Way Communication to 2.2.2.2, state 2WAY
May  4 02:01:35.616: OSPF-1 ADJ   Et0/0: Backup seen event before WAIT timer
May  4 02:01:35.616: OSPF-1 ADJ   Et0/0: DR/BDR election
May  4 02:01:35.616: OSPF-1 ADJ   Et0/0: Elect BDR 1.1.1.1
May  4 02:01:35.616: OSPF-1 ADJ   Et0/0: Elect DR 2.2.2.2
May  4 02:01:35.616: OSPF-1 ADJ   Et0/0: Elect BDR 1.1.1.1
May  4 02:01:35.616: OSPF-1 ADJ   Et0/0: Elect DR 2.2.2.2
May  4 02:01:35.616: OSPF-1 ADJ   Et0/0: DR: 2.2.2.2 (Id)   BDR: 1.1.1.1 (Id)
May  4 02:01:35.616: OSPF-1 ADJ   Et0/0: Nbr 2.2.2.2: Prepare dbase exchange


R2#debug ip ospf adj 
OSPF adjacency debugging is on
May  4 02:01:48.703: OSPF-1 ADJ   Et0/1: Rcv DBD from 1.1.1.1 seq 0x1369 opt 0x52 flag 0x7 len 32  mtu 1500 state INIT
May  4 02:01:48.703: OSPF-1 ADJ   Et0/1: 2 Way Communication to 1.1.1.1, state 2WAY
May  4 02:01:48.703: OSPF-1 ADJ   Et0/1: Neighbor change event
May  4 02:01:48.703: OSPF-1 ADJ   Et0/1: DR/BDR election
May  4 02:01:48.703: OSPF-1 ADJ   Et0/1: Elect BDR 1.1.1.1
May  4 02:01:48.703: OSPF-1 ADJ   Et0/1: Elect DR 2.2.2.2
May  4 02:01:48.703: OSPF-1 ADJ   Et0/1: DR: 2.2.2.2 (Id)   BDR: 1.1.1.1 (Id)
May  4 02:01:48.703: OSPF-1 ADJ   Et0/1: Nbr 1.1.1.1: Prepare dbase exchange



R1#show ip ospf interface | include Priority
  Transmit Delay is 1 sec, State BDR, Priority 255



R2#show ip ospf interface | include Priority
  Transmit Delay is 1 sec, State DR, Priority 254



R3#show ip ospf interface | include Priority
  Transmit Delay is 1 sec, State DROTHER, Priority 0
※DRはR2がそのまま引き継ぎ、R1がBDRになる。(R1がDRにはならない。[プリエンプトしない])






2016年6月21日火曜日

5.BGPアトリビュート(MED、Local Preference、Atomic Aggregate)

◆ BGPアトリビュート(MED、Local Preference、Atomic Aggregate)


* MED属性(タイプコード:4)


自身のASに複数の入口がある場合、
EBGPネイバーに対して、優先入口を示す事が出来る属性です。
その為、異なる隣接ASが実施するパス選択に対して影響を及ぼす事が出来るパス属性です。
又、MEDは隣接AS内部に対してのみ影響を及ぼす事が出来ます。
※隣接ASの次のASへ送信される事は出来ません。

MED値は低い値方が優先されます。
尚、MED値を設定しなかった場合、デフォルト値は「0」です。



* Local Preference属性(タイプコード:5)


自身のASに複数の入口がある場合、
優先したい出口のBGPルータを自AS内部に示す事が出来る属性です。
Local PreferenceはWell-known discretionaryとなっております。

Local Preference値はIBGPネイバーに対して送信され、高い方が優先されます。
尚、Local Preference値を設定しなかった場合、デフォルト値は「100」です。



* Atomic Aggregate属性(タイプコード:6)


ルート集約されている経路である事を示す属性です。

Atomic AggregateはWell-known discretionaryとなっております。