IP range matcher plugin

farhanromli
Level 3
IP range matcher plugin

Is it possible to use variable in the IP range plugin?

I am getting an error when I am trying to do so (Refer attached)

I need to compare individual ip address against a long list of IP range so I was thinking of capturing the list in a variable and pass through the variable in the step but the step does not seem to work with variable

 

 

Operating system used: Windows 10

0 Kudos
3 Replies
Turribeach

On a formula processor you would add a variable using variables["my_var"]. However this is a plugin so this would only work if the plugin supports it which in this case it doesn't. So you would either need to modify the plugin or move to a Python recipe and use the built-in ipaddress IPv4/IPv6 manipulation library:

Capture.PNG

 

0 Kudos
farhanromli
Level 3
Author

I see, so not all plugin support variables. Thanks for the info.

Currently, I would need to check against a range in the format of "IPa-IPx" such as '10.0.0.1-10.0.0.2' but the ipaddress module can only be used for CIDR. I am looking into using socket and struct library to convert the ip into integers and compare them

0 Kudos
Turribeach

You can convert any IP Range to CIDR, just use any of the free websites around: 

https://www.ipaddressguide.com/cidr

CIDR is the standard way to specify IP ranges. 

0 Kudos