0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【後編】ネットワーク構築(OSPF)

Posted at

今回やること

前回から引き続きとなります。
前回は構成図作成まで終わっているので、構築からスタートしていきたいと思います。
構築して、ルート集約までやっていきます。

前回の記事
【前編】ネットワーク構築(OSPF)

ネットワーク構成図

前回同様となります。

OSPF_マルチエリア.jpg

構築

では早速構築していきます。

今回設定したい内容は以下
1、OSPFの基本設定
2、R3,R4のRIPv2の設定
3、エリア間のルート集約
4、外部ルートの集約
5、最後にテーブルを見て集約状況確認

まずはR1から設定していきます。

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int f0/1
R1(config-if)#ip add 192.168.12.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
*Mar  1 00:01:32.074: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:01:33.076: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-router)#net 192.168.12.0 0.0.0.255 area 0
R1(config-router)#end
R1#

次にR2の設定です。

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int f0/0
R2(config-if)#ip add 192.168.12.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#
*Mar  1 00:03:12.920: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:03:13.921: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config)#int f0/1
R2(config-if)#ip add 192.168.23.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#
*Mar  1 00:03:37.933: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:03:38.934: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R2(config)#router ospf 1
R2(config-router)#net 192.168.12.0 0.0.0.255 area 0
R2(config-router)#net 192.168.23.
*Mar  1 00:04:08.623: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.12.1 on FastEthernet0/0 from LOADING to FULL, Loading Done
R2(config-router)#net 192.168.23.0 0.0.0.255 area 10
R2(config-router)#end
R2#

次にR3です。
まずはループバックから振っていきます。

R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#int l0
R3(config-if)#
*Mar  1 00:06:00.314: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R3(config-if)#ip add 10.0.0.1 255.255.255.255
R3(config-if)#exit
R3(config)#int l1
R3(config-if)#
*Mar  1 00:06:19.209: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
R3(config-if)#ip add 10.0.0.2 255.255.255.255
R3(config-if)#exit
R3(config)#int l2
R3(config-if)#ip add
*Mar  1 00:06:45.741: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback2, changed state to up
R3(config-if)#ip add 10.0.0.3 255.255.255.255
R3(config-if)#exit
R3(config)#

続いてOSPFの基本設定を投入していきます。

R3(config)#int f0/0
R3(config-if)#ip add 192.168.23.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exi
*Mar  1 00:12:34.528: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:12:35.530: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#exit
R3(config)#int f0/1
R3(config-if)#ip add 192.168.34.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#
*Mar  1 00:13:21.277: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:13:22.279: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R3(config)#router ospf 1
R3(config-router)#net 192.168.23.0 0.0.0.255 area 10
R3(config-router)#net 10.0.0.1
*Mar  1 00:13:57.560: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
R3(config-router)#net 10.0.0.1 0.0.0.0 area 10
R3(config-router)#net 10.0.0.2 0.0.0.0 area 10
R3(config-router)#net 10.0.0.3 0.0.0.0 area 10
R3(config-router)#
R3(config-router)#re
R3(config-router)#redistribute rip metric 1 sub
R3(config-router)#exit

続いてRIPv2の設定を投入していきます。

R3(config)#router rip
R3(config-router)#v 2
R3(config-router)#no auto
R3(config-router)#no auto-summary
R3(config-router)#net 192.168.34.0
R3(config-router)#end
R3#
*Mar  1 00:19:00.012: %SYS-5-CONFIG_I: Configured from console by console
R3#

次にR4の設定を投入していきます。
まずはループバックから。

R4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#int l0
R4(config-if)#ip add
*Mar  1 00:21:42.935: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R4(config-if)#ip add 20.0.0.1 255.255.255.255
R4(config-if)#exit
R4(config)#int l1
R4(config-if)#ip add
*Mar  1 00:22:04.783: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up
R4(config-if)#ip add 20.0.0.2 255.255.255.255
R4(config-if)#exit
R4(config)#int l2
R4(config-if)#ip add
*Mar  1 00:22:31.062: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback2, changed state to up
R4(config-if)#ip add 20.0.0.3 255.255.255.255
R4(config-if)#exit
R4(config)#int l3
R4(config-if)#ip
*Mar  1 00:25:32.315: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback3, changed state to up
R4(config-if)#ip add 30.0.0.1 255.255.255.255
R4(config-if)#exit
R4(config)#

