Global IP Lists
Directory Structure
|-- global_ip_lists/
|-- global_ip_lists.yaml
|-- ...
The YAML files can contain one or more global IP lists.
Configuration Description
Parameter | Data Type | Required | Description |
---|---|---|---|
name | string | Yes | The name of the global IP list, which is also its unique identifier |
type | string | Yes | The type of IP list, can be “ipv4” or “ipv6” |
items | array | Yes | List of IP addresses |
items Configuration
Parameter | Data Type | Required | Description |
---|---|---|---|
ip | string | Yes | IP address |
Configuration Example
- name: global-ip-list1
type: ipv4
items:
- ip: 1.1.1.1
- ip: 1.1.1.11
- name: global-ip-list2
type: ipv4
items:
- ip: 1.1.1.1
- ip: 1.1.1.2
This configuration defines two global IP lists, each containing multiple IPv4 addresses.
Please note that IPv6 addresses are not currently supported.
Usage Example
Update configuration to OpenResty Edge:
edge-config https://192.168.1.1 -s -t 2051e780-1897-4ea0-92b4-2c2f0169aa94 -l global_ip_lists -i /root/oredge-configs
Export configuration from OpenResty Edge:
edge-config -u https://192.168.1.1 -s -t 2051e780-1897-4ea0-92b4-2c2f0169aa94 -E -l global_ip_lists
Both examples use -l global_ip_lists
to specify importing/exporting only the configurations related to global IP lists.
Notes
Global IP lists are global configurations. Delete operations are not performed when updating configurations to maintain compatibility with multiple local configurations.
Each global IP list must have a unique name.
The type of IP list must be “ipv4”.
When adding or updating IP lists, the tool will check the validity of IP addresses.
When updating configurations, the tool will compare the new and old configurations to determine if an update is necessary. If there are changes, an update operation will be performed.
When importing configurations, the tool will first check the validity of the configuration before performing add or update operations.
When exporting configurations, the tool will format the YAML content to include only necessary information (name, type, and IP addresses).
IP lists can be referenced by other features, such as “Page Rules - Conditions”.