Forum Discussion
patrickmosca_12
Mar 23, 2006Historic F5 Account
Bastion Host/L3 L4 Proxy - Rewriting IP Address and Port
I am trying to write an iRule that rewrites the destination IP address and port. Is it possible to use the built-in [IP::local_addr] to do this, or will I have to actually search the IP and TCP headers and substitute there? Thanks.
3 Replies
- patrickmosca_12Historic F5 AccountI am trying to dynamically rewrite IP and port for all requests that go through a forwarding wildcard VIP.
Here is the flow:
1. Internal server sends a request out to a client.
2. Bigip intercepts requests and dynamically strips out dest ip and dest port and replaces with a new ip and port.
3.bigip gets the new ip and port by doing a lookup in an internal static table.
I am writing this from a blackberry so I can't give as much info in this post. - patrickmosca_12Historic F5 AccountYes, this might work, depending on the customer's requirements.
I could just predefine all the possible node (ip/port) permutations and then base the decision on the destination port.
Thanks!
By the way, is it possible to actually rewrite the IP address and port without using predefined nodes? I created a URI rewrite that works great:
when HTTP_REQUEST {
if { [HTTP::uri] == "/" } {
HTTP::uri "/dir1/dir2"
}
}
Here, HTTP::uri is used to rewrite the uri. I tried to do the same thing with IP::client_addr and I received error messages in the ltm log. - Colin_Walker_12Historic F5 AccountHTTP::uri allows you to both read and write the URI information, not all commands function this way. IP::client_addr is a read only command, which is why you were having problems.
-Colin
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