Forum Discussion
F5 Whitelisting/ Allowing a specific range of traffic to VS
- Mar 06, 2018
Create IP type LTM data-group. Define allowed IP/subnet values, and add optional descriptions. You can find data-group creation page at
. Example of an IP type data-group in CLI/TEXT format:Local Traffic - iRules - Data-group List
ltm data-group internal datagroup_allowed_ip { records { 100.20.20.0/32 { } 199.20.20.128/25 { } } type ip }
Create an iRule that checks for matches against entries in datagroup_allowed_ip
when CLIENT_ACCEPTED { if { [class match [IP::client_addr] eq "datagroup_allowed_ip" ] }{ Traffic is allowed. Client IP match found in datagroup_allowed_ip return } else { Traffic is dropped. Client IP match not found in datagroup_allowed_ip drop } }
Create IP type LTM data-group. Define allowed IP/subnet values, and add optional descriptions. You can find data-group creation page at
Local Traffic - iRules - Data-group List
. Example of an IP type data-group in CLI/TEXT format:
ltm data-group internal datagroup_allowed_ip {
records {
100.20.20.0/32 { }
199.20.20.128/25 { }
}
type ip
}
Create an iRule that checks for matches against entries in datagroup_allowed_ip
when CLIENT_ACCEPTED {
if { [class match [IP::client_addr] eq "datagroup_allowed_ip" ] }{
Traffic is allowed. Client IP match found in datagroup_allowed_ip
return
} else {
Traffic is dropped. Client IP match not found in datagroup_allowed_ip
drop
}
}
- sandiksk_35282Mar 06, 2018Altostratus
Thankyou , configuring for the QA setup , will get back to you if I run into any issues.
- sandiksk_35282Mar 07, 2018Altostratus
I am not able to see any traffic hitting the irule . In the datagroup we specified the IP range . BUt i dont see any hits.
- Maneesh_72711Mar 07, 2018Cirrostratus
What do you mean not seeing any traffic hitting the i-rule have you enabled logging on i-rule and dont see the logic getting triggered ? Hannes has provided correct i-rule as per your requirement, are you coming from correct sources ?
- sandiksk_35282Mar 08, 2018Altostratus
Yaa the irule is working as I dint add the source IPs which are used for testing in the datagroup. Now its working as expected. Thanks a lot Hannes for your help.
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