Skip to main content

Is there a way to get the pair of switches for the VRRP protocol using NQE?

Yes.  Lookup “FHRP” that is the generic name for First Hop Routing Protocol that encompasses VRRP.  It is next to IP address info under the Subintenface, RoutedVlan, and Bridge (think irb).

 

foreach device in network.devices
foreach interface in device.interfaces
foreach subinterface in interface.subinterfaces
let ipv4 = subinterface.ipv4
let fhrp = ipv4.fhrp
let vrrp = fhrp.vrrp
foreach fhrpGroup in vrrp.fhrpGroups
select {
deviceName: device.name,
interfaceName: interface.name,
subinterfaceName: subinterface.name,
fhrpGroupVirtualRouterId: fhrpGroup.virtualRouterId,
state: fhrpGroup.state,
virtualAddress: fhrpGroup.virtualAddress
}

I thought it actually listed the peer, but I think you match it by either the virtual address or the virtual address plus virtualRouterId.  I think that is groupId just kind of named differently.


Reply