fortinet.fortios.fortios_system_np6 模块 – 在 Fortinet 的 FortiOS 和 FortiGate 中配置 NP6 属性。

注意

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

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

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

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

fortinet.fortios 2.0.0 中的新增功能

概要

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

要求

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

  • ansible>=2.15

参数

参数

注释

access_token

字符串

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

enable_log

布尔值

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

选项

  • false ← (默认)

  • true

member_path

字符串

要操作的成员属性路径。

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

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

member_state

字符串

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

指定 member_state 时,将忽略 state 选项。

选项

  • "present"

  • "absent"

state

字符串 / 必需

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

选项

  • "present"

  • "absent"

system_np6

字典

配置 NP6 属性。

fastpath

字符串

启用/禁用 NP6 卸载(也称为快速路径)。

选项

  • "disable"

  • "enable"

fp_anomaly

字典

NP6 IPv4 异常保护。trap-to-host 将异常会话转发到 CPU。

icmp_csum_err

字符串

无效的 IPv4 ICMP 校验和异常。

选项

  • "drop"

  • "trap-to-host"

icmp_frag

字符串

可能是第 4 层 ICMP 异常一部分的第 3 层分片数据包。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

icmp_land

字符串

ICMP land 异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv4_csum_err

字符串

无效的 IPv4 IP 校验和异常。

选项

  • "drop"

  • "trap-to-host"

ipv4_land

字符串

Land 异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv4_optlsrr

字符串

松散源记录路由选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv4_optrr

字符串

记录路由选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv4_optsecurity

字符串

安全选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv4_optssrr

字符串

严格源记录路由选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv4_optstream

字符串

流选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv4_opttimestamp

字符串

时间戳选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv4_proto_err

字符串

无效的第 4 层协议异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv4_unknopt

字符串

未知选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_daddr_err

字符串

目标地址为未指定地址或环回地址异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_land

字符串

Land 异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_optendpid

字符串

端点标识异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_opthomeaddr

字符串

家庭地址选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_optinvld

字符串

无效选项异常。无效选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_optjumbo

字符串

Jumbo 选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_optnsap

字符串

网络服务接入点地址选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_optralert

字符串

路由器警报选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_opttunnel

字符串

隧道封装限制选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_proto_err

字符串

第 4 层无效协议异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_saddr_err

字符串

源地址为多播地址异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

ipv6_unknopt

字符串

未知选项异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

tcp_csum_err

字符串

无效的 IPv4 TCP 校验和异常。

选项

  • "drop"

  • "trap-to-host"

tcp_fin_noack

字符串

TCP SYN 泛洪,FIN 标志已设置但 ACK 未设置异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

tcp_fin_only

字符串

仅设置 FIN 标志的 TCP SYN 泛洪异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

tcp_land

字符串

TCP land 异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

tcp_no_flag

字符串

未设置任何标志的 TCP SYN 泛洪异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

tcp_syn_data

字符串

带有数据的 TCP SYN 泛洪数据包异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

tcp_syn_fin

字符串

TCP SYN 泛洪 SYN/FIN 标志已设置异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

tcp_winnuke

字符串

TCP WinNuke 异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

udp_csum_err

字符串

无效的 IPv4 UDP 校验和异常。

选项

  • "drop"

  • "trap-to-host"

udp_land

字符串

UDP land 异常。

选项

  • "allow"

  • "drop"

  • "trap-to-host"

garbage_session_collector

字符串

启用/禁用垃圾会话收集器。

选项

  • "disable"

  • "enable"

hpe

字典

HPE 配置。

arp_max

整数

最大 ARP 数据包速率 (1K - 1G pps)。

enable_shaper

字符串

为数据包类型整形器启用/禁用 NPU 主机保护引擎 (HPE)。

选项

  • "disable"

  • "enable"

esp_max

整数

最大 ESP 数据包速率 (1K - 1G pps)。

icmp_max

整数

最大 ICMP 数据包速率 (1K - 1G pps)。

ip_frag_max

整数

最大分片 IP 数据包速率 (1K - 1G pps)。

ip_others_max

整数

其他数据包的最大 IP 数据包速率(无法使用其他选项设置的数据包类型)(1K - 1G pps)。

l2_others_max

整数

非 ARP 数据包的 L2 数据包的最大 L2 数据包速率 (1K - 1G pps)。

pri_type_max

整数

