Related Documentation
- J Series
- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- M Series
- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- MX Series
- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- SRX Series
- Understanding Logical System Interfaces and Routing Instances
- Example: Configuring OSPF Routing Protocol for the Master Logical System
- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- T Series
- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Additional Information
- Junos OS Feature Support Reference for SRX Series and J Series Devices

- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

Example: Configuring OSPF Routing Protocol for a User Logical System
This example shows how to configure OSPF for a user logical system.
Requirements
Before you begin:
- Log in to the user logical system as the user logical system administrator. See User Logical System Configuration Overview.
- Configure logical interface ge-0/0/5.1. Assign ge-0/0/5.1 and lt-0/0/0.3 to the pd-vr1 routing instance. See Example: Configuring Interfaces and Routing Instances for a User Logical System.
Overview
In this example, you configure OSPF for the ls-product-design user logical system, shown in Example: Creating User Logical Systems, Their Administrators, Their Users, and an Interconnect Logical System.
This example enables OSPF routing on the ge-0/0/5.1 and lt-0/0/0.3 interfaces in the ls-product-design user logical system. You configure the following routing policies to export routes from the Junos OS routing table into OSPF in the pd-vr1 routing instance:
- ospf-redist-direct—Routes learned from directly connected interfaces.
- ospf-redist-static—Static routes.
- ospf-to-ospf—Routes learned from OSPF.
Configuration
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.
Step-by-Step Procedure
The following example requires you to navigate various
levels in the configuration hierarchy. For instructions on how to
do that, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide
.
To configure OSPF for the user logical system:
- Log in to the user logical system as the user logical
system administrator and enter configuration mode.lsdesignadmin1@host:ls-product-design> configurelsdesignadmin1@host:ls-product-design#
- Create routing policies that accept routes.[edit policy-options]lsdesignadmin1@host:ls-product-design# set policy-statement ospf-redist-direct from protocol directlsdesignadmin1@host:ls-product-design# set policy-statement ospf-redist-direct then acceptlsdesignadmin1@host:ls-product-design# set policy-statement ospf-redist-static from protocol staticlsdesignadmin1@host:ls-product-design# set policy-statement ospf-redist-static then acceptlsdesignadmin1@host:ls-product-design# set policy-statement ospf-to-ospf from protocol ospflsdesignadmin1@host:ls-product-design# set policy-statement ospf-to-ospf then accept
- Apply the routing policies to routes exported from the
Junos OS routing table into OSPF.[edit routing-instances]lsdesignadmin1@host:ls-product-design# set pd-vr1 protocols ospf export ospf-redist-directlsdesignadmin1@host:ls-product-design# set pd-vr1 protocols ospf export ospf-redist-staticlsdesignadmin1@host:ls-product-design# set pd-vr1 protocols ospf export ospf-to-ospf
- Enable OSPF on the logical interfaces.[edit routing-instances]lsdesignadmin1@host:ls-product-design# set pd-vr1 protocols ospf area 0.0.0.1 interface ge-0/0/5.1lsdesignadmin1@host:ls-product-design# set pd-vr1 protocols ospf area 0.0.0.1 interface lt-0/0/0.3
Results
From configuration mode, confirm your configuration by entering the show policy-options and show routing-instances commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.
For brevity, this show command output includes only the configuration that is relevant to this example. Any other configuration on the system has been replaced with ellipses (...).
If you are done configuring the device, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Verifying OSPF Interfaces
Purpose
Verify OSPF-enabled interfaces.
Action
From the CLI, enter the show ospf interface instance pd-vr1 command.
lsdesignadmin1@host:ls-product-design> show
ospf interface instance pd-vr1Interface State Area DR ID BDR ID Nbrs lt-0/0/0.3 DR 0.0.0.0 10.0.1.2 0.0.0.0 0 ge-0/0/5.1 DR 0.0.0.1 10.0.1.2 0.0.0.0 0
Verifying OSPF Neighbors
Purpose
Verify OSPF neighbors.
Action
From the CLI, enter the show ospf neighbor instance pd-vr1 command.
lsdesignadmin1@host:ls-product-design> show
ospf neighbor instance pd-vr1Address Interface State ID Pri Dead 10.0.1.1 plt0.1 Full 0.0.0.0 128 39
Verifying OSPF Routes
Purpose
Verify OSPF routes.
Action
From the CLI, enter the show ospf route instance pd-vr1 command.
lsdesignadmin1@host:ls-product-design> show
ospf route instance pd-vr1Topology default Route Table: Prefix Path Route NH Metric NextHop Nexthop Type Type Type Interface Address/LSP 10.0.1.0/24 Intra Network IP 1 lt-0/0/0.3 12.12.1.0/24 Intra Network IP 1 ge-0/0/5.1
Related Documentation
- J Series
- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- M Series
- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- MX Series
- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- SRX Series
- Understanding Logical System Interfaces and Routing Instances
- Example: Configuring OSPF Routing Protocol for the Master Logical System
- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- T Series
- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Additional Information
- Junos OS Feature Support Reference for SRX Series and J Series Devices

- OSPF Configuration Overview in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices

- Verifying an OSPF Configuration in the Junos OS Routing Protocols and Policies Configuration Guide for Security Devices


