Forum Discussion
Need to create and i-rule which directs traffic coming from these 3 IP address to btsxv-old-pool and the rest of the traffic goes to btsxv-new-pool.
Need to create and i-rule which directs traffic coming from these 3 IP address {209.177.18.1, 209.177.18.2, 209.177.18.3} to btsxv-old-pool and the rest of the traffic goes to btsxv-new-pool.
6 Replies
- Shaun_Simmons1
Altostratus
**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_Simmons1
Altostratus
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_Simmons1
Altostratus
Delete the last "{"
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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