Skip to content

VRF

The VRF configuration section of the Data Model defines how to create VRFs and update supported VRF parameters.

After a VRF is created, name (the data model key used to identify the VRF) and vrf_id (L3 VNI / VNI) cannot be updated. If either value needs to change, delete and recreate the VRF.

This does not prevent updates to supported switch-facing values such as VLAN ID, vrf_vlan_name, vrf_description, VRF interface description (vrf_intf_desc), MTU, route maps, or other routing parameters.

Diagram
NameTypeConstraintMandatoryDefault Value
vrfsList[vrfs]No
vrf_attach_groupsList[vrf_attach_groups]No

NameTypeConstraintMandatoryDefault Value
nameStringYes
vrf_idIntegermin: 1, max: 16777214No
vlan_idIntegermin: 1, max: 4094No
vrf_vlan_nameStringNo
vrf_intf_descStringNoConfigured by Ansible NetAsCode
vrf_descriptionStringNoConfigured by Ansible NetAsCode
vrf_int_mtuIntegermin: 1500, max: 9216No9216
loopback_route_tagIntegermin: 0, max: 4294967295No12345
max_bgp_pathsIntegermin: 1, max: 128No1
max_ibgp_pathsIntegermin: 1, max: 128No2
ipv6_linklocal_enableBooleantrue, falseNotrue
adv_host_routesBooleantrue, falseNofalse
adv_default_routesBooleantrue, falseNotrue
static_default_routeBooleantrue, falseNotrue
bgp_passwordStringNo
bgp_password_encryption_typeChoice3, 7No
disable_rt_autoBooleantrue, falseNofalse
export_evpn_rtStringNo
export_mvpn_rtStringNo
export_vpn_rtStringNo
import_evpn_rtStringNo
import_mvpn_rtStringNo
import_vpn_rtStringNo
netflow_enableBooleantrue, falseNofalse
netflow_monitorStringNo
no_rpBooleantrue, falseNofalse
overlay_multicast_groupStringNo
redist_direct_routemapStringNoFABRIC-RMAP-REDIST-SUBNET
ipv6_redist_direct_routemapStringNoFABRIC-RMAP-REDIST-SUBNET
rp_addressIPNo
rp_externalBooleantrue, falseNofalse
rp_loopback_idIntegermin: 0, max: 1023No
trm_enableBooleantrue, falseNofalse
trm_bgw_msiteBooleantrue, falseNofalse
enable_l3_vni_no_vlanBooleantrue, falseNo
underlay_mcast_ipIPNo
vrf_attach_groupStringNo

NameTypeConstraintMandatoryDefault Value
nameStringYes
switchesList[switches]No

switches (vxlan.overlay.vrf_attach_groups)

Section titled “switches (vxlan.overlay.vrf_attach_groups)”
NameTypeConstraintMandatoryDefault Value
hostnameStringYes
loopback_idIntegermin: 0, max: 1023No
loopback_ipv4IPNo
loopback_ipv6IPNo
freeform_configStringNo

vxlan:
overlay:
vrfs:
# simple example
- name: NetAsCodeVrf1
vrf_id: 150001
vlan_id: 2001
vrf_attach_group: all_leaf
# full example
- name: NetAsCodeVrf2
vrf_id: 150002
vlan_id: 2002
vrf_vlan_name: NetAsCodeVrf2
vrf_intf_desc: NetAsCodeVrf2
vrf_description: NetAsCodeVrf2
vrf_int_mtu: 9216
loopback_route_tag: 12345
max_bgp_paths: 4
max_ibgp_paths: 16
ipv6_linklocal_enable: true
adv_host_routes: false
adv_default_routes: true
static_default_route: false
bgp_password: 014903c077689077e5b4548432c3d91d
bgp_password_encryption_type: 3
disable_rt_auto: true
export_evpn_rt: 655000:15002
export_mvpn_rt: 655000:15002
export_vpn_rt: 655000:15002
import_evpn_rt: 655000:15001
import_mvpn_rt: 655000:15001
import_vpn_rt: 655000:15001
netflow_enable: true
netflow_monitor: test
no_rp: false
overlay_multicast_group: 239.10.10.1
redist_direct_routemap: fabric-rmap-redist-subnet
trm_enable: true
rp_address: 224.10.12.123
rp_external: true
rp_loopback_id: 10
trm_bgw_msite: false
underlay_mcast_ip: 239.1.1.1
vrf_attach_group: all_leaf
vrf_attach_groups:
- name: all_leaf
switches:
- hostname: dc1-leaf1
- hostname: dc1-leaf2
- name: leaf1
switches:
- hostname: dc1-leaf1
- name: leaf2
switches:
- hostname: dc1-leaf2

