作業環境
- RTX1200
- Rev.10.01.53
- Cisco C891FJ-K9
- バージョン:15.3(3)M5
検証構成
以下のような構成で OSPF の設定をしてみます。
RTX の OSPF 設定
RTX では以下のように設定します。
- OSPF 有効化
- OSPF エリア
- backbone (エリア0)
- lan1
- OSPF エリア backbone (エリア 0)
- パッシブインターフェース
- lan2
- OSPF エリア backbone (エリア 0)
- ルータ ID
- 設定しない
OSPF の有効化設定
まず以下コマンドで機器自体の OSPF を有効化します。
ospf use on
# ospf use on
OSPF エリアの設定
以下コマンドで機器が含まれる OSPF エリアを設定します。
ospf area <エリア>
- エリアは以下から指定
- backbone(エリア 0 の意味)
- 数値(エリア番号)
- エリアは以下から指定
# ospf area backbone
インターフェースでの OSPF 設定
OSPF を動作させるインターフェースでは以下のように設定します。
ip <IF名> ospf area <エリア> [passive]
- IF名は、lan1、lan2 など
- エリアは backbone またはエリア番号を指定
- パッシブインターフェースとする場合は passive を指定
# ip lan1 ospf area backbone passive
# ip lan2 ospf area backbone
ルータ ID の設定
今回の例では特に設定しませんが、ルータ ID を設定する場合は以下のコマンドで設定します。
ospf router id <ルータID>
OSPF に関する設定変更の反映
OSPF に関する設定変更は、以下のコマンドを実行することで初めて反映されます。
ospf configure refresh
OSPF に関する設定変更を行った後は必ずこのコマンドを実行します。
# ospf configure refresh
OSPF 関連コンフィグまとめ
ip lan1 address 192.168.100.1/24
ip lan1 ospf area backbone passive
ip lan2 address 10.20.30.1/30
ip lan2 ospf area backbone
ospf use on
ospf area backbone
C891FJ のコンフィグ
C891FJ の関係するコンフィグは以下の通りです。
interface GigabitEthernet0
switchport access vlan 123
no ip address
!
interface GigabitEthernet1
switchport access vlan 192
no ip address
!
interface Vlan123
ip address 10.20.30.2 255.255.255.252
!
interface Vlan192
ip address 192.168.50.254 255.255.255.0
!
router ospf 1
passive-interface Vlan192
network 10.20.30.0 0.0.0.3 area 0
network 192.168.50.0 0.0.0.255 area 0
!
OSPF 状態確認
RTX での状態確認
show status ospf neighbor
# show status ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
192.168.50.254 1 FULL/DR 00:00:36 10.20.30.2 LAN2
show status ospf database
# show status ospf database
OSPF Router ID: 10.20.30.1
Stub Link States (Area backbone)
Link ID ADV Router Age Seq# Checksum
192.168.50.0 192.168.50.254 3401 0x00000000 0xF0C0
192.168.100.0 10.20.30.1 3364 0x00000000 0x5A82
Router Link States (Area backbone)
Link ID ADV Router Age Seq# Checksum Link count
10.20.30.1 10.20.30.1 1572 0x80000005 0x8BF0 2
192.168.50.254 192.168.50.254 1485 0x8000000E 0xD0F6 2
Net Link States (Area backbone)
Link ID ADV Router Age Seq# Checksum
10.20.30.2 192.168.50.254 1485 0x80000002 0x8CFE
show status ospf interface
# show status ospf interface
LAN2: Area backbone
Router ID: 10.20.30.1, Interface address: 10.20.30.1/30
Interface type: BROADCAST cost=1
Interface state: BDR priority=1
Designated router ID: 192.168.50.254, IP address: 10.20.30.2
Backup designated router ID: 10.20.30.1, IP address: 10.20.30.1
LAN1: Area backbone
Router ID: 10.20.30.1, Interface address: 192.168.100.1/24
Interface type: BROADCAST cost=1
Interface state: DR priority=1
Designated router ID: 10.20.30.1, IP address: 192.168.100.1
show ip route
# show ip route
宛先ネットワーク ゲートウェイ インタフェース 種別 付加情報
10.20.30.0/30 10.20.30.1 LAN2 implicit
192.168.50.0/24 10.20.30.2 LAN2 OSPF cost=2
192.168.100.0/24 192.168.100.1 LAN1 implicit
C891FJ での状態確認
show ip ospf neighbor
# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
10.20.30.1 1 FULL/BDR 00:00:35 10.20.30.1 Vlan123
show ip ospf database
# show ip ospf database
OSPF Router with ID (192.168.50.254) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
10.20.30.1 10.20.30.1 6 0x80000006 0x0089F1 2
192.168.50.254 192.168.50.254 1716 0x8000000E 0x00D0F6 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
10.20.30.2 192.168.50.254 1716 0x80000002 0x008CFE
show ip protocols
# show ip protocols
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 192.168.50.254
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
10.20.30.0 0.0.0.3 area 0
192.168.50.0 0.0.0.255 area 0
Passive Interface(s):
Vlan192
Routing Information Sources:
Gateway Distance Last Update
10.20.30.1 110 01:00:30
Distance: (default is 110)
show ip route
# show ip route
Codes: L - local, C - connected, S - static, 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
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, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.20.30.0/30 is directly connected, Vlan123
L 10.20.30.2/32 is directly connected, Vlan123
192.168.50.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.50.0/24 is directly connected, Vlan192
L 192.168.50.254/32 is directly connected, Vlan192
O 192.168.100.0/24 [110/2] via 10.20.30.1, 01:01:46, Vlan123