frame-relay down時のバックアップ経路設計 -virtual-link-




条件
・R2がR4へ疎通するためにはR5を経由することとする。(双方向とも)
・R1,R2,R4,R5のLo0をOSPF0へアドバタイズする。アドバタイズするアドレスのプレフィックスは
/32とするべきもの意外は/24とすること。
・R4-R5間のシリアルリンクにてOSPF area 45を設定する。
 この経路はframe-relayリンクが死んでしまった場合のバックアップ経路とする。
 また、backup interface コマンドは使ってはいけません。
・OSPF area0に余計な経路情報が入ってこないようarea 0にハッシュ付きの認証を設定しなさい。

下記の初期コンフィグからスタート。

R5
interface Loopback0
 ip address 5.5.5.5 255.255.255.255
!
interface Serial1/0
encap frame-relay
!
interface Serial1/0.15
 ip address 192.168.15.5 255.255.255.0
 frame-relay interface-dlci 501
!
interface Serial1/0.245
 ip address 192.168.245.5 255.255.255.0
 frame-relay map ip 192.168.245.2 502 broadcast
 frame-relay map ip 192.168.245.4 504 broadcast
!
router ospf 1
 network 192.168.15.0 0.0.0.255 area 0
 network 192.168.245.0 0.0.0.255 area 0

R1
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface Serial1/0
 encap frame-relay
 ip address 192.168.15.1 255.255.255.0
 frame-relay map ip 192.168.15.5 105 broadcast
!
router ospf 1
 network 192.168.15.0 0.0.0.255 area 0

R2
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Serial1/0
 encap frame-relay
 ip address 192.168.245.2 255.255.255.0
 frame-relay map ip 192.168.245.5 205 broadcast
!
router ospf 1
 network 192.168.245.0 0.0.0.255 area 0

R4
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
!
interface Serial1/0
 encap frame-relay
 ip address 192.168.245.4 255.255.255.0
 frame-relay map ip 192.168.245.5 405 broadcast
!
router ospf 1
 network 192.168.245.0 0.0.0.255 area 0
R5-R1 が point-to-point で、R5-R2,R4 がhub and spoke ですな。
この状態だと network type が non-broadcast なので neighbor になれてません。
hub and spoke のほうはOSPF broadcast でも設定できるのかな。って一旦やってみよう。
んー、broadcast だとなんか経路はもらえるけど、ネクストホップがハブルータになって
くれなくてpingがとばないっぽいなぁ。なんかやり方あるのかな。

なので、やはり point-to-point と point-to-multipoint を使いますね。

R5
int s1/0.15 point-to-point
ip ospf network point-to-point

int s1/0.245 multicast
ip ospf network point-to-mutipoint

router ospf 1
net 5.5.5.5 0.0.0.0 area 0

R1
int s1/0.15
ip ospf network point-to-point

router ospf 1
net 1.1.1.1 0.0.0.0 area 0

R2
int s1/0.245
ip ospf network point-to-multipoint

router ospf 1
net 2.2.2.2 0.0.0.0 area 0

R4
int s1/0.245
ip ospf network point-to-multipoint

router ospf 1
net 4.4.4.4 0.0.0.0 area 0

これで以下の問題が解決できることになります。/32とするべきもの。は以後のMPLSの問題に
かかわるところらしいので一旦考えないこととするです。

・R2がR4へ疎通するためにはR5を経由することとする。(双方向とも)
・R1,R2,R4,R5のLo0をOSPF0へアドバタイズする。アドバタイズするアドレスのプレフィックスは
/32とするべきもの意外は/24とすること。

↓こんな感じでR2がR4にいくにはR5を経由していることがわかりますね。

R2
Gateway of last resort is not set

     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
O    192.168.15.0/24 [110/128] via 192.168.245.5, 00:08:54, Serial1/0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/129] via 192.168.245.5, 00:08:54, Serial1/0
     5.0.0.0/32 is subnetted, 1 subnets
O       5.5.5.5 [110/65] via 192.168.245.5, 00:08:54, Serial1/0
     192.168.245.0/24 is variably subnetted, 3 subnets, 2 masks
O       192.168.245.5/32 [110/64] via 192.168.245.5, 00:08:54, Serial1/0
O       192.168.245.4/32 [110/128] via 192.168.245.5, 00:08:54, Serial1/0
C       192.168.245.0/24 is directly connected, Serial1/0
はい。次は、
・R4-R5間のシリアルリンクにてOSPF area 45を設定する。
 この経路はframe-relayリンクが死んでしまった場合のバックアップ経路とする。
 また、backup interface コマンドは使ってはいけません。


