Forum Discussion
abachman_72712
Nimbostratus
Aug 03, 2009Filter by incoming IP address
I need to write an iRule for a pool that will direct traffic to the correct member by incoming IP address. The pool members are setup to push traffic to member on service port 9081.
(e.g). Traffic destined for IP address 10.10.10.20 will go to .20, but if .20 is down traffic will go to pool member 10.10.10.21 and vice versa. Traffic with IP header 10.10.10.21 will go to member .21, but if not available will go to .20.
I am sure this is a simple iRule, but my synax is terrible. Any help would be appreciated
pmanet
14 Replies
- hoolio
Cirrostratus
What is the purpose of having two virtual servers or two IP's to reference the two servers? Typically, you'd either want to talk to a single high availability IP address (load balanced) or one IP per server for maintenance or similar.
If this is SOAP over HTTP, I'm guessing you'll end up using a new IP for the virtual server and translate the destination IP address to the real server IP. If there is an IP address in the request and/or response payload that needs to be rewritten, you can do this using HTTP::collect (Click here). If the length of the IP address string in the request payload is the same as what you're replacing it with (length of 111.11.11.111 = length of 222.22.22.222), you could use a stream profile and STREAM::expression iRule (Click here) to rewrite the payload. A stream profile and iRule would buffer less payload and be more efficient than using HTTP::collect.
Aaron - abachman_72712
Nimbostratus
I think I forgot to mention that the VIP server IP address is a separate VLAN than the pool members, so I think that the IP conflict mentioned earlier will not be an issue.
VIP = 10.10.11.10
member = 10.10.10.20
member2=10.10.10.21 - abachman_72712
Nimbostratus
I will not need to rewrite the IP Address. The IP address in the payload will match the pool member that it originated from and we would like to push back to same member (service port 9081) if available. If that member is not available, then push that packet to the other member of the pool on service port 9081. - Ian_SmithRet. EmployeeIf what you are saying is that you have a SOAP message that contains an element which will tell you which pool member to send it to, then what you need to do is:
- search for that element using [XML::element]
- make a variable out of its value [set]
- then switch on that variable [switch]
- when you match it, you can use [active_members] to check if the pool member is available
- then write a session entry using [session] if you need to
- and direct the traffic to it using the member specification in [pool]
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
