Forum Discussion
Mauricio_Cusine
Aug 22, 2007Nimbostratus
Validate IP address with regexp
Hello,
I am trying to check if a IP address is valid in the bigip with regexp (I don't know if anybody know other method).
The regexp is the follow but don't work. Anybody can help me?....
Mauricio_Cusine
Aug 22, 2007Nimbostratus
Hello Aaron,
Thanks very much for your answer.
When We applyed the Irule matched ip address out of range like as 400.400.400.400 and good ip address like as 100.100.100.100, but We don't receive any TCL error in /var/log/ltm.
So after saw you last comment We think that We are using bad the if with the regexp, what do you think this is the coded used.
One important note is that in the 4 octect Trash is added after the number for some motive, I suspect that for this reason don't work fine the regexp??.
Also We want to the regexp detect not only ip address out of range and also string, or other special caracter as a invalid ip address, We think the regexp does it.
King regards,
Mauricio
This is a code extract using the regexp
when CLIENT_DATA {
Capturamos la IP del Payload
set vacio " "
set IP ""
set LoginIP ""
set LoginIP "[findstr [TCP::payload] LOGIN-IP 10 MSISDN]"
log local0. "LoginIP= $LoginIP"
se verifica que el valor de LOGIN-IP es vacio
if {$LoginIP= ""}{
log local0. "Pool por defecto"
pool LDAP_IRULE_10}
else {
if { [regexp "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" $LoginIP]}{
log local0."evaluada regular expresion = $LoginIP"
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