Hi Team ,
How can i get F5 VIP Ip and Pool address details by NQE.
Thanks
Rohit
Hi Team ,
How can i get F5 VIP Ip and Pool address details by NQE.
Thanks
Rohit
You can get it out of the data model. This is a Export version I wrote of this query because I was adding it to a much larger report. However, you can see that it uses the data model to get the information.
/**
* @intent Extract all NATs and VIPs.
* @description
* 1) NAT information from all the FWs rulres we see in the tool: Source ip, original destination ip, translated ip address, FW name, FW IP and MAC addresses used for the connection.
* 2) VIP information from all Load Balancers we see in the tool: Original VIP, All Destination IPs, LB name, LB IP and MAC address used for the connection.
*/
getIntVrf(device, ifaceList) =
foreach networkInstance in device.networkInstances
foreach interface in networkInstance.interfaces
let name = if isPresent(interface.subIfaceName)
then interface.subIfaceName
else interface.ifaceName
where name in ifaceList
select distinct networkInstance.name;
export vipIps(device: Device) =
foreach x in n1]
where device.platform.vendor not in nVendor.VERSA]
foreach natEntry in device.natEntries
where natEntry.natType == NatType.LB
let metadataMatches = natEntry.metadataMatches
let vrf = getIntVrf(device, metadataMatches.egressInterfaces)
foreach subnet in natEntry.headerMatches.ipv4Dst
where subnet != ipSubnet("0.0.0.0/0")
let address = address(subnet)
foreach rewrite in natEntry.rewrites
select {address: address, dstPool: rewrite.ipv4Dst, vrf};
// Begin Test NQE query
foreach device in network.devices
let output = vipIps(device)
foreach entry in output
select {
Device: device.name,
address: entry.address,
dstPool: (foreach x in entry.dstPool select x),
vrf: entry.vrf
}
Hi
unfortunately the Query i am not able to run , can you please check its working for you.
Thanks
Rohit
The parameter is a device name. you can enter the parameter using the parameter button that will be next to the executer button.
getIntVrf(device, ifaceList) =
foreach networkInstance in device.networkInstances
foreach interface in networkInstance.interfaces
let name = if isPresent(interface.subIfaceName)
then interface.subIfaceName
else interface.ifaceName
where name in ifaceList
select distinct networkInstance.name;
@query
vipIps(device: Device) =
foreach x in 1]
where device.platform.vendor not in Vendor.VERSA]
foreach natEntry in device.natEntries
where natEntry.natType == NatType.LB
let metadataMatches = natEntry.metadataMatches
let vrf = getIntVrf(device, metadataMatches.egressInterfaces)
foreach subnet in natEntry.headerMatches.ipv4Dst
where subnet != ipSubnet("0.0.0.0/0")
let address = address(subnet)
foreach rewrite in natEntry.rewrites
select {address: address, dstPool: rewrite.ipv4Dst, vrf};
is it possible to get the details without put parameter, in just single table form ?
/**
* @intent Extract all NATs and VIPs.
* @description
* 1) NAT information from all the FWs rulres we see in the tool: Source ip, original destination ip, translated ip address, FW name, FW IP and MAC addresses used for the connection.
* 2) VIP information from all Load Balancers we see in the tool: Original VIP, All Destination IPs, LB name, LB IP and MAC address used for the connection.
*/
getIntVrf(device, ifaceList) =
foreach networkInstance in device.networkInstances
foreach interface in networkInstance.interfaces
let name = if isPresent(interface.subIfaceName)
then interface.subIfaceName
else interface.ifaceName
where name in ifaceList
select distinct networkInstance.name;
// NQE query starts here
foreach device in network.devices
where device.platform.vendor not in nVendor.VERSA]
foreach natEntry in device.natEntries
where natEntry.natType == NatType.LB
let metadataMatches = natEntry.metadataMatches
let vrf = getIntVrf(device, metadataMatches.egressInterfaces)
foreach subnet in natEntry.headerMatches.ipv4Dst
where subnet != ipSubnet("0.0.0.0/0")
let address = address(subnet)
foreach rewrite in natEntry.rewrites
select { device: device.name, address: address, dstPool: rewrite.ipv4Dst, vrf }
Getting below error.
Address the following issues:
Hi
I packaged
Thanks,
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.