OSPF Configuration(Juniper Configuration)

2025. 11. 3. 23:16·Network/OSPF

1. OSPF Basic Configuration

set routing-options router-id 192.0.2.24
  • router-id 구성

 

set protocols ospf area 0.0.0.1 interface ge-0/0/0
  • 특정 인터페이스를 OSPF 특정 Area에 할당

 

set protocols ospf area 0.0.0.1 interface ge-0/2/0 passive
  • 해당 인터페이스를 passive interface로 구성

 

set protocols ospf area 0 interface ge-0/0/0 no-interface-state-traps
  • passive interface의 state 변경에 대한 알림을 보고 싶지 않을 경우, "no-interface-state-traps"을 설정하여 OSPF trap에서 제외

 

 

2. OSPF Network Type Configuration

set protocols ospf area 0.0.0.1 interface xe-0/0/1.0 interface-type <network-type>
  • 해당 인터페이스의 network-type을 구성

 

set protocols ospf area 0.0.0.1 interface at-0/1/0.0 neighbor 192.0.2.2
  • OSPF의 neighbor로 사용할 neighbor IP address를 구성
  • NBMA 환경은 broadcast 및 multicast를 지원하지 않으므로 OSPF neighbor를 dynamic 하게 찾을 수 없으므로 모든 neighbor를 직접 지정

 

set protocols ospf area 0.0.0.1 interface at-0/1/0.0 neighbor 192.0.2.2 eligible
  • "nmba" network-type에서 DR/BDR을 선출해야 하므로 특정 neighbor가 DR이 될 수 있도록 "eligible" 옵션을 사용

 

 

3. DR / BDR Priority Configuration

set protocols ospf area 0.0.0.3 interface ge-0/0/1 priority 200
  • 해당 인터페이스의 OSPF priority를 구성

 

 

4. OSPF Preferences Configuration

set protocols ospf preference 168 external-preference 169
  • internal OSPF 및 external OSPF에 대한 preference를 지정
  • 0 ~ 4,294,967,295까지 설정 가능

 

 

5. Reference Bandwidth and Metric Configuration

set protocols ospf reference-bandwidth 10g
  • reference bandwidth를 구성

 

set protocols ospf area 0.0.0.0 interface fe-1/0/1 metric 5
  • 해당 인터페이스의 OSPF metric을 구성

 

set protocols ospf area 0 interface ae0.0 bandwidth-based-metrics bandwidth 1g metric 60
  • bandwidth에 따라 OSPF interface metric을 dynamic으로 조정
  • bandwidth가 1GE일 때, OSPF는 해당 인터페이스에 대해 metric을 60으로 고려

 

 

6. Stub Area Configuration

set protocols ospf area 0.0.0.1 stub
  • 해당 area를 stub area로 구성

 

set protocols ospf area 0.0.0.1 stub default-metric 10
  • ABR이 지정한 metric을 가진 default-route를 stub area로 전달

 

set protocols ospf area 0.0.0.1 stub no-summaries
  • 해당 area를 totally stub area로 구성

 

 

7. NSSA Configuration

set protocols ospf area 0.0.0.2 nssa
  • 해당 area를 NSSA로 구성

 

set protocols ospf area 0.0.0.2 nssa default-lsa default-metric 10
  • ABR이 지정한 metric을 가진 default-route를 NSSA로 전달
  • NSSA에서는 default-route를 LSA type 7으로 전달

 

set protocols ospf area 0.0.0.2 nssa default-lsa metric-type 1
  • default-route의 external metric type을 지정

 

set protocols ospf area 0.0.0.2 nssa no-summaries
  • 해당 area를 totally NSSA로 구성
  • default-route를 LSA type 3으로 전달

 

set protocols ospf area 0.0.0.2 nssa default-lsa type-7
  • ABR에 "no-summaries"가 구성된 경우 default-route를 LSA type 3이 아닌 LSA type 7으로 flooding

 

set protocols ospf no-nssa-abr
  • ABR이면서 ASBR인 환경에서 ASBR이 여러 NSSA에 연결된 경우, 동일한 network가 LSA type 5 및 LSA type 7으로 두 번 재분배되는 것을 방지하기 위해 해당 옵션을 사용하여  LSA type 7 정보를 NSSA로 export하는 것을 비활성화

 

 

8. Route Summary Configuration

