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 p...
Nat_Thirasuttakorn
Employee
Jun 17, 2008miguel_alfaro,
To change destination IP, you need to enable address translation in virtual configuration, assign pool or use node command in iRule. (I believe it is what hoolio and mgabaldon point out earlier.)
let say you use node command.
on sender side
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
set ww [scan [IP::local_addr] "%d.%d.%d.%d"]
set xx [binary format c4 $ww]
TCP::payload replace 0 0 $xx
node 172.16.49.70
TCP::release
}
on receiver LTM
when CLIENT_ACCEPTED {
TCP::colllect
}
when CLIENT_DATA {
binary scan [TCP::payload] a4 xx
set first_ip [IP::addr $xx mask 255.255.255.255]
node $first_ip
TCP::release
}
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