Forum Discussion
Irule Request
Hi,
I have a Big IP LTM 3600. I want to build an irule with the following requirements,
1- Allow IPs only from America and India. 2- Allow only certain IP addresses from India 3- Allow 10.0.0.0/8 for access from inside 3- Disallow everything else.
Any help would be highly appreciated.
Thanks, Maz
9 Replies
- kunjan
Nimbostratus
https://devcentral.f5.com/wiki/irules.whereis.ashx
Try this
when CLIENT_ACCEPTED { set CC [whereis [IP::client_addr] country] if { !([IP::addr [IP::client_addr] equals 10.0.0.0/8 ] or $CC equals "US" or $CC equals "IN" ) } { drop } }- Saib_175162
Nimbostratus
Hi Kunjan, many thanks for your response. Sorry I am very new to this. I have a list of IPs from india that I need to allow. I can put this into an address group. Then how would I call this group into the above irule. Thanks again. BR Mazhar
- kunjan_118660
Cumulonimbus
https://devcentral.f5.com/wiki/irules.whereis.ashx
Try this
when CLIENT_ACCEPTED { set CC [whereis [IP::client_addr] country] if { !([IP::addr [IP::client_addr] equals 10.0.0.0/8 ] or $CC equals "US" or $CC equals "IN" ) } { drop } }- Saib_175162
Nimbostratus
Hi Kunjan, many thanks for your response. Sorry I am very new to this. I have a list of IPs from india that I need to allow. I can put this into an address group. Then how would I call this group into the above irule. Thanks again. BR Mazhar
- kunjan_118660
Cumulonimbus
If your address list myaddress_list
when CLIENT_ACCEPTED { set CC [whereis [IP::client_addr] country] if { !([class match [IP::client_addr] equals myaddress_list] or $CC equals "US" ) } { drop } }- Saib_175162
Nimbostratus
Thank you. I will get back to you. BR
- kunjan
Nimbostratus
If your address list myaddress_list
when CLIENT_ACCEPTED { set CC [whereis [IP::client_addr] country] if { !([class match [IP::client_addr] equals myaddress_list] or $CC equals "US" ) } { drop } }- Saib_175162
Nimbostratus
Thank you. I will get back to you. BR
- Mazhar_Rafi_170
Nimbostratus
Hello Kunjan,
In the iRule above, i want to allow world wide access but disallow few countries. Lets say china, russia and philipines. Also I want to remove the specific IP allowed list. Can you please help.
Thanks, Maz
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