set protocols ospf area 0.0.0.3 area-range 10.0.0.0/16
  • "non-backbone area → backbone area"로 flooding되는 LSA type 3 route를 summary
  • ABR에서 구성

 

set protocols ospf area 0.0.0.3 nssa area-range 10.0.0.0/8
  • "NSSA → backbone area"로 flooding되는 LSA type 7 route를 summary
  • ABR에서 구성

 

 

9. OSPF Fault Detection using BFD

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 bfd-liveness-detection minimum-interval 1000
  • failure detection을 위한 최소 송수신 간격
  • "transmit-interval minimum-interval" and "minimum-receive-interval" 명령어를 사용하여 최소 전송 간격과 수신 간격을 별도로 지정 가능
  • milliseconds 단위

 

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 bfd-liveness-detection minimum-receive-interval 1000
  • failure detection을 위한 minimum receive interval
  • milliseconds 단위

 

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 bfd-liveness-detection transmit-interval minimum-interval 1000
  • failure detection을 위한 minimum transmit interval
  • milliseconds 단위

 

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 bfd-liveness-detection multiplier 5
  • BFD session down으로 선언되는 누락된 BFD 패킷 수를 구성
  • "minimum receive interval x multiplier" 동안 bfd를 수신하지 못할 경우 BFD session down으로 선언
  • 기본적으로 multiplier는 3개로 구성

 

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 bfd-liveness-detection full-neighbors-only
  • adjacency neighbor를 맺은 OSPF neighbor에 대해서면 BFD session을 설정
  • 기본 동작은 모든 OSPF neighbor에 대해 BFD session을 설정

 

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 bfd-liveness-detection no-adaptation
  • BFD session이 변화하는 네트워크 조건에 adaptation하는 것을 비활성화

 

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 bfd-liveness-detection detection-time threshold 1000
  • detection time의 adaptation threshold 
  • BFD session detection time이 설정된 threshold 값 이상이 되면 single trap과 single system log message가 전송

 

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 bfd-liveness-detection transmit-interval threshold 1000
  • BFD session transmit interval의 adaptation threshold 
  • transmit interval이 threshold보다 큰 값에 적응하면 single trap 및 single system log message가 전송
  • threshold은 minimum transmit interval보다 큰 값으로 구성 필요

 

set protocols ospf area 0.0.0.0 interface ge-0/0/1.0 bfd-liveness-detection version 1
  • BFD version을 구성
  • 기본적으로 BFD version을 자동으로 감지

 

 

10. OSPF Timer Configuration

set protocols ospf area 0.0.0.0 interface fe-0/0/1 hello-interval 2
  • "hello-interval"을 구성
  • 1s ~ 255s 내에서 설정

 

set protocols ospf area 0.0.0.0 interface fe-0/0/1 dead-interval 8
  • "dead-interval"을 구성
  • 1s ~ 65,535s 내에서 설정

 

set protocols ospf area 0.0.0.1 interface fe-0/0/1 retransmit-interval 8
  • LSA "retransmit-interval"을 구성

 

set protocols ospf area 0.0.0.1 interface fe-1/0/1 transit-delay 2
  • "transit-delay"를 구성

 

set protocols ospf area 0.0.0.1 interface at-0/1/0.0 poll-interval 130
  • "poll interval"을 설정

 

 

11. LSAs Refresh Timer Configuration

set protocols ospf area 0.0.0.0 interface so-0/0/1.0 flood-reduction
  • LSA는 처음 flooding될 때 "DoNotAge" bit가 설정되며, LSA는 변경이 발생할 때만 refresh

 

set protocols ospf lsa-refresh-interval 50
  • RFC 표준은 30min으로 되어있지만 funiper는 기본적으로 50min마다 LSA를 fefresh
  • 25min ~ 50min 내에서 설정

 

 

12. SPF Algorithm Option Timer Configuration

set protocols ospf spf-options delay 210
  • LSDB가 변경되고 SPF 알고리즘이 실행되는 시점의 간격을 구성
  • "milliseconds" 단위이며 기본적으로 200ms로 구성
  • 50ms ~ 8000ms 내에서 설정

 

set protocols ospf spf-options rapid-runs 4
  • "holddown" timer가 시작되기 전에 SPF 알고리즘을 연속적으로 실행할 수 있는 최대 횟수
  • 기본적으로 연속으로 발생할 수 있는 SPF 계산 수는 3
  • 1 ~ 10 내에서 설정

 

