Forum Discussion
Miguel_Alfaro_6
Nimbostratus
Jun 14, 2008Irule to change dest IP and save the old one into the packet
Hi i'm new with irules and need to know if the following is possible
I need in to change a packet destination ip address to 172.16.49.70 and save the old ip "x.x.x.x" into any p...
Manuel_Gabaldon
Nimbostratus
Jun 16, 2008Hi!!
First of all, IP::remote_addr is a command, not a variable, so you can't change it this way. Secondly, it would return your client IP address (source), not the destination. You need to use the "pool" command in order to change the destination of the packet, with or without destination NAT.
when CLIENT_ACCEPTED {
set firstIP [IP::local_addr]
pool pool_172.16.49.70
}
I don´t think you can insert the old IP in the packet. If we're talking about HTTP, you could insert an HTTP header containing it, like an "X-forwarded-for" header
when HTTP_REQUEST {
HTTP::header First_IP [IP::local_addr]
pool pool_172.16.49.70
}
However, maybe it is a lot easier than you think. It seems that you need to reroute traffic through the second LTM, right? So you need to forward traffic to 172.16.49.70 and let this one make the routing decisions based on destination IP address.
Maybe you can make it by selecting this IP as the pool and disabling the destination NAT.
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