Forum Discussion
Bciesz_171056
Feb 24, 2017Cirrus
Choose SNAT based on URL in HTTP_REQUEST
Hi,
Due to lack of external IPs I have two URLs that are resolved to a single IP. This IP is further NATTED to an internal IP in my network (the one of a VS on F5). Based on URL in HTTP_REQUEST an i...
Samir_Jha_52506
Feb 24, 2017Noctilucent
I believe, we can set SANT based on every condition. can you please try in stage environment or non prod hour with these irule & let us know if any help require.
Option 1.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"*.url1.com*"{
snat 10.0.0.60
node 10.0.0.83 80
log local0 "Redirected to live pool [HTTP::host]"
}
"*.url2.com*"{
snat 10.0.0.52
node 10.0.0.41 80
log local0 "Redirected to live pool [HTTP::host]"
}
}
}
Option 2. Create two different pool & add nodes as per below details & try
Pool A Member: 10.0.0.83 80
Pool B Member: 10.0.0.41 80
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"*.url1.com*"{
snat 10.0.0.60
pool A
log local0 "Redirected to live pool [HTTP::host]"
}
"*.url2.com*"{
snat 10.0.0.52
pool B
log local0 "Redirected to live pool [HTTP::host]"
}
}
}
- Bciesz_171056Feb 24, 2017Cirrus
I tried that. And I even caught the packets going out from 10.0.0.60.
However the problem is no one is listening on 10.0.0.60 for returning traffic...
- Samir_Jha_52506Feb 24, 2017Noctilucent
Please try the option 2.
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