Configure a Policy to Accept External Routes from a Router

Perform this procedure to configure a policy to accept external routes from a specified advertising router.

Note

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

  1. Enter OSPF Router Configuration mode:

    enable

    configure terminal

    router ospf

  2. Create a policy to accept external routes from a specified advertising route:

    accept adv-rtr <A.B.C.D>

  3. Exit to the Privileged EXEC mode.

    exit

  4. Apply the OSPF accept policy change:

    ip ospf apply accept adv-rtr <A.B.C.D>

  5. Confirm your configuration:

    show ip ospf accept

Example

Log on to the OSPF Router Configuration mode:

Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#router ospf

Create a policy to accept external routes from a specified advertising route:

Switch:1(config-ospf)#accept adv-rtr 192.0.2.122

Enable an OSPF accept entry for a specified advertising route:

Switch:1(config-ospf)#accept adv-rtr 192.0.2.122 enable

Exit to the Privileged EXEC mode:

Switch:1(config-ospf)#exit
Switch:1(config)#exit

Apply the OSPF accept policy change and confirm your configuration:

Switch:1#ip ospf apply accept adv-rtr 192.0.2.122
Switch:1#show ip ospf accept
================================================================================
                           Ospf Accept - GlobalRouter
================================================================================
ADV_RTR         MET_TYPE ENABLE POLICY
--------------------------------------------------------------------------------
192.0.2.122      -       FALSE

Variable definitions

Use the data in the following table to use the accept adv-rtr command.

Variable

Value

<A.B.C.D>

Specifies the IP address.

enable

Enables an OSPF accept entry for a specified advertising router.

Use the no operator to disable an OSPF accept entry: no accept adv-rtr <A.B.C.D> enable

metric-type {type1|type2|}

Indicates the OSPF external type. This parameter describes which types of OSPF external routes match this entry.

means match all external routes.

type1 means match external type 1 only.

type2 means match external type 2 only.

Use the no operator to disable metric-type: no ip ospf accept adv-rtr <A.B.C.D> metric-type

route-map WORD<0-64>

Specifies the name of the route policy to use for filtering external routes advertised by the specified advertising router before accepting into the routing table.