Configure a VRF Target
Before JUNOS 5.5, you needed to configure VRF import and export policies for each VPN routing instance on a PE router. These policies control redistribution of routes between the VRF table and BGP.
In the current JUNOS release, the
vrf-targetstatement simplifies this configuration. Configuring a VRF target community using thevrf-targetstatement causes default VRF import and export policies to be generated that accept and tag routes with the specified target community. You can still create more complex policies by explicitly configuring VRF import and export policies. These policies override the default policies generated when you configure thevrf-targetstatement.If you do not configure the
importandexportoptions of thevrf-targetstatement, the specified community string is applied in both directions. Theimportandexportkeywords give you more flexibility, allowing you to specify a different community for each direction.An example of how you might configure the
vrf-targetstatement follows:[edit routing-instances sample]vrf-target target:69:102;The syntax for the VRF target community is not a name. You must specify it in the format
target:x:y. A community name cannot be specified because this would also require you to configure the community members for that community using thepolicy-optionsstatement. If you define thepolicy-optionsstatements, then you can just configure VRF import and export policies as usual. The purpose of thevrf-targetstatement is to simplify the configuration by allowing you to configure most statements at the[edit routing-instances]hierarchy level.To configure a VRF target, include the
vrf-targetstatement at the[edit routing-instancesrouting-instance-name]hierarchy level:[edit]routing-instances {routing-instance-name{vrf-targetcommunity;}}To configure the
vrf-targetstatement with theexportandimportoptions, include the following statements at the[edit routing-instancesrouting-instance-name]hierarchy level:[edit]routing-instances {routing-instance-name{vrf-target {exportcommunity-name;importcommunity-name;}}}