iRule TCP Payload check
LAB: Configure iRule that process request based on substring with in TCP content frame and direct traffic to two different pools.
Create three different Pool
- Pool 1: 172.16.10.129 : Port : All Services
- Pool 2: 172.16.10.130 : Port : All Services
- Pool 3: 172.16.10.131 : Port : All Services
Refer below figure to configure three pools.
Go to Local Traffic | iRule | Create iRule | Name rule_tcp_payload
Configure below iRule as shown in below figure and Update.
Here, the iRule says that if Client requested with port 80 and in URI with some content it will send traffic to Pool 2 and it will send traffic to pool3.
Now Go to Local Traffic | Virtual Server | Create New Virtual Server Use Destination IP 10.10.10.105 and under Service Port, Select All Services.
Under iRule: Select rule_tcp_payload, Select HTTP Profile http and default Pool: pool2