Use this command to create a list of export, import, or both route target (RT) extended communities for the specified VRF instance. Enter the route-target command one time for each target extended community. Routes that are learned and carry a specific route-target extended community are imported into all VRFs configured with that extended community as an import route target.
The configured export RT is carried as an extended community in the MP-BGP format to the eBGP peer. An RT is either:
- ASN-related: Composed of an autonomous system number and an arbitrary number.
- IP address-related: Composed of an IP address and an arbitrary number.
- 4-byte ASN related: Composed of an 4-byte autonomous system number and an arbitrary number.
| Default | A VRF does not associate with any RT. |
| Format | route-target {export | import | both} rt-ext-comm |
| Mode | Virtual Router Config |
| Parameter | Description |
|---|---|
| export | Exports routing information to the target VPN extended community. |
| import | Imports routing information from the target VPN extended community. |
| both | Exports/imports the routing information to/from the target VPN extended community. |
| rt-ext-comm | The route-target extended community attributes to be added to the list of import, export or both (import and export)
route-target extended communities.
The route target specifies a target VPN extended community. Like a route distinguisher, the route-target extended community
can be specified in either of the following formats:
|
This command is effective only if BGP is running on the router.
Example: The following example shows how to configure route target extended community attributes for a VRF instance in IPv4. The result of this command sequence is that VRF named Red has two export extended communities (100:10 and 300:10) and two import extended communities (300:10 and 192.168.10.1:10).
(Router) (Config)#ip vrf Red (Router) (Config-vrf-Red)#route-target export 100:10 (Router) (Config-vrf-Red)#route-target import 192.168.10.1:10 (Router) (Config-vrf-Red)#route-target both 300:10 (Router) (Config-vrf-Red)#route-target export 88888:80 (Router) (Config-vrf-Red)#exit