OSPF on Logical Systems
Logical Systems enable you to configure an OSPF network, running on a single physical router. For more information, see the following topics:
Example: Configuring OSPF on Logical Systems Within the Same Router
This example shows how to configure an OSPF network using multiple logical systems that are running on a single physical router. The logical systems are connected by logical tunnel interfaces.
Requirements
You must connect the logical systems by using logical tunnel (lt) interfaces. See Example: Connecting Logical Systems Within the Same Device Using Logical Tunnel Interfaces on MX Series Routers and EX Series Switches.
Overview
This example shows the configuration of a single OSPF area with three logical systems running on one physical router. Each logical system has its own routing table. The configuration enables the protocol on all logical system interfaces that participate in the OSPF domain and specifies the area that the interfaces are in.
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,
copy and paste the commands into the CLI at the [edit] hierarchy level,
and then enter commit
from configuration mode.
set logical-systems LS1 interfaces lt-1/2/0 unit 0 description LS1->LS3 set logical-systems LS1 interfaces lt-1/2/0 unit 0 encapsulation ethernet set logical-systems LS1 interfaces lt-1/2/0 unit 0 peer-unit 5 set logical-systems LS1 interfaces lt-1/2/0 unit 0 family inet address 10.0.1.2/30 set logical-systems LS1 interfaces lt-1/2/0 unit 2 description LS1->LS2 set logical-systems LS1 interfaces lt-1/2/0 unit 2 encapsulation ethernet set logical-systems LS1 interfaces lt-1/2/0 unit 2 peer-unit 1 set logical-systems LS1 interfaces lt-1/2/0 unit 2 family inet address 10.0.0.1/30 set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.0 set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.2 set logical-systems LS2 interfaces lt-1/2/0 unit 1 description LS2->LS1 set logical-systems LS2 interfaces lt-1/2/0 unit 1 encapsulation ethernet set logical-systems LS2 interfaces lt-1/2/0 unit 1 peer-unit 2 set logical-systems LS2 interfaces lt-1/2/0 unit 1 family inet address 10.0.0.2/30 set logical-systems LS2 interfaces lt-1/2/0 unit 4 description LS2->LS3 set logical-systems LS2 interfaces lt-1/2/0 unit 4 encapsulation ethernet set logical-systems LS2 interfaces lt-1/2/0 unit 4 peer-unit 3 set logical-systems LS2 interfaces lt-1/2/0 unit 4 family inet address 10.0.2.2/30 set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.1 set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.4 set logical-systems LS3 interfaces lt-1/2/0 unit 3 description LS3->LS2 set logical-systems LS3 interfaces lt-1/2/0 unit 3 encapsulation ethernet set logical-systems LS3 interfaces lt-1/2/0 unit 3 peer-unit 4 set logical-systems LS3 interfaces lt-1/2/0 unit 3 family inet address 10.0.2.1/30 set logical-systems LS3 interfaces lt-1/2/0 unit 5 description LS3->LS1 set logical-systems LS3 interfaces lt-1/2/0 unit 5 encapsulation ethernet set logical-systems LS3 interfaces lt-1/2/0 unit 5 peer-unit 0 set logical-systems LS3 interfaces lt-1/2/0 unit 5 family inet address 10.0.1.1/30 set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.5 set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.3
Procedure
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 OSPF on logical systems:
Configure the logical tunnel interface on Logical System LS1 connecting to Logical System LS2.
[edit] user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 2 description LS1->LS2 user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 2 encapsulation ethernet user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 2 peer-unit 1 user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 2 family inet address 10.0.0.1/30
Configure the logical tunnel interface on Logical System LS1 connecting to Logical System LS3.
[edit] user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 description LS1->LS3 user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 encapsulation ethernet user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 peer-unit 5 user@host# set logical-systems LS1 interfaces lt-1/2/0 unit 0 family inet address 10.0.1.2/30
Configure the logical tunnel interface on Logical System LS2 connecting to Logical System LS1.
[edit] user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 description LS2->LS1 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 encapsulation ethernet user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 peer-unit 2 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 1 family inet address 10.0.0.2/30
Configure the logical tunnel interface on Logical System LS2 connecting to Logical System LS3.
[edit] user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 4 description LS2->LS3 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 4 encapsulation ethernet user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 4 peer-unit 3 user@host# set logical-systems LS2 interfaces lt-1/2/0 unit 4 family inet address 10.0.2.2/30
Configure the logical tunnel interface on Logical System LS3 connecting to Logical System LS2.
[edit] user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 3 description LS3->LS2 user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 3 encapsulation ethernet user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 3 peer-unit 4 user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 3 family inet address 10.0.2.1/30
Configure the logical tunnel interface on Logical System LS3 connecting to Logical System LS1.
[edit] user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 5 description LS3->LS1 user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 5 encapsulation ethernet user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 5 peer-unit 0 user@host# set logical-systems LS3 interfaces lt-1/2/0 unit 5 family inet address 10.0.1.1/30
Configure OSPF on all the interfaces.
[edit] user@host# set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.0 user@host# set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.2 user@host# set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.1 user@host# set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.4 user@host# set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.5 user@host# set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.3
If you are done configuring the device, commit the configuration.
[edit] user@host# commit
Results
Confirm your configuration by issuing the show
logical-systems
command.
show logical-systems LS1 { interfaces { lt-1/2/0 { unit 0 { description LS1->LS3; encapsulation ethernet; peer-unit 5; family inet { address 10.0.1.2/30; } } unit 2 { description LS1->LS2; encapsulation ethernet; peer-unit 1; family inet { address 10.0.0.1/30; } } } } protocols { ospf { area 0.0.0.0 { interface lt-1/2/0.0; interface lt-1/2/0.2; } } } } LS2 { interfaces { lt-1/2/0 { unit 1 { description LS2->LS1; encapsulation ethernet; peer-unit 2; family inet { address 10.0.0.2/30; } } unit 4 { description LS2->LS3; encapsulation ethernet; peer-unit 3; family inet { address 10.0.2.2/30; } } } } protocols { ospf { area 0.0.0.0 { interface lt-1/2/0.1; interface lt-1/2/0.4; } } } } LS3 { interfaces { lt-1/2/0 { unit 3 { description LS3->LS2; encapsulation ethernet; peer-unit 4; family inet { address 10.0.2.1/30; } } unit 5 { description LS3->LS1; encapsulation ethernet; peer-unit 0; family inet { address 10.0.1.1/30; } } } } protocols { ospf { area 0.0.0.0 { interface lt-1/2/0.5; interface lt-1/2/0.3; } } } }
Verification
Confirm that the configuration is working properly.
Verifying That the Logical Systems Are Up
Purpose
Make sure that the interfaces are properly configured.
Action
user@host> show interfaces terse Interface Admin Link Proto Local Remote ... lt-1/2/0 up up lt-1/2/0.0 up up inet 10.0.1.2/30 lt-1/2/0.1 up up inet 10.0.0.2/30 lt-1/2/0.2 up up inet 10.0.0.1/30 lt-1/2/0.3 up up inet 10.0.2.1/30 lt-1/2/0.4 up up inet 10.0.2.2/30 lt-1/2/0.5 up up inet 10.0.1.1/30 ...
Verifying Connectivity Between the Logical Systems
Purpose
Make sure that the OSPF adjacencies are established by checking the OSPF neighbor tables, checking the routing tables, and pinging the logical systems.
Action
user@host> show ospf neighbor logical-system LS1 Address Interface State ID Pri Dead 10.0.1.1 lt-1/2/0.0 Full 10.0.1.1 128 37 10.0.0.2 lt-1/2/0.2 Full 10.0.0.2 128 33
user@host> show ospf neighbor logical-system LS2 Address Interface State ID Pri Dead 10.0.0.1 lt-1/2/0.1 Full 10.0.0.1 128 32 10.0.2.1 lt-1/2/0.4 Full 10.0.1.1 128 36
user@host> show ospf neighbor logical-system LS3 Address Interface State ID Pri Dead 10.0.2.2 lt-1/2/0.3 Full 10.0.0.2 128 36 10.0.1.2 lt-1/2/0.5 Full 10.0.0.1 128 37
user@host> show route logical-system LS1 inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.0/30 *[Direct/0] 00:28:00 > via lt-1/2/0.2 10.0.0.1/32 *[Local/0] 00:28:00 Local via lt-1/2/0.2 10.0.1.0/30 *[Direct/0] 00:28:00 > via lt-1/2/0.0 10.0.1.2/32 *[Local/0] 00:28:00 Local via lt-1/2/0.0 10.0.2.0/30 *[OSPF/10] 00:27:05, 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] 00:28:03, metric 1 MultiRecv
user@host> show route logical-system LS2 inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.0/30 *[Direct/0] 00:28:31 > via lt-1/2/0.1 10.0.0.2/32 *[Local/0] 00:28:32 Local via lt-1/2/0.1 10.0.1.0/30 *[OSPF/10] 00:27:38, 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] 00:28:32 > via lt-1/2/0.4 10.0.2.2/32 *[Local/0] 00:28:32 Local via lt-1/2/0.4 224.0.0.5/32 *[OSPF/10] 00:28:34, metric 1 MultiRecv
user@host> show route logical-system LS3 inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.0/30 *[OSPF/10] 00:28:23, 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] 00:29:13 > via lt-1/2/0.5 10.0.1.1/32 *[Local/0] 00:29:15 Local via lt-1/2/0.5 10.0.2.0/30 *[Direct/0] 00:29:14 > via lt-1/2/0.3 10.0.2.1/32 *[Local/0] 00:29:15 Local via lt-1/2/0.3 224.0.0.5/32 *[OSPF/10] 00:29:16, metric 1 MultiRecv
From LS1, Ping LS3
user@host> set cli logical-system LS1
user@host:LS1> ping 10.0.2.1 PING 10.0.2.1 (10.0.2.1): 56 data bytes 64 bytes from 10.0.2.1: icmp_seq=0 ttl=64 time=1.215 ms 64 bytes from 10.0.2.1: icmp_seq=1 ttl=64 time=1.150 ms 64 bytes from 10.0.2.1: icmp_seq=2 ttl=64 time=1.134 ms
From LS3, Ping LS1
user@host> set cli logical-system LS3
user@host:LS3> ping 10.0.0.1 PING 10.0.0.1 (10.0.0.1): 56 data bytes 64 bytes from 10.0.0.1: icmp_seq=0 ttl=64 time=1.193 ms 64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=1.114 ms 64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=1.190 ms
Understanding OSPF Routing Policy
Each routing policy is identified by a policy name. The name can contain letters, numbers, and hyphens (-) and can be up to 255 characters long. To include spaces in the name, enclose the entire name in double quotation marks. Each routing policy name must be unique within a configuration. Once a policy is created and named, it must be applied before it is active.
In the import
statement, you list the name of the routing policy used to filter
OSPF external routes from being installed into the routing tables of OSPF neighbors. You
can filter the routes, but not link-state address (LSA) flooding. An external route is a
route that is outside the OSPF Autonomous System (AS). The import policy does not impact
the OSPF database. This means that the import policy has no impact on the link-state
advertisements. The default import policy for OSPF is to accept all learned routes and
import them into the routing table.
In the export
statement, you list the name of the routing policy to be
evaluated when routes are being exported from the routing table into OSPF. The default
export policy for OSPF is to reject everything, except LSA type1 and type 2. OSPF does
not actually export its internally learned routes (the directly connected routes on
interfaces that are running the protocol). OSPF uses link-state advertisement (LSA)
flooding to advertise both local routes and learned routes, and LSA flooding is not
affected by the export policy.
By default, if a routing device has multiple OSPF areas, learned routes from other areas are automatically installed into area 0 of the routing table.
To specify more than one policy and create a policy chain, you list the policies using a space as a separator. If multiple policies are specified, the policies are evaluated in the order in which they are specified. As soon as an accept or reject action is executed, the policy chain evaluation ends.
This topic describes the following information:
Routing Policy Terms
Routing policies are made up of one or more terms. A term is a named structure in which match conditions and actions are defined. You can define one or more terms. The name can contain letters, numbers, and hyphens ( - ) and can be up to 255 characters long. To include spaces in the name, enclose the entire name in double quotation marks.
Each term contains a set of match conditions and a set of actions:
Match conditions are criteria that a route must match before the actions can be applied. If a route matches all criteria, one or more actions are applied to the route.
Actions specify whether to accept or reject the route, control how a series of policies are evaluated, and manipulate the characteristics associated with a route.
Routing Policy Match Conditions
A match condition defines the criteria that a route must match for an action to take place. You can define one or more match conditions for each term. If a route matches all of the match conditions for a particular term, the actions defined for that term are processed.
Each term can include two statements, from
and to
, that define the match conditions:
In the
from
statement, you define the criteria that an incoming route must match. You can specify one or more match conditions. If you specify more than one, they all must match the route for a match to occur.The
from
statement is optional. If you omit thefrom
and theto
statements, all routes are considered to match.Note:In export policies, omitting the
from
statement from a routing policy term might lead to unexpected results.In the
to
statement, you define the criteria that an outgoing route must match. You can specify one or more match conditions. If you specify more than one, they all must match the route for a match to occur.
The order of the match conditions in a term is not important because a route must match all match conditions in a term for an action to be taken.
For a complete list of match conditions, see Configuring Match Conditions in Routing Policy Terms.
Routing Policy Actions
An action defines what the routing device does with the route
when the route matches all the match conditions in the from
and to
statements for a particular term. If a term does
not have from
and to
statements, all routes
are considered to match and the actions apply to all routes.
Each term can have one or more of the following types of actions.
The actions are configured under the then
statement.
Flow control actions, which affect whether to accept or reject the route and whether to evaluate the next term or routing policy.
Actions that manipulate route characteristics.
Trace action, which logs route matches.
The then
statement is optional. If you omit it, one
of the following occurs:
The next term in the routing policy, if one exists, is evaluated.
If the routing policy has no more terms, the next routing policy, if one exists, is evaluated.
If there are no more terms or routing policies, the
accept
orreject
action specified by the default policy is executed.
For a complete list of routing policy actions, see Configuring Actions in Routing Policy Terms.
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 Device Using Logical Tunnel Interfaces on MX Series Routers and EX Series Switches.
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.
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,
copy and paste the commands into the CLI at the [edit]
hierarchy
level, and then enter commit
from configuration mode.
set logical-systems LS3 routing-options static route 0.0.0.0/0 discard set logical-systems LS3 routing-options static route 0.0.0.0/0 no-install set logical-systems LS3 policy-options policy-statement ospf-default from protocol static set logical-systems LS3 policy-options policy-statement ospf-default from route-filter 0.0.0.0/0 exact set logical-systems LS3 policy-options policy-statement ospf-default then accept set logical-systems LS3 protocols ospf export ospf-default
Procedure
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 LS3
Configure 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-install
Configure 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 accept
Apply the export policy to OSPF on Logical System LS3.
[edit] user@host:LS3# set protocols ospf export ospf-default
If 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.
show logical-systems LS3 interfaces { lt-1/2/0 { unit 3 { description LS3->LS2; encapsulation ethernet; peer-unit 4; family inet { address 10.0.2.1/30; } } unit 5 { description LS3->LS1; encapsulation ethernet; peer-unit 0; family inet { address 10.0.1.1/30; } } } } protocols { ospf { export ospf-default; area 0.0.0.0 { interface lt-1/2/0.5; interface lt-1/2/0.3; } } } policy-options { policy-statement ospf-default { from { protocol static; route-filter 0.0.0.0/0 exact; } then accept; } } routing-options { static { route 0.0.0.0/0 { discard; no-install; } } }
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.
Example: Configuring a Conditional OSPF Default Route Policy on Logical Systems
This example shows how to configure a conditional default route on one logical system and inject the default route into OSPF area 0.
Requirements
Before you begin:
Connect the logical systems by using logical tunnel (lt) interfaces. See Example: Connecting Logical Systems Within the Same Device Using Logical Tunnel Interfaces on MX Series Routers and EX Series Switches.
Enable OSPF on the interfaces. See Example: Configuring OSPF on Logical Systems Within the Same Router.
Overview
In this example, OSPF area 0 contains three logical systems that are configured on a single physical router. Logical System LS3 has a BGP session with an external peer, for example, an ISP.
The ISP injects a default static route into BGP, which provides the customer network with a default static route to reach external networks. Logical System LS3 exports the default route into OSPF. The route policy on Logical System LS3 is conditional such that if the connection to the external peer goes down, the default route is no longer active in the routing tables of the logical systems in area 0. This policy prevents null-route filtering of traffic. Null-route Filtering occurs when packets are dropped without notification.
Topology
Figure 3 shows the sample network.
Configuration
CLI Quick Configuration
To quickly configure this example, copy the
following commands, paste them into a text file, paste them into a
text file, remove any line breaks, change any details necessary to
match your network configuration, copy and paste the commands into
the CLI at the [edit] hierarchy level, and then enter commit
from configuration mode.
Device LS1
set logical-systems LS1 interfaces lt-1/2/0 unit 0 description LS1->LS3 set logical-systems LS1 interfaces lt-1/2/0 unit 0 encapsulation ethernet set logical-systems LS1 interfaces lt-1/2/0 unit 0 peer-unit 5 set logical-systems LS1 interfaces lt-1/2/0 unit 0 family inet address 10.0.1.2/30 set logical-systems LS1 interfaces lt-1/2/0 unit 2 description LS1->LS2 set logical-systems LS1 interfaces lt-1/2/0 unit 2 encapsulation ethernet set logical-systems LS1 interfaces lt-1/2/0 unit 2 peer-unit 1 set logical-systems LS1 interfaces lt-1/2/0 unit 2 family inet address 10.0.0.1/30 set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.0 set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.2
Device LS2
set logical-systems LS2 interfaces lt-1/2/0 unit 1 description LS2->LS1 set logical-systems LS2 interfaces lt-1/2/0 unit 1 encapsulation ethernet set logical-systems LS2 interfaces lt-1/2/0 unit 1 peer-unit 2 set logical-systems LS2 interfaces lt-1/2/0 unit 1 family inet address 10.0.0.2/30 set logical-systems LS2 interfaces lt-1/2/0 unit 4 description LS2->LS3 set logical-systems LS2 interfaces lt-1/2/0 unit 4 encapsulation ethernet set logical-systems LS2 interfaces lt-1/2/0 unit 4 peer-unit 3 set logical-systems LS2 interfaces lt-1/2/0 unit 4 family inet address 10.0.2.2/30 set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.1 set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.4
Device LS3
set logical-systems LS3 interfaces lt-1/2/0 unit 3 description LS3->LS2 set logical-systems LS3 interfaces lt-1/2/0 unit 3 encapsulation ethernet set logical-systems LS3 interfaces lt-1/2/0 unit 3 peer-unit 4 set logical-systems LS3 interfaces lt-1/2/0 unit 3 family inet address 10.0.2.1/30 set logical-systems LS3 interfaces lt-1/2/0 unit 5 description LS3->LS1 set logical-systems LS3 interfaces lt-1/2/0 unit 5 encapsulation ethernet set logical-systems LS3 interfaces lt-1/2/0 unit 5 peer-unit 0 set logical-systems LS3 interfaces lt-1/2/0 unit 5 family inet address 10.0.1.1/30 set logical-systems LS3 interfaces so-0/0/2 unit 0 description LS3->ISP set logical-systems LS3 interfaces so-0/0/2 unit 0 family inet address 10.0.45.2/30 set logical-systems LS3 protocols bgp group ext type external set logical-systems LS3 protocols bgp group ext peer-as 64500 set logical-systems LS3 protocols bgp group ext neighbor 10.0.45.1 set logical-systems LS3 protocols ospf export gendefault set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.5 set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.3 set logical-systems LS3 policy-options policy-statement gendefault term upstreamroutes from protocol bgp set logical-systems LS3 policy-options policy-statement gendefault term upstreamroutes from as-path upstream set logical-systems LS3 policy-options policy-statement gendefault term upstreamroutes from route-filter 0.0.0.0/0 upto /16 set logical-systems LS3 policy-options policy-statement gendefault term upstreamroutes then next-hop 10.0.45.1 set logical-systems LS3 policy-options policy-statement gendefault term upstreamroutes then accept set logical-systems LS3 policy-options policy-statement gendefault term end then reject set logical-systems LS3 policy-options as-path upstream "^64500 " set logical-systems LS3 routing-options generate route 0.0.0.0/0 policy gendefault set logical-systems LS3 routing-options autonomous-system 64501
Device ISP
set interfaces so-0/0/2 unit 0 family inet address 10.0.45.1/30 set protocols bgp group ext type external set protocols bgp group ext export advertise-default set protocols bgp group ext peer-as 64501 set protocols bgp group ext neighbor 10.0.45.2 set policy-options policy-statement advertise-default term 1 from route-filter 0.0.0.0/0 exact set policy-options policy-statement advertise-default term 1 then accept set routing-options static route 0.0.0.0/0 discard set routing-options autonomous-system 64500
Procedure
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 a conditional default route:
Configure the interfaces.
[edit logical-systems LS3 interfaces] user@R3# set lt-1/2/0 unit 3 description LS3->LS2 user@R3# set lt-1/2/0 unit 3 encapsulation ethernet user@R3# set lt-1/2/0 unit 3 peer-unit 4 user@R3# set lt-1/2/0 unit 3 family inet address 10.0.2.1/30 user@R3# set lt-1/2/0 unit 5 description LS3->LS1 user@R3# set lt-1/2/0 unit 5 encapsulation ethernet user@R3# set lt-1/2/0 unit 5 peer-unit 0 user@R3# set lt-1/2/0 unit 5 family inet address 10.0.1.1/30 user@R3# set so-0/0/2 unit 0 description LS3->ISP user@R3# set so-0/0/2 unit 0 encapsulation ethernet user@R3# set so-0/0/2 unit 0 peer-unit 7 user@R3# set so-0/0/2 unit 0 family inet address 10.0.45.2/30
Configure the autonomous system (AS) number.
[edit logical-systems LS3 routing-options] user@R3# set autonomous-system 64501
Configure the BGP session with the ISP device.
[edit logical-systems LS3 protocols bgp group ext] user@R3# set type external user@R3# set peer-as 64500 user@R3# set neighbor 10.0.45.1
Configure OSPF.
[edit logical-systems LS3 protocols ospf area 0.0.0.0] user@R3# set interface lt-1/2/0.5 user@R3# set interface lt-1/2/0.3
Configure the routing policy.
[edit logical-systems LS3 policy-options policy-statement gendefault] user@R3# set term upstreamroutes from protocol bgp user@R3# set term upstreamroutes from as-path upstream user@R3# set term upstreamroutes from route-filter 0.0.0.0/0 upto /16 user@R3# set term upstreamroutes then next-hop 10.0.45.1 user@R3# set term upstreamroutes then accept user@R3# set term end then reject [edit logical-systems LS3 policy-options] user@R3# set as-path upstream "^64500 "
Configure the generated route.
[edit logical-systems LS3 routing-options] user@R3# set generate route 0.0.0.0/0 policy gendefault
Apply the export policy to OSPF.
[edit logical-systems LS3 protocols ospf] user@R3# set export gendefault
If you are done configuring the device, commit the configuration.
[edit] user@R3# commit
Results
Confirm your configuration by issuing the show
logical-systems LS3
command.
show logical-systems LS3 interfaces { lt-1/2/0 { unit 3 { description LS3->LS2; encapsulation ethernet; peer-unit 4; family inet { address 10.0.2.1/30; } } unit 5 { description LS3->LS1; encapsulation ethernet; peer-unit 0; family inet { address 10.0.1.1/30; } } unit 6 { description LS3->ISP; encapsulation ethernet; peer-unit 7; family inet { address 10.0.45.2/30; } } } } protocols { bgp { group ext { type external; peer-as 64500; neighbor 10.0.45.1; } } ospf { export gendefault; area 0.0.0.0 { interface lt-1/2/0.5; interface lt-1/2/0.3; } } } policy-options { policy-statement gendefault { term upstreamroutes { from { protocol bgp; as-path upstream; route-filter 0.0.0.0/0 upto /16; } then { next-hop 10.0.45.1; accept; } } term end { then reject; } } as-path upstream "^64500 "; } routing-options { generate { route 0.0.0.0/0 policy gendefault; } autonomous-system 64501; }
Verification
Confirm that the configuration is working properly.
- Verifying that the Route to the ISP Is Working
- Verifying That the Static Route Is Redistributed
- Testing the Policy Condition
Verifying that the Route to the ISP Is Working
Purpose
Make sure connectivity is established between Logical System LS3 and the ISP’s router.
Action
user@host>set cli logical-system LS3 Logical system: LS3 user@host:LS3>ping 10.0.45.1 PING 10.0.45.1 (10.0.45.1): 56 data bytes 64 bytes from 10.0.45.1: icmp_seq=0 ttl=64 time=1.185 ms 64 bytes from 10.0.45.1: icmp_seq=1 ttl=64 time=1.199 ms 64 bytes from 10.0.45.1: icmp_seq=2 ttl=64 time=1.186 ms
Meaning
The ping
command confirms reachability.
Verifying That the Static Route Is Redistributed
Purpose
Make sure that the BGP policy is redistributing the static route into Logical System LS3’s routing table. Also make sure that the OSPF policy is redistributing the static route into the routing tables of Logical System LS1 and Logical System LS2.
Action
user@host> show route logical-system LS3 protocol bgp inet.0: 9 destinations, 10 routes (9 active, 0 holddown, 1 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[BGP/170] 00:00:25, localpref 100 AS path: 64500 I > to 10.0.45.1 via so-0/0/2.0
user@host> show route logical-system LS1 protocol ospf inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[OSPF/150] 00:03:58, metric 0, tag 0 > to 10.0.1.1 via lt-1/2/0.0 10.0.2.0/30 *[OSPF/10] 03:37:45, 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] 03:38:41, metric 1 MultiRecv
user@host> show route logical-system LS2 protocol ospf inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 *[OSPF/150] 00:04:04, metric 0, tag 0 > to 10.0.2.1 via lt-1/2/0.4 10.0.1.0/30 *[OSPF/10] 03:37:46, metric 2 to 10.0.0.1 via lt-1/2/0.1 > to 10.0.2.1 via lt-1/2/0.4 224.0.0.5/32 *[OSPF/10] 03:38:47, metric 1 MultiRecv
Meaning
The routing tables contain the default 0.0.0.0/0 route. 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. If Logical System LS3 receives packets destined for networks not specified in its routing table, those packets will be sent to the ISP for further processing.
Testing the Policy Condition
Purpose
Deactivate the interface to make sure that the route is removed from the routing tables if the external network becomes unreachable.
Action
user@host> deactivate logical-systems LS3 interfaces so-0/0/2 unit 0 family inet address 10.0.45.2/30 user@host> commit
user@host> show route logical-system LS1 protocol ospf inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.2.0/30 *[OSPF/10] 03:41:48, 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] 03:42:44, metric 1 MultiRecv user@host> show route logical-system LS2 protocol ospf inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.1.0/30 *[OSPF/10] 03:42:10, metric 2 to 10.0.0.1 via lt-1/2/0.1 > to 10.0.2.1 via lt-1/2/0.4 224.0.0.5/32 *[OSPF/10] 03:43:11, metric 1 MultiRecv
Meaning
The routing tables on Logical System LS1 and Logical System LS2 do not contain the default 0.0.0.0/0. This verifies that the default route is no longer present in the OSPF domain. To reactivate the so-0/0/2.0 interface, issue the activate logical-systems LS3 interfaces so-0/0/2 unit 0 family inet address 10.0.45.2/30 configuration-mode command.
Example: Configuring an OSPF Import Policy on Logical Systems
This example shows how to configure an OSPF import policy on logical systems. OSPF import policies apply to external routes only. An external route is a route that is outside the OSPF AS.
Requirements
This example shows logical systems that are configured within a single physical router. The logical systems connect to each other by using logical tunnel (lt) interfaces. See Example: Connecting Logical Systems Within the Same Device Using Logical Tunnel Interfaces on MX Series Routers and EX Series Switches. Alternatively, you can use multiple physical routers.
Overview
External routes are learned by Autonomous System Border Routers (ASBRs). External routes can be advertised throughout the OSPF domain if you configure the ASBR to redistribute the route into OSPF. An external route might be learned by the ASBR from a routing protocol other than OSPF, or the external route might be a static route that you configure on the ASBR.
OSPF import policy allows you to prevent external routes from being added to the routing tables of OSPF neighbors. The import policy does not impact the OSPF database. This means that the import policy has no impact on the link-state advertisements.
OSPF import policies have practical applications. Suppose, for example, that you are using OSPF to advertise a static route to the devices in your datacenter because you want some of the devices in the datacenter to use the static route. However, you want other devices in the datacenter to ignore the static route. So, you apply the OSPF import policy on the devices that you want to ignore the static route. The filtering is done only on external routes in OSPF. The intra-area and inter-area routes are not considered for filtering. The default action is to accept the route when the route does not match the policy.
Topology
Figure 4 shows the sample network.
In this example, the logical systems operate as follows:
LS3—Logical System LS3 has a static route to the 10.0.16.0/30 network. The next hop for the static route is 10.0.60.1. LS3 has an OSPF export policy configured. The export policy redistributes static routes from LS3’s routing table into LS3’s OSPF database. Because the static route is in LS3’s OSPF database, the route is advertised in a link state advertisement (LSA) to LS3’s OSPF neighbor. LS3’s OSPF neighbor is Logical System LS2.
LS2—Logical System LS2 receives the route advertisement from LS3. LS2 then installs the route into LS2’s OSPF database. LS2 has an OSPF import policy configured that matches the static route to the 10.0.16.0/30 network and prevents the static route from being installed in LS2’s routing table. However, because the route is in LS2’s OSPF database, LS2 advertises the route to its OSPF neighbor, Logical System LS1.
LS1—Logical System LS1 receives the route advertisement from LS2. LS1 then installs the route into LS1’s OSPF database. LS1 does not have an OSPF import policy configured that matches the static route to the 10.0.16.0/30 network . Therefore, the route gets installed in LS1’s routing table.
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,
copy and paste the commands into the CLI at the [edit]
hierarchy
level, and then enter commit
from configuration mode.
LS3
set logical-systems LS3 interfaces so-0/0/0 unit 0 family inet address 10.0.60.2/30 set logical-systems LS3 interfaces lt-1/2/0 unit 3 description LS3->LS2 set logical-systems LS3 interfaces lt-1/2/0 unit 3 encapsulation ethernet set logical-systems LS3 interfaces lt-1/2/0 unit 3 peer-unit 4 set logical-systems LS3 interfaces lt-1/2/0 unit 3 family inet address 10.0.2.1/30 set logical-systems LS3 protocols ospf export export_static set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.3 set logical-systems LS3 policy-options policy-statement export_static from protocol static set logical-systems LS3 policy-options policy-statement export_static then accept set logical-systems LS3 routing-options static route 10.0.16.0/30 next-hop 10.0.60.1
LS2
set logical-systems LS2 interfaces lt-1/2/0 unit 1 description LS2->LS1 set logical-systems LS2 interfaces lt-1/2/0 unit 1 encapsulation ethernet set logical-systems LS2 interfaces lt-1/2/0 unit 1 peer-unit 2 set logical-systems LS2 interfaces lt-1/2/0 unit 1 family inet address 10.0.0.2/30 set logical-systems LS2 interfaces lt-1/2/0 unit 4 description LS2->LS3 set logical-systems LS2 interfaces lt-1/2/0 unit 4 encapsulation ethernet set logical-systems LS2 interfaces lt-1/2/0 unit 4 peer-unit 3 set logical-systems LS2 interfaces lt-1/2/0 unit 4 family inet address 10.0.2.2/30 set logical-systems LS2 protocols ospf import filter_routes set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.1 set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.4 set logical-systems LS2 policy-options policy-statement filter_routes from route-filter 10.0.16.0/30 exact set logical-systems LS2 policy-options policy-statement filter_routes then reject
LS1
set logical-systems LS1 interfaces lt-1/2/0 unit 2 description LS1->LS2 set logical-systems LS1 interfaces lt-1/2/0 unit 2 encapsulation ethernet set logical-systems LS1 interfaces lt-1/2/0 unit 2 peer-unit 1 set logical-systems LS1 interfaces lt-1/2/0 unit 2 family inet address 10.0.0.1/30 set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.2
Procedure
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 import policy on logical systems:
Configure the interfaces.
[edit] user@R1# set logical-systems LS3 interfaces so-0/0/0 unit 0 family inet address 10.0.60.2/30 user@R1# set logical-systems LS3 interfaces lt-1/2/0 unit 3 description LS3->LS2 user@R1# set logical-systems LS3 interfaces lt-1/2/0 unit 3 encapsulation ethernet user@R1# set logical-systems LS3 interfaces lt-1/2/0 unit 3 peer-unit 4 user@R1# set logical-systems LS3 interfaces lt-1/2/0 unit 3 family inet address 10.0.2.1/30 user@R1# set logical-systems LS2 interfaces lt-1/2/0 unit 1 description LS2->LS1 user@R1# set logical-systems LS2 interfaces lt-1/2/0 unit 1 encapsulation ethernet user@R1# set logical-systems LS2 interfaces lt-1/2/0 unit 1 peer-unit 2 user@R1# set logical-systems LS2 interfaces lt-1/2/0 unit 1 family inet address 10.0.0.2/30 user@R1# set logical-systems LS2 interfaces lt-1/2/0 unit 4 description LS2->LS3 user@R1# set logical-systems LS2 interfaces lt-1/2/0 unit 4 encapsulation ethernet user@R1# set logical-systems LS2 interfaces lt-1/2/0 unit 4 peer-unit 3 user@R1# set logical-systems LS2 interfaces lt-1/2/0 unit 4 family inet address 10.0.2.2/30 user@R1# set logical-systems LS1 interfaces lt-1/2/0 unit 2 description LS1->LS2 user@R1# set logical-systems LS1 interfaces lt-1/2/0 unit 2 encapsulation ethernet user@R1# set logical-systems LS1 interfaces lt-1/2/0 unit 2 peer-unit 1 user@R1# set logical-systems LS1 interfaces lt-1/2/0 unit 2 family inet address 10.0.0.1/30
Enable OSPF on the interfaces.
[edit] user@R1# set logical-systems LS3 protocols ospf area 0.0.0.0 interface lt-1/2/0.3 user@R1# set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.1 user@R1# set logical-systems LS2 protocols ospf area 0.0.0.0 interface lt-1/2/0.4 user@R1# set logical-systems LS1 protocols ospf area 0.0.0.0 interface lt-1/2/0.2
Configure the static route on Logical System LS3.
[edit] user@R1# set logical-systems LS3 routing-options static route 10.0.16.0/30 next-hop 10.0.60.1
On Logical System LS3, redistribute the static route into OSPF.
[edit] user@R1# set logical-systems LS3 protocols ospf export export_static user@R1# set logical-systems LS3 policy-options policy-statement export_static from protocol static user@R1# set logical-systems LS3 policy-options policy-statement export_static then accept
On Logical System LS2, configure the OSPF import policy.
[edit] user@R1# set logical-systems LS2 protocols ospf import filter_routes user@R1# set logical-systems LS2 policy-options policy-statement filter_routes from route-filter 10.0.16.0/30 exact user@R1# set logical-systems LS2 policy-options policy-statement filter_routes then reject
If you are done configuring the device, commit the configuration.
[edit] user@R1# commit
Results
Confirm your configuration by issuing the show
logical-systems
command.
user@R1# show logical-systems LS1 { interfaces { lt-1/2/0 { unit 2 { description LS1->LS2; encapsulation ethernet; peer-unit 1; family inet { address 10.0.0.1/30; } } } } protocols { ospf { area 0.0.0.0 { interface lt-1/2/0.2; } } } } LS2 { interfaces { lt-1/2/0 { unit 1 { description LS2->LS1; encapsulation ethernet; peer-unit 2; family inet { address 10.0.0.2/30; } } unit 4 { description LS2->LS3; encapsulation ethernet; peer-unit 3; family inet { address 10.0.2.2/30; } } } } protocols { ospf { import filter_routes; area 0.0.0.0 { interface lt-1/2/0.1; interface lt-1/2/0.4; } } } policy-options { policy-statement filter_routes { from { route-filter 10.0.16.0/30 exact; } then reject; } } } LS3 { interfaces { so-0/0/0 { unit 0 { family inet { address 10.0.60.2/30; } } } lt-1/2/0 { unit 3 { description LS3->LS2; encapsulation ethernet; peer-unit 4; family inet { address 10.0.2.1/30; } } } } protocols { ospf { export export_static; area 0.0.0.0 { interface lt-1/2/0.3; } } } policy-options { policy-statement export_static { from protocol static; then accept; } } routing-options { static { route 10.0.16.0/30 next-hop 10.0.60.1; } } }
Verification
Confirm that the configuration is working properly.
Viewing the OSPF Databases of the Logical Systems
Purpose
Verify that OSPF is advertising the static route.
Action
user@R1> show ospf database logical-system all logical-system: LS2 OSPF database, Area 0.0.0.0 Type ID Adv Rtr Seq Age Opt Cksum Len Router 10.0.0.1 10.0.0.1 0x8000001f 107 0x22 0x8f59 36 Router *10.0.0.2 10.0.0.2 0x80000025 101 0x22 0x4074 48 Router 10.0.2.1 10.0.2.1 0x80000018 107 0x22 0xab3a 36 Network 10.0.0.1 10.0.0.1 0x80000001 107 0x22 0x7b94 32 Network 10.0.2.1 10.0.2.1 0x8000000c 190 0x22 0x53ab 32 OSPF AS SCOPE link state database Type ID Adv Rtr Seq Age Opt Cksum Len Extern 10.0.16.0 10.0.2.1 0x80000007 1785 0x22 0x4147 36 ----- logical-system: LS1 OSPF database, Area 0.0.0.0 Type ID Adv Rtr Seq Age Opt Cksum Len Router *10.0.0.1 10.0.0.1 0x8000001f 107 0x22 0x8f59 36 Router 10.0.0.2 10.0.0.2 0x80000025 103 0x22 0x4074 48 Router 10.0.2.1 10.0.2.1 0x80000018 109 0x22 0xab3a 36 Network *10.0.0.1 10.0.0.1 0x80000001 107 0x22 0x7b94 32 Network 10.0.2.1 10.0.2.1 0x8000000c 192 0x22 0x53ab 32 OSPF AS SCOPE link state database Type ID Adv Rtr Seq Age Opt Cksum Len Extern 10.0.16.0 10.0.2.1 0x80000007 1787 0x22 0x4147 36 ----- logical-system: LS3 OSPF database, Area 0.0.0.0 Type ID Adv Rtr Seq Age Opt Cksum Len Router 10.0.0.1 10.0.0.1 0x8000001f 109 0x22 0x8f59 36 Router 10.0.0.2 10.0.0.2 0x80000025 103 0x22 0x4074 48 Router *10.0.2.1 10.0.2.1 0x80000018 107 0x22 0xab3a 36 Network 10.0.0.1 10.0.0.1 0x80000001 109 0x22 0x7b94 32 Network *10.0.2.1 10.0.2.1 0x8000000c 190 0x22 0x53ab 32 OSPF AS SCOPE link state database Type ID Adv Rtr Seq Age Opt Cksum Len Extern *10.0.16.0 10.0.2.1 0x80000007 1785 0x22 0x4147 36 ...
Meaning
The Extern *10.0.16.0 output shows that OSPF is advertising the external route.
Viewing the Routing Tables of the Logical Systems
Purpose
Make sure that Logical System LS3 and Logical System LS1 have the route to the 10.0.16.0/30 network installed in their respective routing tables. Make sure that Logical System LS2 does not have the route installed in its routing table.
Action
user@R1> show route logical-system all logical-system: LS2 inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.0/30 *[Direct/0] 04:22:19 > via lt-1/2/0.1 10.0.0.2/32 *[Local/0] 04:22:19 Local via lt-1/2/0.1 10.0.2.0/30 *[Direct/0] 04:22:19 > via lt-1/2/0.4 10.0.2.2/32 *[Local/0] 04:22:19 Local via lt-1/2/0.4 224.0.0.5/32 *[OSPF/10] 04:22:23, metric 1 MultiRecv ----- logical-system: LS1 inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.0/30 *[Direct/0] 04:22:19 > via lt-1/2/0.2 10.0.0.1/32 *[Local/0] 04:22:19 Local via lt-1/2/0.2 10.0.2.0/30 *[OSPF/10] 00:07:52, metric 2 > to 10.0.0.2 via lt-1/2/0.2 10.0.16.0/30 *[OSPF/150] 00:07:52, metric 0, tag 0 > to 10.0.0.2 via lt-1/2/0.2 224.0.0.5/32 *[OSPF/10] 04:22:23, metric 1 MultiRecv ----- logical-system: LS3 inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both 10.0.0.0/30 *[OSPF/10] 00:07:57, metric 2 > to 10.0.2.2 via lt-1/2/0.3 10.0.2.0/30 *[Direct/0] 04:22:19 > via lt-1/2/0.3 10.0.2.1/32 *[Local/0] 04:22:19 Local via lt-1/2/0.3 10.0.16.0/30 *[Static/5] 03:51:18 > to 10.0.60.1 via so-0/0/0.0 10.0.60.0/30 *[Direct/0] 03:53:52 > via so-0/0/0.0 10.0.60.2/32 *[Local/0] 03:53:58 Local via so-0/0/0.0 224.0.0.5/32 *[OSPF/10] 04:22:23, metric 1 MultiRecv
Meaning
The route to 10.0.16.0/30 is not installed in Logical System LS2’s routing table. The route to 10.0.16.0/30 is installed in Logical System LS1’s routing table as a route learned from OSPF. Because it is an OSPF external route, it has a preference value of 150 (instead of 10). By default, routes resulting from OSPF external LSAs are installed with a preference value of 150. The route to 10.0.16.0/30 is installed in Logical System LS3’s routing table as a static route.