上記図のとおりR5-R4 間のframe-relayリンクが死んだらSerial リンクを通るように
するのだが、R4の背後にはarea4、area44がいるため、area45 を経由するには virtual-link を
形成する必要があると。それはわかるけど、backup interface を使えば virtual link を使わなくても
できるものなのかな?
よくわからんけど、とりあえず Virtual link でこの要件を達成させてみましょ。

まずはR4で擬似的に Area4 を作ります。

R4
interface lo1
ip add 40.40.40.40 255.255.255.255

router ospf 1
net 40.40.40.40 0.0.0.0 area 4

次に、R4,R5 間のvirtual-link作成。

R5
int s1/1
ip add 172.17.0.5 255.255.255.0

router ospf 1
net 172.17.0.0 0.0.0.255 area 45
area 45 virtual-link 40.40.40.40

R4
int s1/1
ip add 172.17.0.4 255.255.255.0

router ospf 1
net 172.17.0.0 0.0.0.255 area 45
area 45 virtual-link 5.5.5.5

virtual-link コマンドのアドレスは対抗のip address ではなく、router-id
なので、お間違えなく!

これで、↓なかんじで virtual-link がupしました。

R4#sh ip ospf virtual-links
Virtual Link OSPF_VL0 to router 5.5.5.5 is up
  Run as demand circuit
  DoNotAge LSA allowed.
  Transit area 45, via interface Serial1/1, Cost of using 64
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:09
    Adjacency State FULL (Hello suppressed)
    Index 2/3, retransmission queue length 0, number of retransmission 0
    First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
    Last retransmission scan length is 0, maximum is 0
    Last retransmission scan time is 0 msec, maximum is 0 msec
R4#
しかし、R5 で 40.40.40.40 あての経路を見ると2経路でロードバランスしちゃってます。
シリアルリンクはバックアップ経路で、とのことなので、優先度をさげてやらにゃあきまへん。

R5
O IA    40.40.40.40 [110/65] via 192.168.245.4, 00:00:14, Serial1/0.245
                    [110/65] via 172.17.0.4, 00:00:14, Serial1/1

R5
int s1/1
ip ospf cost 65534

R4 int s1/1
ip ospf cost 65534

値は、大きくなればなんでもいいぽい。
これで、正常時に経路は、frame-relay を通るものだけになりました。
じゃあ障害試験やってみますか。

R4
int s1/0
shut

R5
正常時
O IA 40.40.40.40 [110/65] via 192.168.245.4, 00:00:02, Serial1/0.245

障害時
O IA 40.40.40.40 [110/65535] via 172.17.0.4, 00:00:02, Serial1/1

ちゃんときれいに切り替わりました。うん。気持ちいいね。

で、最後の課題。
・OSPF area0に余計な経路情報が入ってこないようarea 0にハッシュ付きの認証を設定しなさい。

これは、area 0 と忘れちゃいけないのが、virtual-link の部分。area45だから違うよねー
と思っていたら大間違いで、virtual-link はarea0 の扱いとなるのだそうで、ここも設定しないとダメよー

R1
int s1/0
ip ospf message-digest-key 1 md5 cisco

router ospf 1
area 0 authentication message-digest

R2
int s1/0
ip ospf message-digest-key 1 md5 cisco

router ospf 1
area 0 authentication message-digest

R4
int s1/0
ip ospf message-digest-key 1 md5 cisco

router ospf 1
area 0 authentication message-digest
area 45 virtual-link message-digest-key 1 md5 cisco

R5
int s1/0.15 point-to-point
ip ospf message-digest-key 1 md5 cisco

router ospf 1
area 0 authentication message-digest
area 45 virtual-link message-digest-key 1 md5 cisco

ってかんじですね。。

R4#sh ip ospf virtual-links
Virtual Link OSPF_VL0 to router 5.5.5.5 is up
  Run as demand circuit
  DoNotAge LSA allowed.
  Transit area 45, via interface Serial1/1, Cost of using 65534
  Transmit Delay is 1 sec, State POINT_TO_POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:03
  
sh ip ospf virtual-link をみると認証がついていることがわかりますね。
よしっ終わり終わり!