优先级类型流量的最大溢出率 (1K - 1G pps)。包括 L2:HA,802.3ad LACP,心跳。L3:OSPF。L4_TCP:BGP。L4_UDP:IKE,SLBC,BFD。

sctp_max

整数

最大 SCTP 数据包速率 (1K - 1G pps)。

tcp_max

整数

最大 TCP 数据包速率 (1K - 1G pps)。

tcpfin_rst_max

整数

携带 FIN 或 RST 标志数据包的最大 TCP 速率 (1K - 1G pps)。

tcpsyn_ack_max

整数

携带 SYN 和 ACK 标志数据包的最大 TCP 速率 (1K - 1G pps)。

tcpsyn_max

整数

最大 TCP SYN 数据包速率 (1K - 1G pps)。

udp_max

整数

最大 UDP 数据包速率 (1K - 1G pps)。

ipsec_ob_hash_function

字符串

设置IPSec出站哈希函数。

选项

  • "全局哈希"

  • "轮循全局"

ipsec_outbound_hash

字符串

启用/禁用IPsec出站流量的哈希函数。

选项

  • "disable"

  • "enable"

low_latency_mode

字符串

启用/禁用低延迟模式。

选项

  • "disable"

  • "enable"

name

字符串 / 必需

设备名称。

per_session_accounting

字符串

启用/禁用每会话计费。

选项

  • "disable"

  • "仅流量日志"

  • "enable"

session_collector_interval

整数

设置垃圾会话收集清理间隔(1-100秒)。

session_timeout_fixed

字符串

{禁用 | 启用} 在使用固定或随机超时来刷新NP6会话之间切换。

选项

  • "disable"

  • "enable"

session_timeout_interval

整数

设置刷新NP6会话的固定超时时间(0-1000秒)。

session_timeout_random_range

整数

设置刷新NP6会话的随机超时范围(0-1000秒)。

vdom

字符串

虚拟域,在之前定义的虚拟域中选择。vdom是FortiGate的虚拟实例,可以配置并用作不同的单元。

默认值: "root"

备注

注意

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

  • 该模块支持check_mode。

示例

- name: Configure NP6 attributes.
  fortinet.fortios.fortios_system_np6:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      system_np6:
          fastpath: "disable"
          fp_anomaly:
              icmp_csum_err: "drop"
              icmp_frag: "allow"
              icmp_land: "allow"
              ipv4_csum_err: "drop"
              ipv4_land: "allow"
              ipv4_optlsrr: "allow"
              ipv4_optrr: "allow"
              ipv4_optsecurity: "allow"
              ipv4_optssrr: "allow"
              ipv4_optstream: "allow"
              ipv4_opttimestamp: "allow"
              ipv4_proto_err: "allow"
              ipv4_unknopt: "allow"
              ipv6_daddr_err: "allow"
              ipv6_land: "allow"
              ipv6_optendpid: "allow"
              ipv6_opthomeaddr: "allow"
              ipv6_optinvld: "allow"
              ipv6_optjumbo: "allow"
              ipv6_optnsap: "allow"
              ipv6_optralert: "allow"
              ipv6_opttunnel: "allow"
              ipv6_proto_err: "allow"
              ipv6_saddr_err: "allow"
              ipv6_unknopt: "allow"
              tcp_csum_err: "drop"
              tcp_fin_noack: "allow"
              tcp_fin_only: "allow"
              tcp_land: "allow"
              tcp_no_flag: "allow"
              tcp_syn_data: "allow"
              tcp_syn_fin: "allow"
              tcp_winnuke: "allow"
              udp_csum_err: "drop"
              udp_land: "allow"
          garbage_session_collector: "disable"
          hpe:
              arp_max: "200000"
              enable_shaper: "disable"
              esp_max: "200000"
              icmp_max: "200000"
              ip_frag_max: "200000"
              ip_others_max: "200000"
              l2_others_max: "200000"
              pri_type_max: "200000"
              sctp_max: "200000"
              tcp_max: "600000"
              tcpfin_rst_max: "600000"
              tcpsyn_ack_max: "600000"
              tcpsyn_max: "600000"
              udp_max: "600000"
          ipsec_ob_hash_function: "global-hash"
          ipsec_outbound_hash: "disable"
          low_latency_mode: "disable"
          name: "default_name_59"
          per_session_accounting: "disable"
          session_collector_interval: "64"
          session_timeout_fixed: "disable"
          session_timeout_interval: "40"
          session_timeout_random_range: "8"

返回值

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

描述

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)