Skip to main content

Arista VXLAN Configuration Sanity Check

  • January 5, 2026
  • 2 replies
  • 55 views

Forum|alt.badge.img+1

Using the “show vxlan config-sanity detail” command as a custom command we have a built a query that enables you to verify your vxlan configuration based on the “Result” field being anything other than “OK”, if you wish to accept warnings then simply adjust the relevant if statement in the “AristaVxLanSanity” section of this script.

/**
* @intent Report on the Sanity of VXLAN configuration
* @description Using the AristaVxlanSanity module of the Arista Library we will report any vxlan
* configuration failures by category per device using the default assumptions of the Module
* from the library
*/

AristaVxlanSanity(device: Device) =
foreach command in device.outputs.commands
where command.commandText == "show vxlan config-sanity detail" //Retrieve only the command show vxlan config-sanity detail
let deviceName = device.name
let vxlanResponse = command.response
let parsed = parseConfigBlocks(OS.UNKNOWN, vxlanResponse)
foreach line in parsed
foreach child in line.children
// Ignore the line with all dashes (-)
where !matches(child.text,"*----*")
// Ignore Header Line
where !matches(child.text,"Category ")

// extract category which is the first column and is 35 characters
let maxLength = length(child.text)
let start = 0
let end = 33
let categoryName = substring(child.text,start,end)
// extract Result which is the second column and 8 Characters
let start = end // Add 1 for space between column
let fieldEnd = start + 8
let end = if fieldEnd > maxLength then maxLength else fieldEnd
let rawState = substring(child.text,start,end) // We need the full state with spaces first
let state = replace(rawState," ","")
let result = if state == "OK" then true else false
// Retrieve the detail
let start = end + 1

let detail = if maxLength >= start then substring(child.text,start,maxLength) else ""
let returnData = {deviceName,categoryName,state,detail,result}
select(returnData);

foreach device in network.devices

where device.platform.os == OS.ARISTA_EOS
// Retrieve vxlan Sanity from Arista Library.
let vxlanState = AristaVxlanSanity(device)

//Cycle through list provided.
foreach response in vxlanState
let deviceName = response.deviceName
let vxlanCategory = response.categoryName
let vxlanState = response.state
let vxlanResult = response.result
let vxlanDetail = response.detail
/* Due to the way we split the rows of the output check to see if "VLAN-VNI Map" and "Flood List" is present so we can
verify if present to check for no active VXLAN configuration on a switch.
*/
let vlanVniMapPresent = patternMatch(vxlanCategory,`VLAN-VNI Map`)
let floodListPresent = patternMatch(vxlanCategory,`Flood List`)
let VNIMapNotConfigured = if isPresent(vlanVniMapPresent) && vxlanState == "FAIL" && vxlanDetail == "No VLAN-VNI mapping in Vxlan1"
then true
else false
let NoVlansInVxlan = if isPresent(floodListPresent) && vxlanState == "FAIL" && vxlanDetail == "No VXLAN VLANs in Vxlan1"
then true
else false
/* We set the violation to include if vxlan result is false which is a result of the State not being OK along with
identifying that VLAN-VNI Map has the error "No VLAN-VNI mapping in Vxlan1" and the FLood list has the error
"No VXLAN VLANs in Vxlan1" This must be an and and not or to avoid issues where a misconfiguration may occur
in one of the fields on its own.
*/
select {
Device:deviceName,
Category:vxlanCategory,
State:vxlanState,
Details:vxlanDetail,
violation: !vxlanResult && !VNIMapNotConfigured && !NoVlansInVxlan
}

Where we pre configure a loopback ready for deploying vxlan configuration simply via CVAAS as part of the standard build we have to ignore the errors for “Flood-List” and “VLAN-VNI Map” if they both FAIL with “No VXLAN Vlans in Vxlan1” and “No VLAN-VNI mapping in Vxlan1” respectively, if you do not need these checks then remove the following:

  let vlanVniMapPresent = patternMatch(vxlanCategory,`VLAN-VNI Map`)

  let floodListPresent = patternMatch(vxlanCategory,`Flood List`)

  let VNIMapNotConfigured = if isPresent(vlanVniMapPresent) && vxlanState == "FAIL" && vxlanDetail == "No VLAN-VNI mapping in Vxlan1"

                            then true

                            else false

  let NoVlansInVxlan = if isPresent(floodListPresent) && vxlanState == "FAIL" && vxlanDetail == "No VXLAN VLANs in Vxlan1"

                            then true

                            else false

Hope you find this useful.

 

Note: The description references a library I am trying to build an Arista specific library within our set up so that if the data may be used in more than one query it can just be reused for the purposes of this query I have included it as a separate section within the query.

2 replies

rob
Employee
  • Employee
  • January 6, 2026

@SteveBamford  This is really nice work! 😀 


Forum|alt.badge.img+1
  • Author
  • Spotter
  • January 7, 2026

@SteveBamford  This is really nice work! 😀 

Thanks Rob, and thanks for your work on the BFD Query, I took some of the learnings from that one to apply here 😀