Configuring a Priority for Direct Subnet Routes on an Interface
Usage Scenario
In Figure 1-9, VM1 and VM2 communicates with each other. Before VM2 is migrated from campus 1 to campus 2, VM1's traffic is forwarded to VM2 through DSW1. After VM2 is migrated to campus 2, VM1's traffic is still forwarded along the original path because the default priority of direct subnet routes is higher than that of static routes. To address this problem, configure a static route on DSW1, with the VM traffic diverging device as the next hop, and run the direct-route ip preference command to configure a priority for direct subnet routes so that the static route takes precedence over direct subnet routes during route selection. After receiving VM1's traffic, the VM traffic diverging device forwards it to the new location of VM2, preventing a traffic interruption.
Pre-configuration Tasks
Before configuring a priority for direct subnet routes on an interface, configure link-layer protocol parameters and IP addresses for interfaces and ensure that the link layer protocol of each interface is Up.
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-name
The interface view is displayed.
- Run direct-route ip preference preference-value
A priority is configured for direct subnet routes on the interface.
By default, the priority is 0.
- Run commit
The configuration is committed.