set protocols ospf spf-options holddown 5050
  • SPF 알고리즘이 구성된 최대 횟수만큼 연속적으로 실행된 후 다른 SPF 계산을 실행하기 전에 대기할 시간
  • "milliseconds" 단위이며 기본적으로 5000ms 동안 보류
  • 2,000ms ~ 20,000ms  내에서 설정

 

 

13. OSPF Routes Limit Configuration

set protocols ospf prefix-export-limit 100000
  • 기본적으로 OSPF는 export 할 수 있는 route count에 제한이 없지만 OSPF에서 export route의 수를 제한하여 장비의 부화를 최소화

 

 

14. Virtual-Link Configuration

set protocols ospf area 0.0.0.0 virtual-link neighbor-id [remote R-ID] transit-area 0.0.0.2
  • transit area를 "0.0.0.2"인 virtual link를 구성

 

 

15. OSPF Routing Policy Configuration

1) Redistributing Static Routes into OSPF

set policy-options policy-statement EXPORT term EXPORT_10 from protocol static
  • "EXPORT"라는 policy-statement를 생성
  • "EXPORT_10"이라는 term을 생성하고 "static" protocol을 match 조건으로 지정

 

set policy-options policy-statement EXPORT term EXPORT_10 then accept
  • match 조건이 일치하는 경우 경로를 수락하도록 지정

 

set protocols ospf export EXPORT
  • OSPF에 routing policy를 적용

 

2) Configuring an OSPF Import Policy

set protocols ospf import filter_routes
set policy-options policy-statement filter_routes from route-filter 10.0.16.0/30 exact
set policy-options policy-statement filter_routes then reject

 

 

16. Import and Export Policies for Network Summaries Configuration

1) Configuring an OSPF Export Policy for Network Summaries

set policy-options policy-statement export-policy term term1 from route-filter 10.0.4.4/30 prefix-length-range /30-/30
set policy-options policy-statement export-policy term term1 then accept
set protocols ospf area 0.0.0.4 network-summary-export export-policy
  • ABR이 OSPF area로 flooding 하는 LSA type 3을 제어하기 위해 OSPF export policy를 생성
  • 먼저 policy를 정의한 다음 "inter-area-prefix-export" 또는 "network-summary-export"를 사용하여 ABR에 적용
  • "show ospf database netsummary area 0.0.0.4"로 확인하여 지정되지 않은 경로는 사용 기간이 만료되거나 OSPF database에 더 이상 존재 불가

 

2) Configuring an OSPF Import Policy for Network Summaries

set policy-options policy-statement import-policy term term1 from route-filter 10.0.4.12/30 prefix-length-range /30-/30 
set policy-options policy-statement import-policy term term1 then accept
set protocols ospf area 0.0.0.3 network-summary-import import-policy
  • ABR이 area에서 보급하는 LSA type 3을 제어하기 위해 OSPF import policy를 생성
  • 먼저 policy를 정의한 다음 "inter-area-prefix-import" 또는 "network-summary-import"를 사용하여 ABR에 적용
  • "show ospf database netsummary area 0.0.0.4"로 확인하여 다른 route는 다른 area로 광고되지 않아야 하므로 이러한 항목은 만료되거나 OSPF database에 더 이상 존재 불가

 

 

17. show command

show ospf overview
  • 소속된 area가 stub area인지, NSSA인지 확인 가능
  • SPF algorithm option timer 확인 가능

 

show ospf overview extensive
  • traceoption filed에 구성된 trace 작업 확인 가능
  • traceoption filed에 파일이 저장된 위치, trace 작업의 출력을 수신할 filename 및 file size가 표시

 

show ospf interface
show ospf interface detail
  • OSPF가 실행 중인 인터페이스, 인터페이스별 소속된 area, 인터페이스별 network type, DR/BDR 확인
  • passive 인터페이스일 경우, "Adj count" field는 0으로 표출되며 해당 field 옆에 "passive"라는 단어도 표출
  • 인터페이스별 metric 확인 가능
  • virtual link로 구성한 경우, type field에 Interface type이 표출되며 virtual link로 표출
  • 인터페이스에 설정한 timer 확인 가능

 

