fortinet.fortios.fortios_firewall_ippool 模块 – 在 Fortinet 的 FortiOS 和 FortiGate 中配置 IPv4 IP 池。

注意

此模块是 fortinet.fortios 集合 (版本 2.3.8) 的一部分。

如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install fortinet.fortios。您需要其他要求才能使用此模块,请参阅 要求 获取详细信息。

要在 playbook 中使用它,请指定: fortinet.fortios.fortios_firewall_ippool

fortinet.fortios 2.0.0 中的新增功能

概要

  • 此模块能够通过允许用户设置和修改防火墙功能和 ippool 类别来配置 FortiGate 或 FortiOS (FOS) 设备。示例包括所有参数,在使用前需要将值调整为数据源。已在 FOS v6.0.0 上测试。

要求

执行此模块的主机需要以下要求。

  • ansible>=2.15

参数

参数

注释

access_token

字符串

基于令牌的身份验证。从 FortiGate 的 GUI 生成。

enable_log

布尔值

启用/禁用任务的日志记录。

选项

  • false ← (默认)

  • true

firewall_ippool

字典

配置 IPv4 IP 池。

add_nat64_route

字符串

启用/禁用添加 NAT64 路由。

选项

  • "disable"

  • "enable"

arp_intf

字符串

从可用的选项中选择一个将回复 ARP 请求的接口。(如果为空,则选择任何一个)。源 system.interface.name。

arp_reply

字符串

在将 IP 池添加到策略时,启用/禁用回复 ARP 请求。

选项

  • "disable"

  • "enable"

associated_interface

字符串

关联接口名称。源 system.interface.name。

block_size

整数

一个块中的地址数 (64 - 4096)。

client_prefix_length

整数

单个确定性 NAT64 客户端的子网长度 (1 - 128)。

comments

字符串

注释。

endip

字符串

地址池范围内的最终 IPv4 地址(包含)(格式 xxx.xxx.xxx.xxx)。

endport

整数

地址池范围内的最终端口号(包含)(1024 - 65535)。

icmp_session_quota

整数

每个客户端允许的最大并发 ICMP 会话数 (0 - 2097000)。

name

字符串 / 必需

IP 池名称。

nat64

字符串

启用/禁用 NAT64。

选项

  • "disable"

  • "enable"

num_blocks_per_user

整数

用户可使用的地址块数 (1 到 128)。

pba_interim_log

整数

端口块分配临时日志记录间隔 (600 - 86400 秒)。

pba_timeout

整数

端口块分配超时 (秒)。

permit_any_host

字符串

启用/禁用全锥 NAT。

选项

  • "disable"

  • "enable"

port_per_user

整数

每个用户的端口数 (32 - 60416)。

privileged_port_use_pba

字符串

启用/禁用为 NAT”ing 特权端口选择来自端口块分配的外部端口(默认 = 禁用)。

选项

  • "disable"

  • "enable"

source_endip

字符串

要转换的源地址范围内的最终 IPv4 地址(包含)(格式 xxx.xxx.xxx.xxx)。

source_prefix6

字符串

要转换的源 IPv6 网络 (格式 = xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/xxx)。

source_startip

字符串

要转换的源地址范围内的第一个 IPv4 地址(包含)(格式 = xxx.xxx.xxx.xxx)。

startip

字符串

地址池范围内的第一个 IPv4 地址(包含)(格式 xxx.xxx.xxx.xxx)。

startport

整数

地址池范围内的第一个端口号(包含)(1024 - 65535)。

subnet_broadcast_in_ippool

字符串

启用/禁用在 NAT64 IP 池中包含子网地址和广播 IP 地址。

选项

  • "disable"

  • "enable"

tcp_session_quota

整数

每个客户端允许的最大并发 TCP 会话数 (0 - 2097000)。

type

字符串

IP 池类型:overload、one-to-one、fixed-port-range、port-block-allocation、cgn-resource-allocation(仅限超大规模 vdom)

选项

  • "overload"

  • "one-to-one"

  • "fixed-port-range"

  • "port-block-allocation"

udp_session_quota

整数

每个客户端允许的最大并发 UDP 会话数 (0 - 2097000)。

member_path

字符串

要操作的成员属性路径。

如果有多个属性,则用斜杠字符分隔。

标有 member_path 的参数对于执行成员操作是合法的。

member_state

字符串

在指定的属性路径下添加或删除成员。

如果指定了 member_state,则忽略 state 选项。

选项

  • "present"

  • "absent"

state

字符串 / 必需

指示是创建还是删除对象。

选项

  • "present"

  • "absent"

vdom

字符串

虚拟域,在之前定义的那些虚拟域中。vdom 是 FortiGate 的虚拟实例,可以将其配置和用作不同的单元。

默认值: "root"

备注

注意

  • 旧版 fortiosapi 已弃用,httpapi 是运行 playbook 的首选方法。

  • 该模块支持 check_mode。

示例

- name: Configure IPv4 IP pools.
  fortinet.fortios.fortios_firewall_ippool:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      firewall_ippool:
          add_nat64_route: "disable"
          arp_intf: "<your_own_value> (source system.interface.name)"
          arp_reply: "disable"
          associated_interface: "<your_own_value> (source system.interface.name)"
          block_size: "128"
          client_prefix_length: "64"
          comments: "<your_own_value>"
          endip: "<your_own_value>"
          endport: "65533"
          icmp_session_quota: "0"
          name: "default_name_13"
          nat64: "disable"
          num_blocks_per_user: "8"
          pba_interim_log: "0"
          pba_timeout: "30"
          permit_any_host: "disable"
          port_per_user: "0"
          privileged_port_use_pba: "disable"
          source_endip: "<your_own_value>"
          source_prefix6: "<your_own_value>"
          source_startip: "<your_own_value>"
          startip: "<your_own_value>"
          startport: "5117"
          subnet_broadcast_in_ippool: "disable"
          tcp_session_quota: "0"
          type: "overload"
          udp_session_quota: "0"

返回值

此处记录了常见的返回值 此处,以下是此模块特有的字段

描述

build

字符串

FortiGate 镜像的版本号

返回:始终

示例: "1547"

http_method

字符串

最后用于将内容置备到 FortiGate 的方法

返回:始终

示例: "PUT"

http_status

字符串

FortiGate 在最后一次操作中给出的最终结果

返回:始终

示例: "200"

mkey

字符串

最后一次调用 FortiGate 时使用的主密钥 (ID)

返回:成功

示例: "id"

name

字符串

用于满足请求的表名称

返回:始终

示例: "urlfilter"

path

字符串

用于满足请求的表路径

返回:始终

示例: "webfilter"

revision

字符串

内部修订号

返回:始终

示例: "17.0.2.10658"

serial

字符串

设备的序列号

返回:始终

示例: "FGVMEVYYQT3AB5352"

status

字符串

操作结果指示

返回:始终

示例: "success"

vdom

字符串

使用的虚拟域

返回:始终

示例: "root"

version

字符串

FortiGate 的版本

返回:始终

示例: "v5.6.3"

作者

  • 郑链 (@chillancezen)

  • 薛杰 (@JieX19)

  • 陆洪宾 (@fgtdev-hblu)

  • 沈芳 (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)