Forum Discussion
khumfleet
Nimbostratus
Feb 21, 2012Stuck...Simple iRule? Not sure...req for Help
We are trying to use our LTM to route medical imaging (also known as DICOM) traffic to from our clients to one of two medical imaging archives (also known as a PACS) at our headquarters.
A little background on DICOM communication- to send a DICOM image to a PACS you need 3 things. An IP address, port number, and “Application Entity Title” (AKA- AE Title). Think of the AE Title as a host name for the PACS. The AE Title on the PACS must be unique to that network.
Our environment- Primary PACS communication happens on 192.168.1.10, port 12001, AE Title PACS_01. Backup PACS communication happens on 192.168.1.20 port 12001, AE Title PACS_02. We would like to have our clients point their systems to a VIP on the LTM so at the flip of a switch, route traffic to the backup PACS. The problem is, the AE Title. The backup PACS will refuse any traffic with an AE Title of PACS_01.
If we could have all of our clients point to VIP 192.168.1.15, Port 12001, AE Title INBOUND, we could modify the AE Title with an iRule, depending on which PACS we are routing to.
I have done some tcp captures and found the packet that the AE Title is contained in, however I am not sure how to code the iRule to do the TCP:payload replace. I was passed an example of the syntax that might help, but as I am a iRule Noob, I am having a hard time. Any help would be greatly appreciated.
Here is the code that I have:
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
TCP::payload replace [lindex OLDTITLE 0] 8 NEWTITLE
TCP::release
}
}
13 Replies
- nitass
Employee
what about something like this?
config root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar ltm virtual bar { destination 172.28.24.10:80 ip-protocol tcp mask 255.255.255.255 pool foo profiles { tcp { } } rules { myrule } source 0.0.0.0/0 source-address-translation { type automap } vs-index 2 } root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm pool foo ltm pool foo { members { 200.200.200.101:80 { address 200.200.200.101 } 200.200.200.111:80 { address 200.200.200.111 } } } root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule myrule ltm rule myrule { when CLIENT_DATA { if { [TCP::payload] contains [IP::local_addr] } { set newpayload [string map "[IP::local_addr] [LB::server addr]" [TCP::payload]] TCP::payload replace 0 [TCP::payload length] "" TCP::payload replace 0 0 $newpayload } TCP::release TCP::collect } when LB_SELECTED { TCP::collect } } trace [root@ve11a:Active:In Sync] config ssldump -Aed -nni 0.0 port 80 New TCP connection 1: 172.28.24.1(36926) <-> 172.28.24.10(80) 1391605062.9816 (0.0018) C>S --------------------------------------------------------------- GET / HTTP/1.1 User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Host: 172.28.24.10 Accept: */* --------------------------------------------------------------- New TCP connection 2: 200.200.200.14(36926) <-> 200.200.200.101(80) 1391605062.9837 (0.0015) C>S --------------------------------------------------------------- GET / HTTP/1.1 User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Host: 200.200.200.101 Accept: */* ---------------------------------------------------------------
- Gus_135027
Cirrus
Hello, Did you manage to successfully create the iRule?
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