This example demonstrates how to build a VXLAN EVPN fabric with Symmetric IRB and BGP Unnumbered by using OS10 roles for a leaf-spine fabric.
Home > Networking Solutions > Enterprise/Data Center Networking Solutions > SmartFabric OS10 Networking Solutions > Guides > Ansible for SmartFabric OS10 - Technical Note > Build a Layer 3 VXLAN EVPN fabric
This example demonstrates how to build a VXLAN EVPN fabric with Symmetric IRB and BGP Unnumbered by using OS10 roles for a leaf-spine fabric.
Create an inventory file with the IP addresses of the switches to be configured.
vim inventory.yaml
leaf1 ansible_host=192.168.1.213
ansible_network_os=dellemc.os10.os10
leaf2 ansible_host=192.168.1.214
ansible_network_os=dellemc.os10.os10
spine1 ansible_host=192.168.1.215 ansible_network_os=dellemc.os10.os10
spine2 ansible_host=192.168.1.216 ansible_network_os=dellemc_.os10.os10
[spine]
spine-1
spine-2
[leaf]
leaf-1
leaf-2
[datacenter:children]
spine
leaf
:wq
Create variable files for leaf1, leaf2, spine1, and spine2.
host_vars/leaf1.yaml
i
to edit the file, and then enter the following commands:
hostname: leaf1
os10_cfg_generate: True
build_dir: /home/labuser/config
ansible_ssh_user: admin
ansible_ssh_pass: admin
os10_system:
hostname: "Leaf1"
os10_interface:
loopback 0:
admin: up
ip_and_mask: 10.1.1.1/32
virtual-network 1002:
vrf: "TENANT1"
admin: up
ip_and_mask: "192.168.102.2/24"
virtual_gateway_ip: "192.168.102.1"
virtual-network 1006:
vrf: "TENANT1"
admin: up
ip_and_mask: "192.168.106.2/24"
virtual_gateway_ip: "192.168.106.1"
ethernet 1/1/1:
desc: "link to H1"
admin: up
portmode: trunk
ethernet 1/1/2:
desc: "link to SPINE1"
admin: up
switchport: False
mtu: 9216
suppress_ra: absent
min_ra: 3
max_ra: 4
ethernet 1/1/3:
desc: "link to SPINE2"
admin: up
switchport: False
mtu: 9216
suppress_ra: absent
min_ra: 3
max_ra: 4
ethernet 1/1/4:
desc: "link to H2"
admin: up
portmode: trunk
os10_vrf:
vrfdetails:
- vrf_name: "TENANT1"
state: "present"
os10_bgp:
asn: 65021
router_id: 100.1.1.1
ipv4_network:
- address: 10.1.1.1/32
state: present
neighbor:
- type: ipv4
interface: ethernet1/1/2
send_community:
- type: extended
state: present
address_family:
- type: "l2vpn"
activate: true
state: present
admin: up
state: present
- type: ipv4
interface: ethernet1/1/3
send_community:
- type: extended
state: present
address_family:
- type: "l2vpn"
activate: true
state: present
admin: up
state: present
state: present
os10_vxlan:
anycast_gateway_mac: "00:01:01:01:01:01"
nve:
source_interface: 0
state: "present"
evpn:
autoevi: True
rmac: 00:00:01:02:03:04
vrf:
- name: "TENANT1"
vni: 3000
route_target:
- type: "manual"
asn_value: "3000:3000"
route_target_type: "both"
state: "present"
virtual_network:
virtual_net:
- id: 1002
member_interface:
- ifname: "ethernet 1/1/1"
type: "tagged"
vlanid: 102
state: "present"
vxlan_vni:
id: 1002
state: "present"
state: "present"
- id: 1006
member_interface:
- ifname: "ethernet 1/1/4"
type: "tagged"
vlanid: 106
state: "present"
vxlan_vni:
id: 1006
state: "present"
state: "present"
vim host_vars/ leaf2.yaml
i
to edit the file, and then enter the following commands:
hostname: leaf2
os10_cfg_generate: True
build_dir: /home/labuser/config
ansible_ssh_user: admin
ansible_ssh_pass: admin
os10_system:
hostname: "Leaf2"
os10_interface:
loopback 0:
admin: up
ip_and_mask: 10.2.1.1/32
virtual-network 1008:
vrf: "TENANT1"
admin: up
ip_and_mask: "192.168.108.2/24"
virtual_gateway_ip: "192.168.108.1"
ethernet 1/1/1:
desc: "link to H3"
admin: up
portmode: trunk
ethernet 1/1/2:
desc: "link to SPINE1"
admin: up
switchport: False
mtu: 9216
suppress_ra: absent
min_ra: 3
max_ra: 4
ethernet 1/1/3:
desc: "link to SPINE2"
admin: up
switchport: False
mtu: 9216
suppress_ra: absent
min_ra: 3
max_ra: 4
ethernet 1/1/4:
desc: "link to ext-router"
switchport: False
vrf: "TENANT1"
admin: up
ip_and_mask: 172.16.1.2/24
os10_vrf:
vrfdetails:
- vrf_name: "TENANT1"
state: "present"
os10_bgp:
asn: 65023
router_id: 100.1.1.1
ipv4_network:
- address: 10.2.1.1/32
state: present
neighbor:
- type: ipv4
interface: ethernet1/1/2
send_community:
- type: extended
state: present
address_family:
- type: "l2vpn"
activate: true
state: present
admin: up
state: present
- type: ipv4
interface: ethernet1/1/3
send_community:
- type: extended
state: present
address_family:
- type: "l2vpn"
activate: true
state: present
admin: up
state: present
vrf:
name: "TENANT1"
address_family:
type: "ipv4"
redistribute:
- route_type: "l2vpn"
address_type: ipv4
state: present
neighbor:
- type: ipv4
ip: "172.16.1.1"
remote_asn: 65400
state: present
admin: up
os10_vxlan:
anycast_gateway_mac: "00:01:01:01:01:01"
nve:
source_interface: 0
state: "present"
evpn:
autoevi: True
rmac: 00:00:01:02:03:05
vrf:
- name: "TENANT1"
vni: 3000
adv_ipv4:
- type: "bgp"
state: "present"
route_target:
- type: "manual"
asn_value: "3000:3000"
route_target_type: "both"
state: "present"
virtual_network:
virtual_net:
- id: 1008
member_interface:
- ifname: "ethernet 1/1/1"
type: "tagged"
vlanid: 108
state: "present"
vxlan_vni:
id: 1008
state: "present"
state: "present"
vim host_vars/spine1.yaml
i
to edit the file, and then enter the following commands:
hostname: spine1
os10_cfg_generate: True
build_dir: /home/labuser/config
ansible_ssh_user: admin
ansible_ssh_pass: admin
os10_system:
hostname: "Spine1"
os10_interface:
loopback 1:
admin: up
ip_and_mask: 10.3.1.1/32
ethernet 1/1/2:
desc: "link to Leaf1"
admin: up
switchport: False
mtu: 9216
suppress_ra: absent
min_ra: 3
max_ra: 4
ethernet 1/1/3:
desc: "link to Leaf2"
admin: up
switchport: False
mtu: 9216
suppress_ra: absent
min_ra: 3
max_ra: 4
os10_bgp:
asn: 65022
router_id: 100.3.1.1
ipv4_network:
- address: 10.3.1.1/32
state: present
neighbor:
- type: "peergroup"
name: "ebgp_session"
send_community:
- type: extended
state: present
address_family:
- type: "l2vpn"
activate: true
state: present
state: present
- type: ipv4
interface: ethernet1/1/2
peergroup: ebgp_session
peergroup_type: ebgp
admin: up
state: present
- type: ipv4
interface: ethernet1/1/3
peergroup: ebgp_session
peergroup_type: ebgp
admin: up
state: present
state: present
vim host_vars/spine2.yaml
i
to edit the file, and then enter the following commands:
hostname: spine2
os10_cfg_generate: True
build_dir: /home/labuser/config
ansible_ssh_user: admin
ansible_ssh_pass: admin
os10_system:
hostname: "Spine2"
os10_interface:
loopback 1:
admin: up
ip_and_mask: 10.4.1.1/32
ethernet 1/1/2:
desc: "link to Leaf1"
admin: up
switchport: False
mtu: 9216
suppress_ra: absent
min_ra: 3
max_ra: 4
ethernet 1/1/3:
desc: "link to Leaf2"
admin: up
switchport: False
mtu: 9216
suppress_ra: absent
min_ra: 3
max_ra: 4
os10_bgp:
asn: 65024
router_id: 100.4.1.1
ipv4_network:
- address: 10.4.1.1/32
state: present
neighbor:
- type: "peergroup"
name: "ebgp_session"
send_community:
- type: extended
state: present
address_family:
- type: "l2vpn"
activate: true
state: present
state: present
- type: ipv4
interface: ethernet1/1/2
peergroup: ebgp_session
peergroup_type: ebgp
admin: up
state: present
- type: ipv4
interface: ethernet1/1/3
peergroup: ebgp_session
peergroup_type: ebgp
admin: up
state: present
state: present
Create and run an Ansible playbook for the VXLAN EVPN fabric.
vim vxlan.yaml
i
to edit the file, and then enter the following commands:
hosts: datacenter
connection: network_cli
collections:
- dellemc.os10
roles:
- os10_system
- os10_vrf
- os10_interface
- os10_bgp
- os10_vxlan
ansible-playbook -i inventory.yaml vxlan.yaml