次はRIPv2の設定を投入していきます。

R4(config)#int f0/0
R4(config-if)#ip add 192.168.34.4 255.255.255.0
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#
*Mar  1 00:29:25.069: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:29:26.071: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R4(config)#router rip
R4(config-router)#v 2
R4(config-router)#net 20.0.0.0
R4(config-router)#net 30.0.0.0
R4(config-router)#net 192.168.34.0
R4(config-router)#end
R4#

これで一通りの構築が完了しました。
次に状態確認をしていきます。

状態確認

まずはネイバー関係が確立されているかを見てみます。

R2#show ip ospf nei

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.12.1      1   FULL/DR         00:00:32    192.168.12.1    FastEthernet0/0
10.0.0.3          1   FULL/BDR        00:00:32    192.168.23.3    FastEthernet0/1
R2#

ネイバーはOKですね。
次にR1のテーブルを見てみます。

R1#show ip route ospf
O E2 20.0.0.0/8 [110/1] via 192.168.12.2, 00:04:56, FastEthernet0/1
     10.0.0.0/32 is subnetted, 3 subnets
O IA    10.0.0.2 [110/3] via 192.168.12.2, 00:20:59, FastEthernet0/1
O IA    10.0.0.3 [110/3] via 192.168.12.2, 00:20:49, FastEthernet0/1
O IA    10.0.0.1 [110/3] via 192.168.12.2, 00:21:09, FastEthernet0/1
O IA 192.168.23.0/24 [110/2] via 192.168.12.2, 00:30:59, FastEthernet0/1
O E2 192.168.34.0/24 [110/1] via 192.168.12.2, 00:16:23, FastEthernet0/1
O E2 30.0.0.0/8 [110/1] via 192.168.12.2, 00:04:56, FastEthernet0/1
R1#

20.台が自動集約されてるように見えますね。
no auto-summaryで自動集約切っているはずなのに・・・
うーん、これはもっと調べないといけません。

集約の設定を投入してみてどうなるか見てみたいと思います。

ルート集約

では早速集約の設定投入してみたいと思います。

R2からやっていきます。

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#area 10 ran 10.0.0.0 255.255.255.0
R2(config-router)#exit
R2(config)#

R3でも一応投入してみます。

R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router ospf 1
R3(config-router)#summa
R3(config-router)#summary-address 20.0.0.0 255.255.255.0
R3(config-router)#end
R3#

これでエリア間と外部の集約設定が完了しました。
状態を見ていきます。

状態確認

さてR1のテーブルを見ていきます。

R1#show ip route ospf
     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.0.0.0 [110/1] via 192.168.12.2, 00:02:33, FastEthernet0/1
     10.0.0.0/24 is subnetted, 1 subnets
O IA    10.0.0.0 [110/3] via 192.168.12.2, 00:04:27, FastEthernet0/1
O IA 192.168.23.0/24 [110/2] via 192.168.12.2, 01:05:26, FastEthernet0/1
O E2 192.168.34.0/24 [110/1] via 192.168.12.2, 00:04:22, FastEthernet0/1
O E2 30.0.0.0/8 [110/1] via 192.168.12.2, 00:04:22, FastEthernet0/1
R1#

お、きちんと /24 で集約されていますね。
これでやりたいことはできました。

まとめ

途中自動集約されているように見えて、どこか間違ったかな?と思いましたが、きちんと集約することができました。

R4でループバックを30.でひとつ作りましたが、20.で集約した後に30.は不要なのでACLのdenyで外す
とこまでやりたかったですが、時間が足りずでした。
またどこかのタイミングでやろうと思います。

外すためにはディストリビュートリストの設定でpermitとdenyでうまいことやれば
いけそうです。

その辺も調べて試そうと思います。

以上となります。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?