Enabling Removal Operations (using Ansible)

Section titled “Enabling Removal Operations (using Ansible)”

By default, VRF removal is disabled for safety. To enable automatic removal:

vrf_delete_mode: true
Diagram
NameTypeConstraintMandatoryDefault Value
vrfsList[vrfs]No
vrf_attach_groupsList[vrf_attach_groups]No

NameTypeConstraintMandatoryDefault Value
nameStringYes
vrf_idIntegermin: 1, max: 16777214No
vlan_idIntegermin: 1, max: 4094No
vrf_vlan_nameStringNo
vrf_intf_descStringNoConfigured by Ansible NetAsCode
vrf_descriptionStringNoConfigured by Ansible NetAsCode
vrf_int_mtuIntegermin: 1500, max: 9216No9216
loopback_route_tagIntegermin: 0, max: 4294967295No12345
max_bgp_pathsIntegermin: 1, max: 128No1
max_ibgp_pathsIntegermin: 1, max: 128No2
ipv6_linklocal_enableBooleantrue, falseNotrue
adv_host_routesBooleantrue, falseNofalse
adv_default_routesBooleantrue, falseNotrue
static_default_routeBooleantrue, falseNotrue
bgp_passwordStringNo
bgp_password_encryption_typeChoice3, 7No
disable_rt_autoBooleantrue, falseNofalse
export_evpn_rtStringNo
export_mvpn_rtStringNo
export_vpn_rtStringNo
import_evpn_rtStringNo
import_mvpn_rtStringNo
import_vpn_rtStringNo
netflow_enableBooleantrue, falseNofalse
netflow_monitorStringNo
no_rpBooleantrue, falseNofalse
overlay_multicast_groupStringNo
redist_direct_routemapStringNoFABRIC-RMAP-REDIST-SUBNET
ipv6_redist_direct_routemapStringNoFABRIC-RMAP-REDIST-SUBNET
rp_addressIPNo
rp_externalBooleantrue, falseNofalse
rp_loopback_idIntegermin: 0, max: 1023No
trm_enableBooleantrue, falseNofalse
trm_bgw_msiteBooleantrue, falseNofalse
enable_l3_vni_no_vlanBooleantrue, falseNo
underlay_mcast_ipIPNo
vrf_attach_groupStringNo

NameTypeConstraintMandatoryDefault Value
nameStringYes
switchesList[switches]No

switches (vxlan.overlay.vrf_attach_groups)

Section titled “switches (vxlan.overlay.vrf_attach_groups)”
NameTypeConstraintMandatoryDefault Value
hostnameStringYes
loopback_idIntegermin: 0, max: 1023No
loopback_ipv4IPNo
loopback_ipv6IPNo
freeform_configStringNo

vxlan:
overlay:
vrfs:
# simple example
- name: NetAsCodeVrf1
vrf_id: 150001
vlan_id: 2001
vrf_attach_group: all_leaf
# full example
- name: NetAsCodeVrf2
vrf_id: 150002
vlan_id: 2002
vrf_vlan_name: NetAsCodeVrf2
vrf_intf_desc: NetAsCodeVrf2
vrf_description: NetAsCodeVrf2
vrf_int_mtu: 9216
loopback_route_tag: 12345
max_bgp_paths: 4
max_ibgp_paths: 16
ipv6_linklocal_enable: true
adv_host_routes: false
adv_default_routes: true
static_default_route: false
bgp_password: 014903c077689077e5b4548432c3d91d
bgp_password_encryption_type: 3
disable_rt_auto: true
export_evpn_rt: 655000:15002
export_mvpn_rt: 655000:15002
export_vpn_rt: 655000:15002
import_evpn_rt: 655000:15001
import_mvpn_rt: 655000:15001
import_vpn_rt: 655000:15001
netflow_enable: true
netflow_monitor: test
no_rp: false
overlay_multicast_group: 239.10.10.1
redist_direct_routemap: fabric-rmap-redist-subnet
trm_enable: true
rp_address: 224.10.12.123
rp_external: true
rp_loopback_id: 10
trm_bgw_msite: false
underlay_mcast_ip: 239.1.1.1
vrf_attach_group: all_leaf
vrf_attach_groups:
- name: all_leaf
switches:
- hostname: dc1-leaf1
- hostname: dc1-leaf2
- name: leaf1
switches:
- hostname: dc1-leaf1
- name: leaf2
switches:
- hostname: dc1-leaf2