1. OSPF external type 1 이 type 2 보다 우선함.
[R2]--------[R4]
| / |
| / |
| / |
| / |
[R1]--------[R3]
R1 설정
- static 10.10.10.0/24 를 ospf로 재분배 및 ospf type 1 설정
chano@vMX_01# show policy-options | display set
set policy-options policy-statement static_to_ospf term 10 from protocol static
set policy-options policy-statement static_to_ospf term 10 then external type 1
set policy-options policy-statement static_to_ospf term 10 then accept
set policy-options policy-statement static_to_ospf term 20 then reject
chano@vMX_01# show routing-options | display set
set routing-options static route 10.10.10.0/24 discard
set routing-options router-id 172.27.255.1
2. external type 1 는 경로에 있는 모든 링크 cost 값을 더함.
external type 2 는 경로에 있는 모든 링크 cost 값을 무시함.
[R2]--------[R4]---------[R5]
|
|
|
|
[R1]
- 모든 링크 cost는 1로 설정함.
R1 설정
- R1 에서 10.10.10.0/24 대역을 ospf type 1 으로 광고
chano@vMX_01# show policy-options | display set
set policy-options policy-statement static_to_ospf term 10 from protocol static
set policy-options policy-statement static_to_ospf term 10 then external type 1
set policy-options policy-statement static_to_ospf term 10 then accept
set policy-options policy-statement static_to_ospf term 20 then reject
chano@vMX_01# show protocols ospf | display set
set protocols ospf export static_to_ospf
set protocols ospf area 0.0.0.0 interface ae1.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface ge-0/0/6.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface lo0.0 passive
set protocols ospf area 0.0.0.1 interface ge-0/0/3.0 interface-type p2p
R5 에서 확인
chano@vMX_05> show route 10.10.10.0/24 extensive
inet.0: 21 destinations, 21 routes (21 active, 0 holddown, 0 hidden)
10.10.10.0/24 (1 entry, 1 announced)
TSI:
KRT in-kernel 10.10.10.0/24 ->
*OSPF Preference: 150
Next hop type: Router, Next hop index: 561
Address: 0x9700438
Next-hop reference count: 13
Next hop: 172.27.0.21 via ae2.0, selected
Session Id: 0x142
State: <Active Int Ext>
Age: 2:21 Metric: 3 ( R1<---> R5경로의 cost를 더한 값(1+1+1)이 출력. )
Validation State: unverified
Tag: 0
Task: OSPF
Announcement bits (1): 0-KRT
AS path: I
R1 설정
- R1 에서 10.10.10.0/24 대역을 ospf type 2 으로 광고
chano@vMX_01# show policy-options | display set
set policy-options policy-statement static_to_ospf term 10 from protocol static
set policy-options policy-statement static_to_ospf term 10 then external type 2
set policy-options policy-statement static_to_ospf term 10 then accept
set policy-options policy-statement static_to_ospf term 20 then reject
R1 설정
- R1 에서 10.10.10.0/24 대역을 ospf type 2 으로 광고 (metric 100 설정)
chano@vMX_01# show policy-options | display set
set policy-options policy-statement static_to_ospf term 10 from protocol static
set policy-options policy-statement static_to_ospf term 10 then metric 100
set policy-options policy-statement static_to_ospf term 10 then external type 2
set policy-options policy-statement static_to_ospf term 10 then accept
set policy-options policy-statement static_to_ospf term 20 then reject
R5 에서 확인
chano@vMX_05> show route 10.10.10.0/24 extensive
inet.0: 21 destinations, 21 routes (21 active, 0 holddown, 0 hidden)
10.10.10.0/24 (1 entry, 1 announced)
TSI:
KRT in-kernel 10.10.10.0/24 ->
*OSPF Preference: 150
Next hop type: Router, Next hop index: 561
Address: 0x9700438
Next-hop reference count: 13
Next hop: 172.27.0.21 via ae2.0, selected
Session Id: 0x142
State: <Active Int Ext>
Age: 3 Metric: 100 ( R1 <--> R5 경로상의 cost 값 무시하고 설정한 cost 값 100 출력됨.)
Validation State: unverified
Tag: 0
Task: OSPF
Announcement bits (1): 0-KRT
AS path: I