Forum Discussion
Rick_Turner_771
Nimbostratus
Jul 02, 2010Same Segment Load Balancing
I have a new requirement to provide same segment load balancing. Up till now we've used the LTMs only for pass-thru load balancing. Basically client on VLAN1 to servers on VLAN2.
Now I have web servers that need access to application servers, both on VLAN2. Due to the asynchronous routing it doesn't work. I've figured out how to SNAT against a given virtual server to make this work.
As there are more and more requirements for this type of load balancing, I'd prefer to SNAT anything coming from VLAN2 destined to a pool on VLAN2. The catch is that I don't want to SNAT any traffic destined to VLAN3 from VLAN1 or VLAN2. Need to maintain addresses to avoid breaking firewall rules.
The following iRule works against an individual virtual server:
when LB_SELECTED { if {[IP::addr "[IP::client_addr]/24" equals "[LB::server addr]/24"]} { snatpool SNAT_POOT_LB1 } }
I tried to apply this to a wildcard_forwarding virtual, no go.
Any suggestions?
Thanks,
Rick
3 Replies
Sort By
- Rick_Turner_771
Nimbostratus
Thanks for the replies. I've had a couple conversations with my SE and he has encouraged us to perform the SNAT against a virtual server rather than all traffic like I was driving. There are pros and cons for both directions. The SE is conviced that this will be more difficult than SNAT against a virtual. He did come back with an iRule that SNATs to the virtual address rather than the SNATPOOL. I like this in that it virtually eliminates my concern to running out of ephemeral ports. This tested out nicely in my lab. - Chris_Miller
Altostratus
Posted By Rick Turner on 07/15/2010 02:20 PM - hoolio
Cirrostratus
Not sure how one monitors either situation to be proactive at measuring the ephemeral port usage.when LB_SELECTED { When a load balancing selection is made, check if the client IP is on the same /24 subnet as the selected server if { [IP::addr [IP::client_addr]/24 equals [LB::server addr]] } { Snat using the VS address snat [IP::local_addr] log local0. "SNATing client: [IP::client_addr] to VIP: [IP::local_addr] targeting pool IP: [LB::server addr]" } }
when LB_SELECTED { if { [IP::addr [IP::client_addr]/24 equals [LB::server addr]] } { log local0. "SNATing client: [IP::client_addr] to VIP's last octet:\ 1.2.3.[getfield [IP::local_addr] "." 4] targeting pool IP: [LB::server addr]" snat 1.2.3.[getfield [IP::local_addr] "." 4] } }
when LB_SELECTED { if { [IP::addr [IP::client_addr]/24 equals [LB::server addr]] } { Get the first three octets of the server IP address scan [LB::server add] {%d.%d.%d.%d} a b c d Snat using the first three octets of the server IP with the last octet of the VS IP snat $a.$b.$c.[getfield [IP::local_addr] "." 4] log local0. "SNATing client: [IP::client_addr] to VIP's last octet:\ $a.$b.$c.[getfield [IP::local_addr] "." 4] targeting pool IP: [LB::server addr]" } }
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