The route-tag command sets a tag value for imported VPN routes.
The undo route-tag command restores the default setting.
By default, the tag value of a VPN route is calculated based on the AS number of BGP. If no BGP is configured, the default tag value is 0.
Product |
Support |
---|---|
S5720-EI, S5720-HI, S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730-HI, S5730S-EI, S5730-SI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6720S-SI, S6720-SI, S6730-H, S6730S-H, S6730-S, and S6730S-S |
Supported |
S2720-EI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S6720-LI, and S6720S-LI |
Not supported |
Parameter | Description | Value |
---|---|---|
tag | Specifies the tag value of the imported VPN routes. | The value is an integer ranging from 0 to 4294967295. |
disable | Disables a device from using a VPN route tag to detect loops. | - |
Usage Scenario
The route-tag command can be used only in VPN scenarios to prevent loops on Type-5 and Type-7 LSAs when a CE is dual-homed to two PEs.
In a networking where a CE is dual-homed to two PEs, PE1 generates Type-5 and Type-7 LSAs based on the imported BGP routes and sends the LSAs to the CE, then to PE2. Because OSPF routes have higher priorities over BGP routes, OSPF routes will replace BGP routes on PE2, causing loops. After the route-tag command is run, if the tag value of the PE and an LSA are the same, the PE will neglect the LSA, and a loop is prevented.
By default, the first two bytes of the tag value are fixed as 0xD000, while the last two bytes are the AS number of the local BGP. If a BGP AS number is greater than 65535, the default tag 0 is used. You can use the command to change the tag in this case.
Precautions
The tags set by the route-tag command or other commands are different only in preference.
# Set the route tag for OSPF process 100 to 100 in a VPN instance named huawei.
<HUAWEI> system-view
[HUAWEI] ip vpn-instance huawei
[HUAWEI-vpn-instance-huawei] route-distinguisher 100:1
[HUAWEI-vpn-instance-huawei-af-ipv4] quit
[HUAWEI-vpn-instance-huawei] quit
[HUAWEI] ospf 100 vpn-instance huawei
[HUAWEI-ospf-100] route-tag 100