Moodle Plugins directory: Availability restriction by IP address | Moodle.org

Availability restriction by IP address
Availability restriction ::: availability_ipaddress
Maintained by
Luuk Verhoeven,
Vincent Cornelis,
hamza tamyachte
Moodle availability plugin which lets users restrict resources and activities with IP address
Latest release:
558 sites
146 downloads
23 fans
Current versions available: 2
Moodle - availability ip address plugin
Enhance activity security by restricting access based on IP address. This plugin allows you to control the availability of any chosen activity, making it accessible only to users from specified IP addresses.
Author
- Author: Luuk Verhoeven, ldesignmedia.nl
- Min. required: Moodle 4.0
- Supports PHP: 7.4
List of features
- Supports comma separate list of ip-addresses
- Subnet support, eg 192.168.1.0/24
- Inline ip-address validation
- Turning on/off with eye icon, without lossing the input value.
Installation
- Copy this plugin to the
availability\condition\ipaddress
folder on the server - Login as administrator
- Go to Site Administrator > Notification
- Install the plugin
Usage
- Add or edit an activity in a Moodle course.
- Go to the section "Restrict access"
- Click IP address in the modal
- There's a new input field that supports a list of comma separated ip address e.g. 127.0.0.1, 192.168.1.0/24
- The users with matching ip addresses can view the activity.
- Save the activity
Security
If you discover any security related issues, please email luuk@ldesignmedia.nl instead of using the issue tracker.
License
The GNU GENERAL PUBLIC LICENSE. Please see License File for more information.
Contributing
Contributions are welcome and will be fully credited. We accept contributions via Pull Requests on Github.
Changelog
- 2025040400 Tested on Moodle 4.5
- 2024072000 Tested on Moodle 4.4
- 2022021100 Thanks for adding ip-range support @juacas
- 2022052800 Fixed the issue 6 @hamzatamyachte
- 2022052801 Test in Moodle 4.0 @hamzatamyachte
Useful links
Contributors
Luuk Verhoeven (Lead maintainer)
Vincent Cornelis
hamza tamyachte
Please login to view contributors details and/or to contact them
You can download the plugin, unzip it and place it in the /availability folder.
After that go trough the install process on your site (login as an administrator) and install the plugin. You can then use it in your activities.
is there a documentation for this plugin?
Cheers Kasia
This very basic restriction plugin;
1. Add or edit an activity in a Moodle course.
2. Go to the section "Restrict access"
3. Select IP address in the modal
4. There's a new input field that supports a list of comma separated ip address e.g. 127.0.0.1, 192.168.1.0/24
4.1 The users with matching ip addresses can view the activity.
5. Save the activity
For answering the question of @stefano federici and for clarify .
"192.168.1.0/24":
192.168.1.0 is the ip address part it can be (IPv4 or IPv6).
24 is the number of bits in the net mask.
2^8 = 256 possible ip adresses.
In the case of submitting this value '192.168.1.0/24' in the input. only the users who connected by the ip addresses from
192.168.1.0 to 192.168.1.255 can have the access to the activity.
Example 1 : "134.145.3.1/16":
2^16 = 65536 possible ip adresses.
In this case only the users who had ip addresses from 134.145.0.1 to 134.145.255.255 can view the activity.
Example 2 : "134.145.0.1/29":
2^3 = 6 possible ip adresses.
In this case only the users who had ip addresses from 134.145.0.1 to 134.145.0.6 can view the activity.
Thanks.
I have questionnaires restricted by IP in many courses, my provider has changed my IP and I have to change the IP in all the courses. Is there a way to make this change in bulk?
In which database table is the IP value stored to change it?
Thank you
The answer of your first question. No there is no way for now to change the ip addresses for all activity modules restriction in bulk, maybe in the future.
And about your second question. Yes you can make the changes if you want. you can search by course id in course modules database table in the availability column.
Best regards.
Many teachers have problems using IP address ranges. This plugin (quiz access rule) offers a solution to this problem, as it is sufficient to select a location from a list and not need to know the exact IP range:
https://moodle.org/plugins/quizaccess_ipaddresslist
Would a similar solution be possible with this plugin? You would have to choose from a predefined list of locations/IP ranges set by the administrator and not have to enter them manually.