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

ParameterData TypeRequiredDescription
namestringYesThe name of the global IP list, which is also its unique identifier
typestringYesThe type of IP list, can be “ipv4” or “ipv6”
itemsarrayYesList of IP addresses

items Configuration

ParameterData TypeRequiredDescription
ipstringYesIP 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

  1. Global IP lists are global configurations. Delete operations are not performed when updating configurations to maintain compatibility with multiple local configurations.

  2. Each global IP list must have a unique name.

  3. The type of IP list must be “ipv4”.

  4. When adding or updating IP lists, the tool will check the validity of IP addresses.

  5. 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.

  6. When importing configurations, the tool will first check the validity of the configuration before performing add or update operations.

  7. When exporting configurations, the tool will format the YAML content to include only necessary information (name, type, and IP addresses).

  8. IP lists can be referenced by other features, such as “Page Rules - Conditions”.