show ospf neighbor
  • OSPF neighbor list, address, interface, state, router-id, priority, dead interval 정보 확인
  • DR/BDR 확인 가능

 

show ospf route
  • OSPF RIB 테이블 확인

 

show ospf database
  • LSDB의 확인

 

 

18. traceoption Configuration

  • 일부 traceoptions flag는 방대한 양의 정보를 생성하여 trace로 인하여 라우팅 프로토콜의 작동 속도가 느려질 수 있으므로 traceoptions 구성이 더 이상 필요하지 않은 경우 삭제할 것을 권고
set protocol protocol-name traceoptions file [filename]
  • traceoption 파일 이름 지정

 

set protocol protocol-name traceoptions size [size]
  • 각 trace file의 최대 크기를 지정하며 파일이 최대 크기에 도달하면 확장자가 .0으로 바뀌고 파일이 다시 최대 크기에 도달하면 확장자가 .1으로 바뀌고 새로 만든 파일의 이름이 .0 확장명으로 변경하고 최대 trace file 수에 도달하면 가장 오래된 trace file을 override
  • KB의 경우 k , MB의 경우 m , GB의 경우 g 를 지정
  • 기본적으로 trace file size는 128KB

 

set protocol protocol-name traceoptions files [number]
  • 최대 trace file 수를 지정
  • 기본적으로 최대 trace file 수는 10개

 

set protocol protocol-name traceoptions flag [flag]
  • 특정 라우팅 프로토콜에 대한 라우팅 프로토콜 trace 구성
  • "show log [filename]" 명령어로 message가 들어있는 파일의 내용을 확인
  • "monitor start [filename]" 명령어로 실시간으로 작성된 trace file message를 모니터링
  • "monitor stop [filename]" 명령어로 trace file message 모니터링을 중지
  • trace files은 /var/log directory에 저장

 

OSPF tracing flags description
database-description database description packets, which are used in synchronizing the OSPF and OSPFv3 topological database.
error OSPF and OSPFv3 error packets.
event OSPF and OSPFv3 state transitions.
flooding link-state flooding packets.
graceful-restart graceful-restart events.
hello hello packets, which are used to establish neighbor adjacencies and to determine whether neighbors are reachable.
ldp-synchronization synchronization events between OSPF and LDP.
lsa-ack link-state acknowledgment packets, which are used in synchronizing the OSPF topological database.
lsa-analysis link-state analysis. Specific to the Juniper Networks implementation of OSPF, Junos OS performs LSA analysis before running the shortest-path-first (SPF) algorithm. LSA analysis helps to speed the calculations performed by the SPF algorithm.
lsa-request link-state request packets, which are used in synchronizing the OSPF topological database.
lsa-update link-state updates packets, which are used in synchronizing the OSPF topological database.
nsr-synchronization nonstop routing synchronization events.
on-demand trace demand circuit extensions.
packet-dump content of selected packet types.
packets all OSPF packets.
restart-signaling (OSPFv2 only) Restart-signaling graceful restart events.
spf shortest-path-first (SPF) calculations.

 

global tracing flags description
all all tracing operations.
general a combination of the normal and route trace operations.
normal all normal operations. If you do not specify this option, only unusual or abnormal operations are traced.
policy policy operations and actions.
route routing table changes.
state state transitions.
task routing protocol task processing.
timer routing protocol timer processing.

 

 

19. OSPF Logical System Logical Tunnel Configuration

set chassis fpc 0 pic 0 tunnel-services
set chassis fpc 0 lite-mode
set logical-systems LS1 interfaces lt-0/0/0 unit 1
set logical-systems LS2 interfaces lt-0/0/0 unit 0
set interfaces lt-0/0/0 unit 1 encapsulation ethernet
set interfaces lt-0/0/0 unit 1 peer-unit 1
set interfaces lt-0/0/0 unit 1 family inet address 1.1.2.1/24
set interfaces lt-0/0/0 unit 0 encapsulation ethernet
set interfaces lt-0/0/0 unit 0 peer-unit 0
set interfaces lt-0/0/0 unit 0 family inet address 1.1.2.2/24
set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-0/0/0.1 interface-type p2p
set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-0/0/0.0 interface-type p2p
  • Junos 15.1 이상에서 기본적으로 performance-mode가 활성화
  • performance-mode를 활성화하려면 VM에 적합한 vCPU 및 memory를 구성해야 동작 가능
  • 실장비로 설정할 할 경우, "set chassis fpc 0 lite-mode" 설정 불필요

 

