Related Documentation
- J, M, MX, PTX, SRX, T Series
- Example: Creating an Interface on a Logical System
- M, MX, PTX, T Series
- Example: Configuring a Conditional OSPF Default Route Policy on Logical Systems
Example: Configuring an OSPF Default Route Policy on Logical Systems
This example shows how to configure a default route on one logical system and inject the default route into OSPF area 0. In this example, OSPF area 0 contains three logical systems that are configured on a single physical router.
Requirements
Before you begin:
- Connect the logical systems by using logical tunnel (lt) interfaces. See Example: Connecting Logical Systems Within the Same Router Using Logical Tunnel Interfaces.
- Enable OSPF on the interfaces. See Example: Configuring OSPF on Logical Systems Within the Same Router.
Overview
This example shows a logical system redistributing a default route to other logical systems. All logical systems are running OSPF. A common reason for a default route is to provide a path for sending traffic destined outside the OSPF domain.
In this example, the default route is not used for forwarding traffic. The no-install statement prevents the route from being installed in the forwarding table of Logical System LS3. If you configure a route so it is not installed in the forwarding table, the route is still eligible to be exported from the routing table to other protocols. The discard statement silently drops packets without notice.
Figure 1 shows the sample network.
Figure 1: OSPF with a Default Route to an ISP

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 information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To configure an OSPF default route policy on logical systems:
Change the context to Logical System LS3.
[edit]user@host> set cli logical-system LS3Configure the default route on Logical System LS3.
[edit]user@host:LS3# set routing-options static route 0.0.0.0/0 discard user@host:LS3# set routing-options static route 0.0.0.0/0 no-installConfigure the policy on Logical System LS3.
[edit]user@host:LS3# set policy-options policy-statement ospf-default from protocol static user@host:LS3# set policy-options policy-statement ospf-default from route-filter 0.0.0.0/0 exact user@host:LS3# set policy-options policy-statement ospf-default then acceptApply the export policy to OSPF on Logical System LS3.
[edit]user@host:LS3# set protocols ospf export ospf-defaultIf you are done configuring the device, commit the configuration.
[edit]user@host:LS3# commit
Results
Confirm your configuration by issuing the show logical-systems LS3 command.
Verification
Confirm that the configuration is working properly.
Verifying That the Static Route Is Redistributed
Purpose
Make sure that the OSPF policy is working by checking the routing tables.
Action
user@host> show route logical-system LS3
inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[Static/5] 01:04:38 Discard 10.0.0.0/30 *[OSPF/10] 11:53:55, metric 2 to 10.0.2.2 via lt-1/2/0.3 > to 10.0.1.2 via lt-1/2/0.5 10.0.1.0/30 *[Direct/0] 11:54:50 > via lt-1/2/0.5 10.0.1.1/32 *[Local/0] 11:54:54 Local via lt-1/2/0.5 10.0.2.0/30 *[Direct/0] 11:54:50 > via lt-1/2/0.3 10.0.2.1/32 *[Local/0] 11:54:54 Local via lt-1/2/0.3 224.0.0.5/32 *[OSPF/10] 11:56:55, metric 1 MultiRecv
user@host> show route logical-system LS1
inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[OSPF/150] 01:02:34, metric 0, tag 0 > to 10.0.1.1 via lt-1/2/0.0 10.0.0.0/30 *[Direct/0] 11:52:46 > via lt-1/2/0.2 10.0.0.1/32 *[Local/0] 11:52:50 Local via lt-1/2/0.2 10.0.1.0/30 *[Direct/0] 11:52:46 > via lt-1/2/0.0 10.0.1.2/32 *[Local/0] 11:52:50 Local via lt-1/2/0.0 10.0.2.0/30 *[OSPF/10] 11:51:56, metric 2 > to 10.0.1.1 via lt-1/2/0.0 to 10.0.0.2 via lt-1/2/0.2 224.0.0.5/32 *[OSPF/10] 11:54:50, metric 1 MultiRecv
user@host> show route logical-system LS2
inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[OSPF/150] 01:05:20, metric 0, tag 0 > to 10.0.2.1 via lt-1/2/0.4 10.0.0.0/30 *[Direct/0] 11:55:32 > via lt-1/2/0.1 10.0.0.2/32 *[Local/0] 11:55:36 Local via lt-1/2/0.1 10.0.1.0/30 *[OSPF/10] 11:54:37, metric 2 > to 10.0.0.1 via lt-1/2/0.1 to 10.0.2.1 via lt-1/2/0.4 10.0.2.0/30 *[Direct/0] 11:55:32 > via lt-1/2/0.4 10.0.2.2/32 *[Local/0] 11:55:36 Local via lt-1/2/0.4 224.0.0.5/32 *[OSPF/10] 11:57:36, metric 1 MultiRecv
Meaning
The routing table on Logical System LS3 contains the default 0.0.0.0/0 route from protocol Static. The routing tables on Logical System LS1 and Logical System LS2 contain the default 0.0.0.0/0 route from protocol OSPF. If Logical System LS1 and Logical System LS2 receive packets destined for networks not specified in their routing tables, those packets will be sent to Logical System LS3 for further processing. This configuration assumes that Logical System LS3 has a connection to an ISP or another external network.
Related Documentation
- J, M, MX, PTX, SRX, T Series
- Example: Creating an Interface on a Logical System
- M, MX, PTX, T Series
- Example: Configuring a Conditional OSPF Default Route Policy on Logical Systems
Published: 2012-12-08
Related Documentation
- J, M, MX, PTX, SRX, T Series
- Example: Creating an Interface on a Logical System
- M, MX, PTX, T Series
- Example: Configuring a Conditional OSPF Default Route Policy on Logical Systems