Forum Discussion
dragonflymr
Cirrostratus
Dec 07, 2015Parsing IP to extract subnet
Hi,
I wonder if there is more elegant and fastest way to extract specific part of IP - like get only part of IP up to second dot, third dot.
I know that I can use scan to separate IP in fou...
VernonWells
Employee
Dec 07, 2015That depends somewhat on what you intend to do with the information. For example, if you want to choose a conditional branch based on subnet, you can do something like this:
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals "192.168.0.0/16" } {
pool pool-internal
}
}
If you're simply trying to extract dotted-quad octets, then
scan is probably as good an approach as any.dragonflymr
Cirrostratus
Dec 08, 2015Thanks, not exactly what I am looking for - as I wrote below - my fault, I was not precise enough.
Piotr
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects