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 a User 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 the Master Logical System
This example shows how to configure OSPF for the master logical system.
Requirements
Before you begin:
- Log in to the master logical system as the master administrator. See Example: Configuring a Root Password for the Device.
- Configure logical interfaces ge-0/0/4.0 and lt-0/0/0.1 for the master logical system and assign them to the vr1-root routing instance. See Example: Configuring Interfaces, Routing Instances, and Static Routes for the Master and Interconnect Logical Systems and Logical Tunnel Interfaces for User Logical Systems .
Overview
In this example, you configure OSPF for the master logical system, called root-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/4.0 and lt-0/0/0.1 interfaces in the master logical system. You configure the following routing policies to export routes from the Junos OS routing table into OSPF in the vr1-root 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 master logical system:
- Log in to the master logical system as the master administrator
and enter configuration mode.admin@host> configureadmin@host#
- Create routing policies that accept routes.[edit policy-options]admin@host# set policy-statement ospf-redist-direct from protocol directadmin@host# set policy-statement ospf-redist-direct then acceptadmin@host# set policy-statement ospf-redist-static from protocol staticadmin@host# set policy-statement ospf-redist-static then acceptadmin@host# set policy-statement ospf-to-ospf from protocol ospfadmin@host# 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]admin@host# set vr1-root protocols ospf export ospf-redist-directadmin@host# set vr1-root protocols ospf export ospf-redist-staticadmin@host# set vr1-root protocols ospf export ospf-to-ospf
- Enable OSPF on the logical interfaces.[edit routing-instances]admin@host# set vr1-root protocols ospf area 0.0.0.1 interface ge-0/0/4.0admin@host# set vr1-root protocols ospf area 0.0.0.1 interface lt-0/0/0.1
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 vr1-root command.
admin@host> show ospf interface instance vr1-rootInterface State Area DR ID BDR ID Nbrs lt-0/0/0.1 DR 0.0.0.0 10.0.1.1 0.0.0.0 0 ge-0/0/4.0 DR 0.0.0.1 10.0.1.1 0.0.0.0 0
Verifying OSPF Neighbors
Purpose
Verify OSPF neighbors.
Action
From the CLI, enter the show ospf neighbor instance vr1-root command.
admin@host> show ospf neighbor instance vr1-rootAddress Interface State ID Pri Dead 10.0.1.2 plt0.3 Full 0.0.0.0 128 39
Verifying OSPF Routes
Purpose
Verify OSPF routes.
Action
From the CLI, enter the show ospf route instance vr1-root command.
admin@host> show ospf route instance vr1-rootTopology 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.1
12.12.1.0/24 Intra Network IP 1 ge-0/0/4.0 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 a User 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


