ip-restriction
Summary#
Name#
The ip-restriction can restrict access to a Service or a Route by either
whitelisting or blacklisting IP addresses. Single IPs, multiple IPs or ranges
in CIDR notation like 10.10.10.0/24 can be used.
Attributes#
| Name | Type | Requirement | Default | Valid | Description |
|---|---|---|---|---|---|
| whitelist | array[string] | optional | List of IPs or CIDR ranges to whitelist. | ||
| blacklist | array[string] | optional | List of IPs or CIDR ranges to blacklist. |
One of whitelist or blacklist must be specified, and they can not work
together.
How To Enable#
Creates a route or service object, and enable plugin ip-restriction.
Test Plugin#
Requests from 127.0.0.1:
Requests from 127.0.0.2:
Change the restriction#
When you want to change the whitelisted ip, it is very simple, you can send the corresponding json configuration in the plugin configuration, no need to restart the service, it will take effect immediately:
Test Plugin after restriction change#
Requests from 127.0.0.2:
Requests from 127.0.0.1:
Disable Plugin#
When you want to disable the ip-restriction plugin, it is very simple,
you can delete the corresponding json configuration in the plugin configuration,
no need to restart the service, it will take effect immediately:
The ip-restriction plugin has been disabled now. It works for other plugins.