loopback subnets bigger than /32
Find loopback interfaces assigned subnets bigger than /32
The following check iterates through all subinterfaces and filters the results to return loopback interfaces where the assigned IP subnet is bigger than a /32.
foreach device in network.devices
foreach iface in device.interfaces
where iface.loopbackMode
foreach subIface in iface.subinterfaces
foreach addr in subIface.ipv4.addresses
select {
deviceName: device.name,
ifaceName: iface.name,
subIfaceName: subIface.name,
ip: addr.ip,
prefixLength: addr.prefixLength,
violation: addr.prefixLength < 32
}