Forum Discussion
iRule for Outbound Pool ISP based Load Balancing
I would not use an iRule at all. It seems unnecessary. Try to take advantage of Source IP field in the Virtual Server configuration settings.
- First, create a working configuration for one ISP, refrain from using any iRules and stick to Virtual Server settings (SNAT pool, Default Pool) . Observing that you have a large number of data groups to compare against (ISP2), it might be best to create that default configuration for ISP2 users. (IP Source setting: 0.0.0.0/0)
- Create a second Virtual Server with the same Destination IP but different Source IP to cover for ISP1 users. Create more Virtual Servers as needed if you have more than one Source IP subnets to compare against. (IP Source setting: yourSubnet1, yourSubnet2...)
Incoming connections will be matched based on the closest-match logic. So if there's a better match to client's IP address than 0.0.0.0/0, a dedicated VS for ISP1 user will get the connection.
Using SelfIPs for every ISP wouldn't be sufficient to dynamically flip the nexthop's (aka. the different ISPs Gateways) accordingly to which Virtual Server or SNAT IP was choosen. This would require either certains PBRs (Policy Based Routings) in front of the F5, independent Route-Domains with unique Routing-Tables at the F5 level or an rather simple iRule using the [nexthop] command to dynamically flip beween the ISPs Gateways...
Cheers, Kai
Recent Discussions
Related Content
* 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