root@vMX1> show interfaces terse | match lt 
lt-0/0/0                up    up
lt-0/0/0.0              up    up   inet     1.1.2.2/24      
lt-0/0/0.1              up    up   inet     1.1.2.1/24      
lt-0/0/0.32767          up    up
  • 위에서 설정한 logical ternal이 정상적으로 구성

 

root@vMX1> ping logical-system LS1 1.1.2.2 count 2 
PING 1.1.2.2 (1.1.2.2): 56 data bytes
64 bytes from 1.1.2.2: icmp_seq=0 ttl=64 time=1.612 ms
64 bytes from 1.1.2.2: icmp_seq=1 ttl=64 time=1.067 ms

--- 1.1.2.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.067/1.340/1.612/0.272 ms
  • ping test를 진행할 때, "logical-system"을 추가하여 원하는 logical system에서 ping test 가능

 

root@vMX1> show route logical-system LS1 

inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.2.0/24         *[Direct/0] 00:11:54
                    >  via lt-0/0/0.1
1.1.2.1/32         *[Local/0] 00:11:54
                       Local via lt-0/0/0.1
224.0.0.5/32       *[OSPF/10] 00:05:55, metric 1
                       MultiRecv
root@vMX1> show ospf neighbor logical-system LS1 
Address          Interface              State           ID               Pri  Dead
1.1.2.2          lt-0/0/0.1             Full            1.1.2.2          128    37

 

저작자표시 비영리 변경금지 (새창열림)

'Network > OSPF' 카테고리의 다른 글

OSPF Routing Policy  (0) 2025.11.01
OSPF Fault Detection using BFD Configuration(Juniper vMX)  (0) 2025.10.30
OSPF Virtual Link Configuration(Juniper vMX)  (0) 2025.10.28
OSPF Route Summary Configuration(Juniper vMX)  (0) 2025.10.26
LSA Flooding Type in OSPF Domain  (0) 2025.10.24
Number of Flooding by LSA Type in OSPF domain  (0) 2025.10.22
OSPF NSSA Configuration(Juniper vMX)  (0) 2025.10.20
OSPF Stub Configuration(Juniper vMX)  (0) 2025.10.18
'Network/OSPF' 카테고리의 다른 글
  • OSPF Routing Policy
  • OSPF Fault Detection using BFD Configuration(Juniper vMX)
  • OSPF Virtual Link Configuration(Juniper vMX)
  • OSPF Route Summary Configuration(Juniper vMX)
ant-choi의 네트워크
ant-choi의 네트워크
안녕하세요. 네트워크 엔지니어로 근무하고 있는 직장인 입니다. 2024.08.26부터 새로운 버전으로 블로그를 개설하였습니다. 제가 스터디한 내용이나 회사에서 업무 진행 시, 필요한 내용들을 정리하여 업로드 하는 것을 목표로 하고 있습니다. 오류가 있거나 피드백이 있으신 분들은 댓글 남겨주시면 감사하겟습니다.
  • ant-choi의 네트워크
    ant-choi의 네트워크
    ant-choi의 네트워크
  • 전체
    오늘
    어제
    • 분류 전체보기 (219) N
      • Network (195) N
        • Juniper Software (1) N
        • Juniper Basic (8)
        • Emulator (24)
        • Network Basic (11)
        • ARP, ICMP (17)
        • VLAN (22)
        • STP (16)
        • VRRP (11)
        • Link Aggregation (10)
        • MC-LAG (20)
        • Switching, Routing Basic (18) N
        • DHCP (15)
        • OSPF (22)
        • BGP (0)
        • Routing Instance (0)
        • VXLAN (0)
        • EVPN-VXLAN (0)
        • Issue (0)
      • Office (5)
        • Office 공통 (1)
        • Excel (1)
        • Power Point (1)
        • Word (2)
        • Outlook (0)
      • 기타 (19)
        • Windows (1)
        • Browser (5)
        • Tistory (11)
        • Notion (1)
        • Application (1)
  • 블로그 메뉴

    • hELLO· Designed By정상우.v4.10.3
    ant-choi의 네트워크
    OSPF Configuration(Juniper Configuration)
    상단으로

    티스토리툴바