export map
Use this command in VRF configuration mode to apply a route-map that controls which routes are exported from the VRF into the global routing table or into other VRFs. The route-map can filter routes using match clauses and modify BGP attributes using set clauses, enabling granular control over inter-VRF route export policies.
-
An export-map with a
permit route-mapthat containsno matchorset clausesfunctions as a permit-all. -
An export-map with a
deny route-mapthat containsno matchorset clausesfunctions as a deny-all.
Use the no parameter of this command to remove the applied route-map.
Command Syntax
export map WORD
no export map
Parameters
WORD
Specifies the name of the route-map to apply as the VRF export-map.
| • | match clauses filter the routes to export (for example, using prefix lists, community values, or AS path).
|
| • | set clauses adjust BGP attributes for exported routes (for example, route targets, local preference, AS path, MED). |
Default
If no export-map is configured, all eligible VRF routes are exported unmodified.
Command Mode
VRF mode
Applicability
Introduced in OcNOS version 4.1. OcNOS version 7.0.0 adds support for VRF-level BGP export-maps with route-map match and set clauses, enabling granular control of exported routes and attributes.
Examples
This example shows how to configure an export-map with a route-map that filters specific prefixes and modifies their BGP attributes before exporting them from the VRF.
| • | The VRF vrf1 is created, with route-distinguisher 1:1 and route-target 100:1. |
| • | The export map export-r1 is applied to control which routes vrf1 exports. |
| • | The prefix-list p1_ipv4 permits only 121.1.1.1/32. |
| • | The route-map export-r1 matches the permitted prefix and modifies its attributes by: |
| • | Setting local preference to 1000 |
| • | Setting BGP community to 650:650 |
| • | Adding extended communities (route-targets) 110:1 and 220:1 |
As a result, only the permitted prefix (121.1.1.1/32) is exported from vrf1 with the modified BGP attributes.
OcNOS(config)#ip vrf vrf1
OcNOS(config-vrf)#export map export-r1
OcNOS(config-vrf)#
Prefix-list Definition
OcNOS#show running-config prefix-list
!
ip prefix-list p1_ipv4
seq 5 permit 121.1.1.1/32
!
Route-map Definition
OcNOS#show running-config route-map
!
route-map export-r1 permit 10
match ip address prefix-list p1_ipv4
set local-preference 1000
set community 650:650
set extcommunity rt 110:1 220:1 additive
!
VRF Configuration
OcNOS#show running-config vrf
!
ip vrf management
!
ip vrf vrf1
rd 1:1
route-target both 100:1
export map export-r1
!
ip vrf vrf2
rd 2:2
route-target import 100:1
route-target both 200:1
!
BGP Configuration
OcNOS#show running-config bgp
!
router bgp 200
bgp auto-policy-soft-reset enable
neighbor 5.5.5.5 remote-as 200
neighbor 5.5.5.5 update-source lo
!
address-family vpnv4 unicast
neighbor 5.5.5.5 activate
exit-address-family
!
address-family ipv4 vrf vrf1
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 activate
neighbor 2.2.2.2 remote-as 300
neighbor 2.2.2.2 activate
exit-address-family
!
address-family ipv4 vrf vrf2
exit-address-family
!
exit
!