specific client network needs to be routed to only on of the two ISP

I am very new to IRule. I need assistance in setting I-Rule. It is impacting our production systems due to possible ISP related issue.

Here is what I am trying to accomplish:

I want to route specific client network to only one of our ISP all the time. I want to route that traffic only to other ISP in the event of the chosen ISP fails or runs into issues.

The ISP we want to point to is with 64.94.x.x, the ISP we don’t want to point to starts with 69.74.x.x. The client network is 65.199.x.x/28

We have gtm 9.3.1.

Here is the basic code I was provided by F5, I am sure it may need tweaking especilly the last part (lasthop).

!!!

when CLIENT_ACCEPTED {

Uncomment the log statement for debugging

log local0. “in CLIENT_ACCEPTED”

Substitute the “problem” IP address here V

if { [IP::addr [IP::client_addr] equals 1.1.1.1] } {

ISP gateway here V

lasthop 64.xx.xx.xx

}

}

!!!

here is the code with specific information:

when CLIENT_ACCEPTED {

Uncomment the log statement for debugging

log local0. “in CLIENT_ACCEPTED”

Substitute the “problem” IP address here V

if { [IP::addr [IP::65.199.152.34] equals 1.1.1.1] } {

ISP gateway here V

lasthop 64.94.182.241

}

}

Any help on this will greatly be appreciated.