Forum Discussion
monica_74227
Nimbostratus
Oct 21, 2009Loadbalancing Traffic for Outbound
Hey gus,
I want to know if we could use Ratio method for the outbound traffic with LC. If we can, How to set up and how to define the iRule.
I guess we may define the two links in the default_gateway_pool, and use the ratio method in the pool.
thank you for your help!!!
- hoolio
Cirrostratus
Hi Monica, - monica_74227
Nimbostratus
okay, thank you for your quickl reply.however maybe I need to use irule to do something else, just like the following: - hoolio
Cirrostratus
Okay, so you have an iRule to select the pool and apply SNAT based on the destination and source IP addresses. Does it work for your requirements? If not, can you add logging to the iRule to see what code is being executed? - monica_74227
Nimbostratus
hey Aaron, well, that is just my think, i don't know if it could work well. I will set up a test environment to check. - hoolio
Cirrostratus
Which version of software are you running? The syntax for matchclass has changed slightly in v10 versus v9. I'll post an example iRule after getting the version. - monica_74227
Nimbostratus
hey Aaron, the version of software is V9.4.8, thank you for your help! - hoolio
Cirrostratus
Can you give this a try? The only significant changes I made were to remove the IP::addr command from the switch statement and add logging. I also remove the $:: prefix from the class names to make the iRule CMP compatible. For more info on this, you can check this CMP page (Click here).when CLIENT_ACCEPTED { log local0. "[IP::client_addr]:[TCP::client_port]: New connection to [IP::local_addr]:[TCP::local_port]" Check if client IP is in the cns_class if {[matchclass [IP::local_addr] equals cnc_class]}{ pool cnc_ratio_pool log local0. "[IP::client_addr]:[TCP::client_port]: Matched client to cnc_class" Check if destination IP is in the ct_class } elseif {[matchclass [IP::local_addr] equals ct_class]}{ pool ct_ratio_pool log local0. "[IP::client_addr]:[TCP::client_port]: Matched destination to ct_class" } else { pool cnc_ratio_pool log local0. "[IP::client_addr]:[TCP::client_port]: Default case." } } when LB_SELECTED { Check if client is 172.16.3.0/24 if {[IP::addr [IP::client_addr]/24 equals 172.16.3.0]}{ log local0. "[IP::client_addr]:[TCP::client_port]: Matched client check for 172.16.3.0/24" Check selected pool member IP switch {[LB::server addr]}{ "221.218.248.145" { snatpool snat_ct_mail log local0. "[IP::client_addr]:[TCP::client_port]: Matched destination IP 221.218.248.145. Snatting using snat_ct_mail" } "222.35.42.97" { snatpool snat_cnc_mail log local0. "[IP::client_addr]:[TCP::client_port]: Matched destination IP 221.218.248.145. Snatting using snat_cnc_mail" } } } else { snat $snat_cnc_default log local0. "[IP::client_addr]:[TCP::client_port]: Didn't match client check for 172.16.3.0/24. Snatting using snat_cnc_mail" } }
- monica_74227
Nimbostratus
okay, thank you very much! I am going to try. - monica_74227
Nimbostratus
hey Aaron, - hoolio
Cirrostratus
You can set costs on the links to get a ratio effect. You can check the LC config guide for your version to get more details on configuring this:
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