Forum Discussion
chris_16019
Nimbostratus
Dec 01, 2008iRule & SNAT
Hi - I was hoping someone may be able to offer some assistance or point me at a URL that will help with some configuration work that is required.
Background - I have a backend server that has multiple IP addresses for SSL certificate purposes. I have added a new virtual server address that points to the backend server, however I am unable to add a SNAT for outgoing traffic to be hidden behind this virtual server address as the real address of the server already exists in the address pool of a different virtual server SNAT.
A pool is no good as I need a different SNAT for different website communications from the same server. So I'm thinking I need to use an iRule to change the SNAT based on a unique characteristic within the packet, something like the URL. However after a few hours searching the only previous examples I can find all relate to IP addresses. Is it a case of amending something like the below to have URL instead of IP address within the text, and if so is anyone able to offer some syntax assistance.
when CLIENT_ACCEPTED { if { [IP::addr [IP::local_addr] equals "A.A.A.A"] } {
use snat Z.Z.Z.Z
} elsif { [IP::addr [IP::local_addr] equals "B.B.B.B"] } {
use snat Y.Y.Y.Y
} else { use snat X.X.X.X
}
Many thanks.
Chris
- naladar_65658
Altostratus
I am far from being an expert on such things... that being said. You might try just turning on some logging and then throw some traffic at it. That way you can see if it is even being executed. - chris_16019
Nimbostratus
The SSL is offloaded to the F5, and it's client SSL so is unencrypted on the server side. - dennypayne
Employee
[HTTP::host] is only valid within an HTTP_REQUEST event. If your virtual server does not have an http profile attached you will not be able to use any HTTP iRule events. So you first need to replace CLIENT_ACCEPTED with HTTP_REQUEST and then make sure your vip has an http profile. Not sure if 'use snat' is correct either, I think it's just 'snat x.x.x.x'.
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