This article describes how to create a routing policy to export all local static and direct routes for OSPF. For information about configuring OSPF, see KB16570 [juniper.net] .
For other topics, go to the SRX Getting Started main page.
By default, OSPF imports all learned routes into the routing table and exports routes only from interfaces that are members of the OSPF area. To export all other routes or filter inbound routes, you must use routing policies.
This section contains the following:
1. Create a routing policy that defines matching criteria and the action to be taken for traffic that matches the criteria. In this example, a policy named all-local is created with matching criteria of traffic from direct routes, static routes and local routes and action as accept for matching traffic.
all-local
accept
user@host# set policy-options policy-statement all-local term 1 from protocol direct user@host# set policy-options policy-statement all-local term 1 then accept
user@host#
set policy-options policy-statement all-local term 1 from protocol direct
set policy-options policy-statement all-local term 1 then accept
user@host# set policy-options policy-statement all-local term 2 from protocol static user@host# set policy-options policy-statement all-local term 2 then accept
set policy-options policy-statement all-local term 2 from protocol static
set policy-options policy-statement all-local term 2 then accept
user@host# set policy-options policy-statement all-local term 2 from protocol local user@host# set policy-options policy-statement all-local term 2 then accept
set policy-options policy-statement all-local term 2 from protocol local
2. Apply the policy as below:
user@host# set protocols ospf export all-local
set protocols ospf export all-local
traceoptions
user@host# set protocols ospf traceoptions file ospf.debug size 5m files 5 user@host#
set protocols ospf traceoptions flag all