Configuration Guide Vol. 3


4.2.2 Configuring Policy Based Routing

The following provides an example of configuring policy-based routing.

<Structure of this section>

(1) Setting up a policy-based routing group

The following example sets policy-based routing list information by using IPv4 packets as flow detection conditions.

Points to note

The example below shows how to use an access list to set policy-based routing list information.

Command examples

  1. (config)# mac-address-table static 0012.e200.1122 vlan 100 interface gigabitethernet 1/0/1

    (config)# arp 192.168.1.1 interface vlan 100 0012.e200.1122

    Sets the next-hop IPv4 address 192.168.1.1 and destination MAC address 0012.e200.1122 for VLAN 100 to configure static entry.

  2. (config)# mac-address-table static 0012.e200.3344 vlan 200 interface gigabitethernet 1/0/2

    (config)# arp 192.168.2.1 interface vlan 200 0012.e200.3344

    Sets the next-hop IPv4 address192.168.2.1 and destination MAC address 0012.e200.3344 for VLAN 200 to configure static entry.

  3. (config)# policy-list 10

    Sets policy-based routing list information by list number 10. When this list is created, the command switches to policy-based routing list information mode.

  4. (config-pol)# policy-interface vlan 100 next-hop 192.168.1.1

    Sets VLAN 100 and the next-hop address 192.168.1.1 as the route with the highest priority in the policy-based routing list information.

  5. (config-pol)# policy-interface vlan 200 next-hop 192.168.2.1

    Sets VLAN 200 and the next-hop address 192.168.2.1 as a redundant route in the policy-based routing list information.

  6. (config-pol)# default permit

    Sets normal forwarding as the default operation in the policy-based routing list information.

  7. (config-pol)# exit

    Returns to global configuration mode from policy-based routing list information mode.

  8. (config)# ip access-list extended POLICY_GROUP

    Creates ip access-list (POLICY_GROUP). When this list is created, the command switches to IPv4 packet filtering mode.

  9. (config-ext-nacl)# permit tcp any any action policy-list 10

    Sets the policy-based routing list information for enabling policy-based routing for IPv4 packets. Set the list number to 10.

  10. (config-ext-nacl)# permit ip any any

    Sets an IPv4 packet filter that forwards all frames.

  11. (config-ext-nacl)# exit

    Returns to global configuration mode from IPv4 packet filtering mode.

  12. (config)# interface vlan 10

    Switches to the interface mode for VLAN10.

  13. (config-if)# ip access-group POLICY_GROUP in

    Enables the target ip access-list (POLICY_GROUP) on the receiving side.

(2) Sets "Do not switch back" for path switchback operation.

The following example sets Do not switch back as the path switch-back operation in the policy-based routing list information in which a forwarding destination route has been set.

Points to note

If you set Do not switch back as the path switch-back operation, use the show ip cache policy operation command to make sure that the setting has been applied to the target policy-based routing list information.

Command examples

  1. (config)# policy-list 10

    Switches to policy-based routing list information mode with list number 10.

  2. (config-pol)# recover off

    Sets Do not switch back as the path switch-back operation. After setting, execute the show ip cache policy 10 operation command.

(3) Setting the Tracking Function

The following example configures an IPv4 ICMP polling monitoring track.

Points to note

To start polling after setting all parameters, we recommend that you use the commands and specify the parameters in the following order:

  1. Use the track-object command to specify the track ID.

  2. Use the disable command to stop track operation.

  3. Specify all parameters.

  4. Use the no disable command to cancel the setting that stops the track operation.

Note that if you set a source IPv4 address for IPv4 ICMP polling monitoring, a fixed destination address is set for response packets. This allows you to design the route for response packets more easily.

Command examples

  1. (config)# track-object 1000

    Specifies the track ID to be configured.

  2. (config-track-object)# disable

    Stops operation of the track being configured.

  3. (config-track-object)# default-state up

    Specifies Up as the default track state. After that, the track state is Up after the track operation starts until the track state changes to Down.

  4. (config-track-object)# type icmp 192.0.2.2 nexthop 192.158.1.1 source 198.51.100.1

    (config-track-object)# timeout 5

    (config-track-object)# interval 10

    (config-track-object)# failure detection 4 trial 5 interval 10

    (config-track-object)# recovery detection 4 trial 5 interval 10

    Specifies the track as an IPv4 ICMP polling monitoring track that monitors 192.0.2.2. Specifies the polling packet source address as 198.51.100.1.

    Then, the command specifies the track's response wait time, normal polling interval, the number of times polling is performed and polling interval during failure verification, the number of times polling is performed and the polling interval during failure recovery verification.

  5. (config-track-object)# no disable

    Deletes the configuration that stops track operation. When the configuration is deleted, track operation starts.

  6. (config-track-object)# exit

    Returns to global configuration mode from tracking functionality mode.

  7. (config)# policy-list 10

    Sets policy-based routing list information by list number 10. When this list is created, the command switches to policy-based routing list information mode.

  8. (config-pol)# policy-interface vlan 100 next-hop 192.168.1.1 track-object 1000

    Sets VLAN 100, next hop address 192.168.1.1, and track ID 1000 as the route for policy-based routing list information.

  9. (config-pol)# default permit

    Sets normal forwarding as the default operation in the policy-based routing list information.

  10. (config-pol)# exit

    Returns to global configuration mode from policy-based routing list information mode.

  11. (config)# ip access-list extended POLICY_GROUP

    Creates ip access-list (POLICY_GROUP). When this list is created, the command switches to IPv4 packet filtering mode.

  12. (config-ext-nacl)# permit tcp any any action policy-list 10

    Sets the policy-based routing list information for enabling policy-based routing for IPv4 packets. Set the list number to 10.

  13. (config-ext-nacl)# permit ip any any

    Sets an IPv4 packet filter that forwards all frames.

  14. (config-ext-nacl)# exit

    Returns to global configuration mode from IPv4 packet filtering mode.

  15. (config)# interface vlan 10

    Switches to the interface mode for VLAN10.

  16. (config-if)# ip access-group POLICY_GROUP in

    Enables the target ip access-list (POLICY_GROUP) on the receiving side.