Apply OSPF Route Acceptance Policies
Use a route policy to define how the switch redistributes external routes from a specified source into an OSPF domain. The policy defines which route types the switch accepts and redistributes.
Before you begin
-
Enable OSPF globally.
-
Ensure that a route policy exists.
-
Ensure that the area exists.
-
You apply OSPF route acceptance policies on a VRF instance the same way you configure the GlobalRouter, except that you must use VRF Router Configuration mode and the prefix ip ospf. The VRF must have an RP Trigger of OSPF. Not all parameters are configurable on non0 VRFs.
Note
The route policies treat permit and deny rules differently for inbound and outbound traffic.
-
For an in-policy (RIP, BGP) or an accept policy (OSPF) using a route-map, if a particular route is not explicitly denied in the accept policy or in-policy with the route-map, then the route is implicitly allowed.
-
For an out-policy (RIP, BGP) or a redistribute policy (RIP, OSPF, BGP) using a route-map, even if a particular route is not explicitly allowed in the redistribution policy or out-policy with the route-map, then the route is implicitly denied.
-
In order to permit or deny only explicit routes, configure a policy with additional sequences, where, the last sequence permits all routes that are not explicitly permitted or denied.
Procedure
Example
Create an acceptance policy instance, configure the type of metric to accept, indicate the route policy and enable the OSPF route acceptance instance. Ensure the configuration is correct.
Switch:1>enable Switch:1#configure terminal Switch:1#router ospf Switch:1(config-ospf)#accept adv-rtr 192.0.2.11 Switch:1(config-ospf)#accept adv-rtr 192.0.2.11 metric-type type1 Switch:1(config-ospf)#accept adv-rtr 192.0.2.11 route-map test1 Switch:1(config-ospf)#accept adv-rtr 192.0.2.11 enable
Switch:1#show ip ospf accept ================================================================================ Ospf Accept - GlobalRouter ================================================================================ ADV_RTR MET_TYPE ENABLE POLICY -------------------------------------------------------------------------------- 192.0.2.11 type1 true test1
Variable definitions
The following table defines parameters for the accept adv-rtr command.
Variable |
Value |
---|---|
<A.B.C.D> |
Specifies the IP address. |
enable |
Enables an OSPF acceptance policy. |
metric-type <type1|type2|any> |
Configures the metric type as type 1, type 2, or any. |
route-map WORD<0-64> |
Configures the route policy by name. |
The following table defines parameters for the ip ospf accept command.
Variable |
Value |
---|---|
vrf WORD<1-16> |
Specifies a VRF by name. |
vrfids WORD<0-512> |
Specifies a range of VRF IDs. |