Example: Injecting OSPF Routes into the BGP Routing Table
This example shows you how to create a policy that injects OSPF routes into the BGP routing table.
Requirements
Before you begin, configure router interfaces and configure routing protocols, as explained in Routing Policies Configuration Overview.
Overview
In this example, you create a routing policy called injectpolicy1 and a routing term called injectterm1. The policy injects OSPF routes into the BGP routing table.
Configuration
CLI Quick Configuration
To quickly create a policy that injects OSPF routes into the BGP routing table, copy the following commands and paste them into the CLI.
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.
To inject OSPF routes into a BGP routing table:
Create the routing policy.
[edit]user@host# edit policy-options policy-statement injectpolicy1Create the policy term.
[edit policy-options policy-statement injectpolicy1]user@host# edit term injectterm1Specify OSPF as a match condition.
[edit policy-options policy-statement injectpolicy1 term injectterm1]user@host# set from protocol ospfSpecify the routes from an OSPF area as a match condition.
[edit policy-options policy-statement injectpolicy1 term injectterm1]user@host# set from area 1Specify that the route is to be accepted if the previous conditions are matched.
[edit policy-options policy-statement injectpolicy1 term injectterm1]user@host# set then acceptApply the routing policy to BGP.
[edit]user@host# set protocols bgp export injectpolicy1
Results
Confirm your configuration by entering the show policy-options and show protocols bgp commands from configuration mode. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.
If you are done configuring the device, enter commit from configuration mode.
Verification
To confirm that the configuration is working properly, perform these tasks:
Verifying the OSPF-Based Match Conditions
Purpose
Verify that the policy and term are configured on the device with the appropriate OSPF-based match conditions.
Action
From operational mode, enter the show policy-options command.
Verifying the Routing Policy
Purpose
Verify that the routing policy is applied to the routing protocol.
Action
From operational mode, enter the show protocols bgp command.
Related Topics
- Junos OS Feature Support Reference for SRX Series and J Series Devices
- Routing Policies Configuration Overview
- Understanding Protocol-Based Match Conditions
Hide Navigation Pane
Show Navigation Pane
Download
SHA1