fortinet.fortios.fortios_vpn_ipsec_phase1_interface – Configure VPN remote gateway in Fortinet’s FortiOS and FortiGate.
Note
This plugin is part of the fortinet.fortios collection (version 2.1.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install fortinet.fortios
.
To use it in a playbook, specify: fortinet.fortios.fortios_vpn_ipsec_phase1_interface
.
New in version 2.10: of fortinet.fortios
Synopsis
This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify vpn_ipsec feature and phase1_interface category. Examples include all parameters and values need to be adjusted to datasources before usage. Tested with FOS v6.0.0
Requirements
The below requirements are needed on the host that executes this module.
ansible>=2.9.0
Parameters
Parameter |
Comments |
---|---|
Token-based authentication. Generated from GUI of Fortigate. |
|
Enable/Disable logging for task. Choices:
|
|
Member attribute path to operate on. Delimited by a slash character if there are more than one attribute. Parameter marked with member_path is legitimate for doing member operation. |
|
Add or delete a member under specified attribute path. When member_state is specified, the state option is ignored. Choices:
|
|
Indicates whether to create or remove the object. Choices:
|
|
Virtual domain, among those defined previously. A vdom is a virtual instance of the FortiGate that can be configured and used as a different unit. Default: “root” |
|
Configure VPN remote gateway. |
|
Enable/disable verification of RADIUS accounting record. Choices:
|
|
Enable/disable automatically add a route to the remote gateway. Choices:
|
|
Enable/disable control addition of a route to peer destination selector. Choices:
|
|
Enable/disable use as an aggregate member. Choices:
|
|
Link weight for aggregate. |
|
Enable/disable assignment of IP to IPsec interface via configuration method. Choices:
|
|
Method by which the IP address will be assigned. Choices:
|
|
Authentication method. Choices:
|
|
Authentication method (remote side). Choices:
|
|
XAuth password (max 35 characters). |
|
XAuth user name. |
|
Authentication user group. Source user.group.name. |
|
Enable/disable forwarding auto-discovery short-cut messages. Choices:
|
|
Enable/disable use of pre-shared secrets for authentication of auto-discovery tunnels. Choices:
|
|
Enable/disable accepting auto-discovery short-cut messages. Choices:
|
|
Enable/disable sending auto-discovery short-cut messages. Choices:
|
|
Control deletion of child short-cut tunnels when the parent tunnel goes down. Choices:
|
|
Enable/disable automatic initiation of IKE SA negotiation. Choices:
|
|
Instruct unity clients about the backup gateway address(es). |
|
Address of backup gateway. |
|
Message that unity client should display after connecting. |
|
Enable/disable cross validation of peer ID and the identity in the peer”s certificate as specified in RFC 4945. Choices:
|
|
The names of up to 4 signed personal certificates. |
|
Certificate name. Source vpn.certificate.local.name. |
|
Enable/disable childless IKEv2 initiation (RFC 6023). Choices:
|
|
Enable/disable allowing the VPN client to bring up the tunnel when there is no traffic. Choices:
|
|
Enable/disable allowing the VPN client to keep the tunnel up when there is no traffic. Choices:
|
|
Comment. |
|
IPv4 address of default route gateway to use for traffic exiting the interface. |
|
Priority for default gateway route. A higher priority number signifies a less preferred route. |
|
Relay agent IPv6 link address to use in DHCP6 requests. |
|
Relay agent gateway IP address to use in the giaddr field of DHCP requests. |
|
DH group. Choices:
|
|
Enable/disable IKEv2 Digital Signature Authentication (RFC 7427). Choices:
|
|
Distance for routes added by IKE (1 - 255). |
|
DNS server mode. Choices:
|
|
Instruct unity clients about the default DNS domain. |
|
Dead Peer Detection mode. Choices:
|
|
Number of DPD retry attempts. |
|
DPD retry interval. |
|
Enable/disable IKEv2 EAP authentication. Choices:
|
|
Peer group excluded from EAP authentication. Source user.peergrp.name. |
|
IKEv2 EAP peer identity type. Choices:
|
|
Local IPv4 address of GRE/VXLAN tunnel. |
|
Local IPv6 address of GRE/VXLAN tunnel. |
|
Remote IPv4 address of GRE/VXLAN tunnel. |
|
Remote IPv6 address of GRE/VXLAN tunnel. |
|
Enable/disable GRE/VXLAN encapsulation. Choices:
|
|
Source for GRE/VXLAN tunnel address. Choices:
|
|
Enable/disable peer ID uniqueness check. Choices:
|
|
Extended sequence number (ESN) negotiation. Choices:
|
|
Enable/disable exchange of IPsec interface IP address. Choices:
|
|
IPv4 address to exchange with peers. |
|
IPv6 address to exchange with peers |
|
Number of base Forward Error Correction packets (1 - 100). |
|
ipsec fec encoding/decoding algorithm (0: reed-solomon, 1: xor). |
|
Enable/disable Forward Error Correction for egress IPsec traffic. Choices:
|
|
Enable/disable Forward Error Correction for ingress IPsec traffic. Choices:
|
|
Timeout in milliseconds before dropping Forward Error Correction packets (1 - 10000). |
|
Number of redundant Forward Error Correction packets (1 - 100). |
|
Timeout in milliseconds before sending Forward Error Correction packets (1 - 1000). |
|
Enable/disable FortiClient enforcement. Choices:
|
|
Enable/disable fragment IKE message on re-transmission. Choices:
|
|
IKE fragmentation MTU (500 - 16000). |
|
Enable/disable IKEv2 IDi group authentication. Choices:
|
|
Password for IKEv2 IDi group authentication. (ASCII string or hexadecimal indicated by a leading 0x.) |
|
Enable/disable sequence number jump ahead for IPsec HA. Choices:
|
|
Enable/disable IPsec tunnel idle timeout. Choices:
|
|
IPsec tunnel idle timeout in minutes (5 - 43200). |
|
IKE protocol version. Choices:
|
|
Enable/disable allow local LAN access on unity clients. Choices:
|
|
Local physical, aggregate, or VLAN outgoing interface. Source system.interface.name. |
|
IP address reuse delay interval in seconds (0 - 28800). |
|
Determine whether IP packets are fragmented before or after IPsec encapsulation. Choices:
|
|
IP version to use for VPN interface. Choices:
|
|
IPv4 DNS server 1. |
|
IPv4 DNS server 2. |
|
IPv4 DNS server 3. |
|
End of IPv4 range. |
|
Configuration Method IPv4 exclude ranges. |
|
End of IPv4 exclusive range. |
|
ID. |
|
Start of IPv4 exclusive range. |
|
IPv4 address name. Source firewall.address.name firewall.addrgrp.name. |
|
IPv4 Netmask. |
|
IPv4 subnets that should not be sent over the IPsec tunnel. Source firewall.address.name firewall.addrgrp.name. |
|
IPv4 split-include subnets. Source firewall.address.name firewall.addrgrp.name. |
|
Start of IPv4 range. |
|
WINS server 1. |
|
WINS server 2. |
|
IPv6 DNS server 1. |
|
IPv6 DNS server 2. |
|
IPv6 DNS server 3. |
|
End of IPv6 range. |
|
Configuration method IPv6 exclude ranges. |
|
End of IPv6 exclusive range. |
|
ID. |
|
Start of IPv6 exclusive range. |
|
IPv6 address name. Source firewall.address6.name firewall.addrgrp6.name. |
|
IPv6 prefix. |
|
IPv6 subnets that should not be sent over the IPsec tunnel. Source firewall.address6.name firewall.addrgrp6.name. |
|
IPv6 split-include subnets. Source firewall.address6.name firewall.addrgrp6.name. |
|
Start of IPv6 range. |
|
NAT-T keep alive interval. |
|
Time to wait in seconds before phase 1 encryption key expires. |
|
IPv4 address of the local gateway”s external interface. |
|
IPv6 address of the local gateway”s external interface. |
|
Local ID. |
|
Local ID type. Choices:
|
|
Enable/disable asymmetric routing for IKE traffic on loopback interface. Choices:
|
|
Add selectors containing subsets of the configuration depending on traffic. Choices:
|
|
The ID protection mode used to establish a secure channel. Choices:
|
|
Enable/disable configuration method. Choices:
|
|
IPsec interface as backup for primary interface. Source vpn.ipsec.phase1-interface.name. |
|
Time to wait in seconds before recovery once primary re-establishes. |
|
Time of day at which to fail back to primary after it re-establishes. |
|
Recovery time method when primary interface re-establishes. Choices:
|
|
Day of the week to recover once primary re-establishes. Choices:
|
|
IPsec remote gateway name. |
|
Enable/disable NAT traversal. Choices:
|
|
IKE SA negotiation timeout in seconds (1 - 300). |
|
Enable/disable kernel device creation for dialup instances. Choices:
|
|
VPN gateway network ID. |
|
Enable/disable network overlays. Choices:
|
|
Enable/disable offloading NPU. Choices:
|
|
Enable/disable IPsec passive mode for static tunnels. Choices:
|
|
Accept this peer certificate. Source user.peer.name. |
|
Accept this peer certificate group. Source user.peergrp.name. |
|
Accept this peer identity. |
|
Accept this peer type. Choices:
|
|
Enable/disable IKEv2 Postquantum Preshared Key (PPK). Choices:
|
|
IKEv2 Postquantum Preshared Key Identity. |
|
IKEv2 Postquantum Preshared Key (ASCII string or hexadecimal encoded with a leading 0x). |
|
Priority for routes added by IKE (0 - 4294967295). |
|
Phase1 proposal. Choices:
|
|
Pre-shared secret for PSK authentication (ASCII string or hexadecimal encoded with a leading 0x). |
|
Pre-shared secret for remote side PSK authentication (ASCII string or hexadecimal encoded with a leading 0x). |
|
Enable/disable re-authentication upon IKE SA lifetime expiration. Choices:
|
|
Enable/disable phase1 rekey. Choices:
|
|
IPv4 address of the remote gateway”s external interface. |
|
IPv6 address of the remote gateway”s external interface. |
|
Domain name of remote gateway (eg. name.DDNS.com). |
|
Digital Signature Authentication RSA signature format. Choices:
|
|
Enable/disable saving XAuth username and password on VPN clients. Choices:
|
|
Enable/disable sending certificate chain. Choices:
|
|
Digital Signature Authentication hash algorithms. Choices:
|
|
Split-include services. Source firewall.service.group.name firewall.service.custom.name. |
|
Use Suite-B. Choices:
|
|
Tunnel search method for when the interface is shared. Choices:
|
|
Remote gateway type. Choices:
|
|
Enable/disable support for Cisco UNITY Configuration Method extensions. Choices:
|
|
User group name for dialup peers. Source user.group.name. |
|
VNI of VXLAN tunnel. |
|
GUI VPN Wizard Type. Choices:
|
|
XAuth type. Choices:
|
Examples
- collections:
- fortinet.fortios
connection: httpapi
hosts: fortigate01
vars:
ansible_httpapi_port: 443
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
vdom: root
tasks:
- name: fortios_vpn_ipsec_phase1_interface
fortios_vpn_ipsec_phase1_interface:
vdom: root
state: present
vpn_ipsec_phase1_interface:
acct_verify: disable
add_gw_route: disable
add_route: enable
aggregate_member: disable
aggregate_weight: 1
assign_ip: enable
assign_ip_from: range
authmethod: psk
auto_discovery_forwarder: disable
auto_discovery_psk: disable
auto_discovery_receiver: disable
auto_discovery_sender: disable
auto_discovery_shortcuts: independent
auto_negotiate: enable
cert_id_validation: enable
childless_ike: disable
client_auto_negotiate: disable
client_keep_alive: disable
default_gw: 0.0.0.0
default_gw_priority: 0
dhcp6_ra_linkaddr: '::'
dhcp_ra_giaddr: 0.0.0.0
dhgrp: '14'
digital_signature_auth: disable
distance: 15
dns_mode: manual
dpd: on-demand
dpd_retrycount: 3
dpd_retryinterval: '20'
eap: disable
eap_identity: use-id-payload
encap_local_gw4: 0.0.0.0
encap_local_gw6: '::'
encap_remote_gw4: 0.0.0.0
encap_remote_gw6: '::'
encapsulation: none
encapsulation_address: ike
enforce_unique_id: disable
exchange_interface_ip: disable
exchange_ip_addr4: 0.0.0.0
exchange_ip_addr6: '::'
fec_base: 20
fec_codec: 0
fec_egress: disable
fec_ingress: disable
fec_receive_timeout: 5000
fec_redundant: 10
fec_send_timeout: 8
forticlient_enforcement: disable
fragmentation: enable
fragmentation_mtu: 1200
group_authentication: disable
ha_sync_esp_seqno: enable
idle_timeout: disable
idle_timeoutinterval: 15
ike_version: '1'
include_local_lan: disable
interface: port3
ip_fragmentation: post-encapsulation
ip_version: '4'
ipv4_dns_server1: 0.0.0.0
ipv4_dns_server2: 0.0.0.0
ipv4_dns_server3: 0.0.0.0
ipv4_end_ip: 0.0.0.0
ipv4_netmask: 255.255.255.255
ipv4_start_ip: 0.0.0.0
ipv4_wins_server1: 0.0.0.0
ipv4_wins_server2: 0.0.0.0
ipv6_dns_server1: '::'
ipv6_dns_server2: '::'
ipv6_dns_server3: '::'
ipv6_end_ip: '::'
ipv6_prefix: 128
ipv6_start_ip: '::'
keepalive: 10
keylife: 86400
local_gw: 0.0.0.0
local_gw6: '::'
localid_type: auto
mesh_selector_type: disable
mode: main
mode_cfg: disable
monitor_hold_down_delay: 0
monitor_hold_down_time: 00:00
monitor_hold_down_type: immediate
monitor_hold_down_weekday: sunday
name: t0
nattraversal: enable
negotiate_timeout: 30
net_device: disable
network_id: 0
network_overlay: disable
passive_mode: disable
peertype: any
ppk: disable
priority: 0
proposal: aes128-sha256
psksecret: eweeeeeeeecee
reauth: disable
rekey: enable
remote_gw: 102.2.2.12
remote_gw6: '::'
rsa_signature_format: pkcs1
save_password: disable
send_cert_chain: enable
signature_hash_alg: sha2-512
suite_b: disable
tunnel_search: selectors
type: static
unity_support: enable
vni: 0
wizard_type: custom
xauthtype: disable
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Build number of the fortigate image Returned: always Sample: “1547” |
|
Last method used to provision the content into FortiGate Returned: always Sample: “PUT” |
|
Last result given by FortiGate on last operation applied Returned: always Sample: “200” |
|
Master key (id) used in the last call to FortiGate Returned: success Sample: “id” |
|
Name of the table used to fulfill the request Returned: always Sample: “urlfilter” |
|
Path of the table used to fulfill the request Returned: always Sample: “webfilter” |
|
Internal revision number Returned: always Sample: “17.0.2.10658” |
|
Serial number of the unit Returned: always Sample: “FGVMEVYYQT3AB5352” |
|
Indication of the operation’s result Returned: always Sample: “success” |
|
Virtual domain used Returned: always Sample: “root” |
|
Version of the FortiGate Returned: always Sample: “v5.6.3” |
Authors
Link Zheng (@chillancezen)
Jie Xue (@JieX19)
Hongbin Lu (@fgtdev-hblu)
Frank Shen (@frankshen01)
Miguel Angel Munoz (@mamunozgonzalez)
Nicolas Thomas (@thomnico)