Forum Discussion
Miguel_Alfaro_6
Nimbostratus
Jun 15, 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 place in a packet.
something like this:
when CLIENT_ACCEPTED {
set firstIP [IP::remote_addr]
set secondIP "172.16.49.70"
[IP::remote_addr] replace [IP::remote_addr] $secondIP
here i need to save "firstIP" into the packet
}
And in a second ltm another irule that raplace the remote address with the one into the packet.
when CLIENT_ACCEPTED {
here I need look into the packet and find "firstIP"
[IP::remote_addr] replace [IP::remote_addr] $firstIP
}
it is that possible?
how close i am?
6 Replies
- hoolio
Cirrostratus
If you want to perform destination address translation, you can enable address translation on the VIP. LTM will then translate the destination address to the selected pool member's IP address. If you want to do this dynamically in an iRule, you can use the node command (Click here). LTM will undo the translation for responses back to the client using its connection table to track the original IP address. - Manuel_Gabaldon
Nimbostratus
Hi!! - Miguel_Alfaro_6
Nimbostratus
sorry, the diagram doesn't looks the way i want, i will attach a file with the correct diagram - Nat_Thirasuttakorn
Employee
miguel_alfaro, - Miguel_Alfaro_6
Nimbostratus
natty77, - Miguel_Alfaro_6
Nimbostratus
sorry natty77, now I understand your code said, I will try it.
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