Forum Discussion
Block range of IP address
I'm needing an iRule to block a range external IP addresses. Example: 106.37.0.0.0 to 106.39.255.255.255...
Any assistance would be appreciated, even a link to documentation that explains how to do this would be great...
Hi, I'm sure there are lots of options to do this but here is one I use.
I have an iRule as shown below that references a datagroup called ipblock. Once in place you can just add either host IPs or networks into the datagroup that you want blocked.
when CLIENT_ACCEPTED { if { ([ class match [IP::remote_addr] equals ipblock ]) } { reject } }
- Lee_Payne_53457Cirrostratus
You want something like:
when CLIENT_ACCEPTED { if { [IP::addr 106.37.0.0.0/13 equals [IP::client_addr]] } { drop }
}
- Michael_Wood_18NimbostratusThank you for your response. I'll be able to use both answers.
- jdam_41848Altocumulus
Hi, I'm sure there are lots of options to do this but here is one I use.
I have an iRule as shown below that references a datagroup called ipblock. Once in place you can just add either host IPs or networks into the datagroup that you want blocked.
when CLIENT_ACCEPTED { if { ([ class match [IP::remote_addr] equals ipblock ]) } { reject } }
- Michael_Wood_18NimbostratusThank you for your response. I'll be able to use both answers.
- Parveez_70209Nimbostratus
Hi,
This syntax showing some error.
Thanks and Regards Parveez
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