ICT Diary

Network(主にCisco系)、Server(RedHat系)、Program(適当)を気まぐれにUPしていく。

Cisco OSPF 静的ネイバー確立(Static Neighbor Adjacency)

目次


About


同じセグメント内のL2ネットワーク上で3台以上の機器を接続するとフルメッシュ構成でOSPFネイバーを確立してしまう。
通常の設定ではBGPのように特定の機器同士でOSPFネイバーを確立することは出来ない。
この前提条件の元接続方法や構成を変更せずに特定のOSPFネイバーを確立する設定の仕方。

Diagram


                _________________
                |               |
                |      SW       |
                |_______________|
                        |.254
                        |
            -------------------------   192.168.0.0/24
                |               |
                |.1             |.2
            ____|___        ____|___
            |        |     |        |
            |   R1   |     |   R2   |
            |________|     |________|

Command


OSPF Enable

router ospf [process]
 network [Network] [Wildcard] area [Number]

OSPF Static Neighbor

interface [I/F-Type] [I/F No]
 ip ospf network non-broadcast

router ospf [process]
 neighbor [TargetAddress]

Configuration

SW

hostname SW

interface Vlan1
 ip address 192.168.0.254 255.255.255.0
 ip ospf network non-broadcast

router eigrp 1
 network 192.168.0.0
 neighbor 192.168.0.1 Vlan1
 neighbor 192.168.0.2 Vlan1

R1

hostname R1

interface GigabitEthernet0/0
 ip address 192.168.0.1 255.255.255.0
 ip ospf network non-broadcast

router ospf 1
 network 192.168.0.0 0.0.0.255 area 0
 neighbor 192.168.0.254

R2

hostname R2

interface GigabitEthernet0/0
 ip address 192.168.0.2 255.255.255.0
 ip ospf network non-broadcast

router ospf 1
 network 192.168.0.0 0.0.0.255 area 0
 neighbor 192.168.0.254

Status


SW

SW#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.1       1   FULL/DROTHER    00:01:39    192.168.0.1     Vlan1
192.168.0.2       1   FULL/BDR        00:01:53    192.168.0.2     Vlan1

R1

R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.254     1   FULL/DR         00:01:59    192.168.0.254   Ethernet0/0

R2

R2#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.254     1   FULL/DR         00:01:53    192.168.0.254   Ethernet0/0

Supplement


補足として[network type]を変更しなかった場合のStatusを記載
( Case by not change of [network type] )

SW

SW#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.1       1   FULL/BDR        00:00:39    192.168.0.1     Vlan1
192.168.0.2       1   FULL/DROTHER    00:00:33    192.168.0.2     Vlan1

R1

R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.2       1   FULL/DROTHER    00:00:33    192.168.0.2     Ethernet0/0
192.168.0.254     1   FULL/DR         00:00:36    192.168.0.254   Ethernet0/0

R2

R2#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.0.1       1   FULL/BDR        00:00:31    192.168.0.1     Ethernet0/0
192.168.0.254     1   FULL/DR         00:00:39    192.168.0.254   Ethernet0/0