The route-tag command sets the 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.
| Parameter | Description | Value |
|---|---|---|
| tag | Specifies the tag value of the imported VPN routes. | The value is an integer ranging from 0 to 4294967295. |
| disable | Forbids the using of the tag to detect the loop. | - |
Usage Scenario
The route-tag command can only be used in VPN scenarios to prevent loops on As-external-LSAs when a CE is dual-homed to two PEs.
In a networking where a CE is dual-homed to two PEs, PE1 generates As-external-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, the former will replace the latter 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 is fixed as 0xD000, while the last two bytes is 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.