Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All
     

    Related Documentation

     

    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:

    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.

    set policy-options policy-statement ospf-redist-direct from protocol direct set policy-options policy-statement ospf-redist-direct then accept set policy-options policy-statement ospf-redist-static from protocol static set policy-options policy-statement ospf-redist-static then accept set policy-options policy-statement ospf-to-ospf from protocol ospf set policy-options policy-statement ospf-to-ospf then acceptset routing-instances pd-vr1 protocols ospf export ospf-redist-direct set routing-instances pd-vr1 protocols ospf export ospf-redist-static set routing-instances pd-vr1 protocols ospf export ospf-to-ospf set routing-instances pd-vr1 protocols ospf area 0.0.0.1 interface ge-0/0/5.1 set routing-instances pd-vr1 protocols ospf area 0.0.0.1 interface lt-0/0/0.3

    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 PDF Document.

    To configure OSPF for the user logical system:

    1. 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#
    2. 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
    3. 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
    4. 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 (...).

    [edit]lsdesignadmin1@host:ls-product-design# show policy-optionspolicy-statement ospf-redist-direct {from protocol direct;then accept;}policy-statement ospf-redist-static {from protocol static;then accept;}policy-statement ospf-to-ospf {from protocol ospf;then accept;}[edit]lsdesignadmin1@host:ls-product-design# show routing-instancespd-vr1 {...protocols {ospf {export [ ospf-redist-direct ospf-to-ospf ospf-redist-static ];area 0.0.0.1 {interface lt-0/0/0.3;interface ge-0/0/5.1;}}}}

    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-vr1
    Interface           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-vr1
    Address 	 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-vr1
    Topology 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

     

    Published: 2012-06-29