Forum Discussion
6 Replies
Sort By
- Shaun_Simmons1Altostratus
**Create data group: my_ip_db --or whatever name you want and add your IP's: 209.177.18.1 209.177.18.2 209.177.18.3
iRule:
when HTTP_REQUEST { if { [class match [IP::client_addr] equals my_ip_dg] } { pool btsxv-old-pool} else {pool btsxv-new-pool} } }
To expand on Shaun's answer, your data group should be of the type "Address", with the IP addresses entered as three records. If you do not specify a subnet mask for an address, it defaults to a /32.
Here is an example that I created showing a single host as well as a /24 sized subnet.
ltm data-group internal DG_SourceIP { partition Common records { 1.1.1.1/32 { } 2.2.2.0/24 { } } type ip }
- khansafdarali1_Nimbostratus
We are using port 22. Do we use "when client_accepted" instead of "when HTTP_REQUEST"?
- Shaun_Simmons1Altostratus
khansafdarali1 Yes "when CLIENT_ACCEPTED"
- khansafdarali1_Nimbostratus
while creating the irule I am getting the following error.
01070151:3: Rule [/Common/btsnp] error: /Common/btsnp:6: error: [command is not valid in the current scope][}]
- Shaun_Simmons1Altostratus
Delete the last "{"