fortinet.fortios.fortios_system_mobile_tunnel 模块 – 配置移动隧道,这是针对移动 IPv4 RFC5177 的网络移动性 (NEMO) 扩展的实现。

注意

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

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

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

要在剧本中使用它,请指定:fortinet.fortios.fortios_system_mobile_tunnel

fortinet.fortios 2.0.0 中的新增功能

概要

  • 此模块能够通过允许用户设置和修改系统功能和 mobile_tunnel 类别来配置 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_mobile_tunnel

字典

配置移动隧道,这是针对移动 IPv4 RFC5177 的网络移动性 (NEMO) 扩展的实现。

hash_algorithm

字符串

哈希算法(带密钥的 MD5)。

选项

  • "hmac-md5"

home_address

字符串

家庭 IP 地址(格式:xxx.xxx.xxx.xxx)。

home_agent

字符串

NEMO HA 的 IPv4 地址(格式:xxx.xxx.xxx.xxx)。

lifetime

整数

NMMO HA 注册请求生命周期 (180 - 65535 秒)。

n_mhae_key

字符串

NEMO 身份验证密钥。

n_mhae_key_type

字符串

NEMO 身份验证密钥类型 (ASCII 或 base64)。

选项

  • "ascii"

  • "base64"

n_mhae_spi

整数

NEMO 身份验证 SPI。

name

字符串 / 必需

隧道名称。

network

列表 / 元素=字典

NEMO 网络配置。

id

整数 / 必需

网络条目 ID。参见 注释

interface

字符串

从可用选项中选择关联的接口名称。来源 system.interface.name。

prefix

字符串

带掩码的IP地址 (格式:xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx 或 xxx.xxx.xxx.xxx/x)。

reg_interval

整数

NMMO HA 注册间隔 (5 - 300)。

reg_retry

整数

NMMO HA 注册最大重试次数 (1 到 30)。

renew_interval

整数

在生命周期到期前发送 NMMO HA 重新注册的时间 (5 - 60)。

roaming_interface

字符串

从可用选项中选择关联的接口名称。来源 system.interface.name。

status

字符串

启用/禁用此移动隧道。

选项

  • "disable"

  • "enable"

tunnel_mode

字符串

NEMO 隧道模式 (GRE 隧道)。

选项

  • "gre"

vdom

字符串

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

默认值: "root"

注释

注意

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

  • 该模块支持 check_mode。

示例

- name: Configure Mobile tunnels, an implementation of Network Mobility (NEMO) extensions for Mobile IPv4 RFC5177.
  fortinet.fortios.fortios_system_mobile_tunnel:
      vdom: "{{ vdom }}"
      state: "present"
      access_token: "<your_own_value>"
      system_mobile_tunnel:
          hash_algorithm: "hmac-md5"
          home_address: "<your_own_value>"
          home_agent: "<your_own_value>"
          lifetime: "65535"
          n_mhae_key: "<your_own_value>"
          n_mhae_key_type: "ascii"
          n_mhae_spi: "256"
          name: "default_name_10"
          network:
              -
                  id: "12"
                  interface: "<your_own_value> (source system.interface.name)"
                  prefix: "<your_own_value>"
          reg_interval: "5"
          reg_retry: "3"
          renew_interval: "60"
          roaming_interface: "<your_own_value> (source system.interface.name)"
          status: "disable"
          tunnel_mode: "gre"

返回值

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

描述

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"

版本

字符串

FortiGate 版本

返回: 始终

示例: "v5.6.3"

作者

  • 郑 link (@chillancezen)

  • 薛杰 (@JieX19)

  • 卢洪斌 (@fgtdev-hblu)

  • 沈方 (@frankshen01)

  • Miguel Angel Munoz (@mamunozgonzalez)

  • Nicolas Thomas (@thomnico)