I need to force connection if the source address is ...

Sorry, for this question, because I’m sure it’s very simple, but it’s my first irule.

I need to force connections depending of source address,I’m checking with this irule.

when CLIENT_ACCEPTED {

if { [IP::[IP::remote_addr] equals 10.1.1.8] } {

pool DNI_POOL

} else {

pool GW_POOL

}

}

I’ve checking with the log irule:

when CLIENT_ACCEPTED {

log local0. “Ip origen: [IP::remote_addr]”

}

And it’s correct the return ip address.

But the result:

TCL error: Rule persist_source CLIENT_ACCEPTED - invalid command name IP::10.1.1.8 while executing IP::[IP::remote_addr] equals 10.1.1.8

Any suggestion, thanks

Hi Felipe,

That’s very close. Just change the first IP:: to IP::addr, like this:

when CLIENT_ACCEPTED {
   if { [IP::addr [IP::remote_addr] equals 10.1.1.8] } {
      pool DNI_POOL
   } else {
      pool GW_POOL
   }
}

See the wiki page on IP::addr for details:

Click here

Aaron