< Home

route-tag (OSPF)

Function

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.

Format

route-tag { tag | disable }

undo route-tag

Parameters

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. -

Views

OSPF view

Default Level

2: Configuration level

Usage Guidelines

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

  • Configuring the same VPN route tag on the PEs within the same area is recommended.
  • Different OSPF processes can be configured with the same VPN route tag.

The tags set by the route-tag command or other commands are different only in preference.

  1. The preference of the tag configured using the import-route command is the highest.
  2. The preference of the tag configured using the route-tag command is medium.
  3. The preference of the tag configured using the default tag command is the lowest.

Example

# Set the route tag for OSPF process 100 to 100 in a VPN instance named huawei.

<sysname> system-view
[sysname] ospf 100 vpn-instance huawei
[sysname-ospf-100] route-tag 100
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >