- RT-A に以下の設定をしなさい。ただし、OSPF は network コマンドを使用しない方法で設定しなさい。
< RT-A >
Router# conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# host RT-A
RT-A(config)# int Lo0
RT-A(config-if)# ip add 192.168.1.1 255.255.255.224
RT-A(config-if)# ip ospf network point-to-point
RT-A(config-if)# ip ospf 10 area 0
RT-A(config-if)# int f0/1
RT-A(config-if)# ip add 192.168.1.33 255.255.255.224
RT-A(config-if)# ip ospf 10 area 0
RT-A(config-if)# no shut
RT-A(config-if)# router ospf 10
RT-A(config-router)# ^Z
RT-A#
OSPF を有効にしたいインターフェイスで ip ospf [process id] area [area id] コマンドを実行することにより、隣接ルータと OSPF hello パケット等を送受信することができます。ただし、network コマンドを使った方が簡単ですね。
- RT-B に以下の設定をしなさい。ただし、OSPF は network コマンドを使用しない方法で設定しなさい。
< RT-B >
Router# conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# host RT-B
RT-B(config)# int Lo0
RT-B(config-if)# ip add 172.16.1.2 255.255.255.0
RT-B(config-if)# ip ospf network point-to-point
RT-B(config-if)# ip ospf 10 area 0
RT-B(config-if)# int f0/0
RT-B(config-if)# ip add 192.168.1.34 255.255.255.224
RT-B(config-if)# ip ospf 10 area 0
RT-B(config-if)# no shut
RT-B(config-if)# int f0/1
RT-B(config-if)# ip add 172.16.2.2 255.255.255.0
RT-B(config-if)# ip ospf 10 area 0
RT-B(config-if)# no shut
RT-B(config-if)# router ospf 10
RT-B(config-router)# ^Z
RT-B#
ループバックインターフェイスでの ip ospf network point-to-point コマンドも忘れずに。
- RT-C に以下の設定をしなさい。ただし、OSPF は network コマンドを使用しない方法で設定しなさい。
< RT-C >
Router# conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# host RT-C
RT-C(config)# int Lo0
RT-C(config-if)# ip add 10.10.10.3 255.255.0.0
RT-C(config-if)# ip ospf network point-to-point
RT-C(config-if)# ip ospf 10 area 0
RT-C(config-if)# int f0/0
RT-C(config-if)# ip add 172.16.2.3 255.255.255.0
RT-C(config-if)# ip ospf 10 area 0
RT-C(config-if)# no shut
RT-C(config-if)# router ospf 10
RT-C(config-router)# ^Z
RT-C#
- 送信元アドレスに 192.168.1.1 を使い、RT-A から RT-B の Lo0 宛てに ping を実行しなさい。
< RT-A >
RT-A# ping 172.16.2.2 source 192.168.1.1 ← 192.168.1.1 が送信元IPアドレス
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.2, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!! ← ping 成功
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
RT-A#
ping が成功しました。
- 送信元アドレスに 192.168.1.1 を使い、RT-A から RT-C の Lo0 宛てに ping を実行しなさい。
< RT-A >
RT-A# ping 10.10.10.3 source 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.3, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
!!!!! ← ping 成功
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
RT-A#
ping が成功しました。
OSPF の設定だけで通信可能です。
- RT-A、RT-B、RT-C のルーティングテーブル (OSPF) を表示させなさい。
< RT-A >
RT-A# sh ip route ospf | begin Gateway
Gateway of last resort is not set
10.0.0.0/16 is subnetted, 1 subnets
O 10.10.0.0 [110/3] via 192.168.1.34, 00:00:06, FastEthernet0/1
172.16.0.0/24 is subnetted, 2 subnets
O 172.16.1.0 [110/2] via 192.168.1.34, 00:00:17, FastEthernet0/1
O 172.16.2.0 [110/2] via 192.168.1.34, 00:01:33, FastEthernet0/1
RT-A#
OSPF では自動集約されずにそれぞれのルート情報がルーティングテーブルに載っています。
自動集約機能がないので当然ながら OSPF には auto-summary コマンドはありません。
RT-A(config)#router ospf 10
RT-A(config-router)#a?
address-family area auto-cost
RT-A(config-router)#a
< RT-B >
RT-B# sh ip route ospf | begin Gateway
Gateway of last resort is not set
10.0.0.0/16 is subnetted, 1 subnets
O 10.10.0.0 [110/2] via 172.16.2.3, 00:00:15, FastEthernet0/1
192.168.1.0/24 is variably subnetted, 3 subnets, 2 masks
O 192.168.1.0/27 [110/2] via 192.168.1.33, 00:00:36, FastEthernet0/0
RT-B#
< RT-C >
RT-C# sh ip route ospf | begin Gateway
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
O 172.16.1.0/24 [110/2] via 172.16.2.2, 00:00:33, FastEthernet0/0
192.168.1.0/27 is subnetted, 2 subnets
O 192.168.1.0 [110/3] via 172.16.2.2, 00:00:43, FastEthernet0/0
O 192.168.1.32 [110/2] via 172.16.2.2, 00:01:49, FastEthernet0/0
RT-C#
- RT-A、RT-B、RT-C のネイバー関係データベースを表示させなさい。
< RT-A >
RT-A# sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.16.1.2 1 FULL/BDR 00:00:34 192.168.1.34 FastEthernet0/1
RT-A#
< RT-B >
RT-B# sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
10.10.10.3 1 FULL/BDR 00:00:37 172.16.2.3 FastEthernet0/1
192.168.1.1 1 FULL/DR 00:00:37 192.168.1.33 FastEthernet0/0
RT-B#
< RT-C >
RT-C# sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.16.1.2 1 FULL/DR 00:00:38 172.16.2.2 FastEthernet0/0
RT-C#
- RT-A、RT-B、RT-C のリンクステートデータベースを表示させなさい。
< RT-A >
RT-A# sh ip ospf database
OSPF Router with ID (192.168.1.1) (Process ID 10)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
10.10.10.3 10.10.10.3 535 0x80000004 0x0061E4 2
172.16.1.2 172.16.1.2 545 0x80000007 0x00FF35 3
192.168.1.1 192.168.1.1 553 0x80000004 0x00687D 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.2.2 172.16.1.2 674 0x80000001 0x0034A4
192.168.1.33 192.168.1.1 618 0x80000001 0x00B680
RT-A#
< RT-B >
RT-B# sh ip ospf database
OSPF Router with ID (172.16.1.2) (Process ID 10)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
10.10.10.3 10.10.10.3 582 0x80000004 0x0061E4 2
172.16.1.2 172.16.1.2 592 0x80000007 0x00FF35 3
192.168.1.1 192.168.1.1 603 0x80000004 0x00687D 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.2.2 172.16.1.2 722 0x80000001 0x0034A4
192.168.1.33 192.168.1.1 668 0x80000001 0x00B680
RT-B#
< RT-C >
RT-C# sh ip ospf database
OSPF Router with ID (10.10.10.3) (Process ID 10)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
10.10.10.3 10.10.10.3 608 0x80000004 0x0061E4 2
172.16.1.2 172.16.1.2 620 0x80000007 0x00FF35 3
192.168.1.1 192.168.1.1 631 0x80000004 0x00687D 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
172.16.2.2 172.16.1.2 749 0x80000001 0x0034A4
192.168.1.33 192.168.1.1 696 0x80000001 0x00B680
RT-C#
- RT-A、RT-B、RT-C で sh ip protocols コマンドを実行しなさい。
< RT-A >
*** IP Routing is NSF aware ***
Routing Protocol is "ospf 10"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 192.168.1.1
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
Routing on Interfaces Configured Explicitly (Area 0):
Loopback0
FastEthernet0/1
Routing Information Sources:
Gateway Distance Last Update
10.10.10.3 110 00:02:09
172.16.1.2 110 00:02:09
Distance: (default is 110)
RT-A#
< RT-B >
RT-B# sh ip protocols
*** IP Routing is NSF aware ***
Routing Protocol is "ospf 10"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 172.16.1.2
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
Routing on Interfaces Configured Explicitly (Area 0):
Loopback0
FastEthernet0/1
FastEthernet0/0
Routing Information Sources:
Gateway Distance Last Update
10.10.10.3 110 00:08:52
192.168.1.1 110 00:08:52
Distance: (default is 110)
RT-B#
< RT-C >
RT-C# sh ip protocols
*** IP Routing is NSF aware ***
Routing Protocol is "ospf 10"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 10.10.10.3
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
Routing on Interfaces Configured Explicitly (Area 0):
Loopback0
FastEthernet0/0
Routing Information Sources:
Gateway Distance Last Update
192.168.1.1 110 00:08:54
172.16.1.2 110 00:08:54
Distance: (default is 110)
RT-C#