Juniper vLabs - OSPF Single-area
#network #Juniper-vLabs
概要
https://jlabs.juniper.net/vlabs/portal/ospf-single-area/
トポロジ
https://gyazo.com/8d0a3d2a699b61249a19948ba900cf21
課題
OSPFを試してみる。
エリアを2つに分ける。
IGPをIS-ISに変更する。
BGPを追加する。
作業ログ
とりあえずvMX1に入ってみる。
デフォルトでは、OSPFのルータIDはloになるっぽい?
コストは全て同じコストにしてある?
つまり、10.100.23.0/24, 10.100.24.0/24, 10.100.34.0/24はECMPになる?
tracerouteで調べてみよう。
10.100.23.0/24は全て10.100.13.2に流れている
この事実は、show routeからでも調べられる。
show route forwarding-table destination 10.100.23.1でも調べられる。
Equal Cost Multipath Routing
以下の設定を入れてみる。これだけでECMPになっているっぽい。
code:config
set policy-options policy-statement {{name}} from protocol ospf
set policy-options policy-statement {{name}} then load-balance per-packet
set routing-options forwarding-table export {{name}}
でもこれだと、10.100.24.0/24も10.100.34.0/24もECMPになってしまう。
今回は別にそれでもいいが、あるサブネットだけECMPにしたい場合はどうすればいいか?
set routing-options forwarding-table exportの後には式が取れるらしい。
なら、そこでANDで指定できそう?
エリア分割
とりあえず、vMX1とvMX2がエリア0, vMX3がエリア1, vMX4がエリア2になるようにしたい。
するだけなら超簡単
code:config - vMX1
delete protocols ospf area 0.0.0.0 interface ge-0/0/1
delete protocols ospf area 0.0.0.0 interface ge-0/0/2
set protocols ospf area 0.0.0.2 interface ge-0/0/1
set protocols ospf area 0.0.0.1 interface ge-0/0/2
code:config - vMX2
delete protocols ospf area 0.0.0.0 interface ge-0/0/1
delete protocols ospf area 0.0.0.0 interface ge-0/0/2
set protocols ospf area 0.0.0.1 interface ge-0/0/1
set protocols ospf area 0.0.0.2 interface ge-0/0/2
code:config - vMX3
delete protocols ospf area 0.0.0.0 interface ge-0/0/0
delete protocols ospf area 0.0.0.0 interface ge-0/0/1
delete protocols ospf area 0.0.0.0 interface ge-0/0/2
delete protocols ospf area 0.0.0.0 interface lo0
set interfaces ge-0/0/0 disable
set protocols ospf area 0.0.0.1 interface ge-0/0/1
set protocols ospf area 0.0.0.1 interface ge-0/0/2
set protocols ospf area 0.0.0.1 interface lo0
code:config - vMX4
delete protocols ospf area 0.0.0.0 interface ge-0/0/0
delete protocols ospf area 0.0.0.0 interface ge-0/0/1
delete protocols ospf area 0.0.0.0 interface ge-0/0/2
delete protocols ospf area 0.0.0.0 interface lo0
set interface ge-0/0/0 disable
set protocols ospf area 0.0.0.2 interface ge-0/0/1
set protocols ospf area 0.0.0.2 interface ge-0/0/2
set protocols ospf area 0.0.0.2 interface lo0