Assuming this is ONLY http traffic.
You can create a http router pool containing the addresses of 2 of gateway links on port 80 (i.e. gatewayip1:80 and gatewayip2:80)
Then you create a wildcard VIP listening on port 80 and add the http router pool with persistance and http profile. The VIP might need to have a specific setting for SNAT set to AUTOMAP
The VIP can contain the following iRule
when HTTP_REQUEST {
switch [HTTP::host] {
"*.edu" { node gatewayip1:80 }
"*.gov" { node gatewayip2:80 }
}
}
This accomplishes the traffic you want to push in relation to the http host header. If there is no match then, by default, it will participate in the load balancing method and choose the one gateway.
I am not sure if my example fits in your architecture so there might be tweaks but this is based on dirrecting HTTP traffic and I am making assumptions about your network.
Also there a configuration example on ask.f5.com
Click here that talks about directing traffic to 2 ISPs.
I hope this helps
CB