fortinet.fortios.fortios_firewall_vip module – Configure virtual IP for IPv4 in Fortinet’s FortiOS and FortiGate.
Note
This module is part of the fortinet.fortios collection (version 2.3.8).
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
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: fortinet.fortios.fortios_firewall_vip
.
New in fortinet.fortios 2.0.0
Synopsis
This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify firewall feature and vip 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.15
Parameters
Parameter |
Comments |
---|---|
Token-based authentication. Generated from GUI of Fortigate. |
|
Enable/Disable logging for task. Choices:
|
|
Configure virtual IP for IPv4. |
|
Enable/disable adding NAT46 route. Choices:
|
|
Enable to respond to ARP requests for this virtual IP address. Enabled by default. Choices:
|
|
Color of icon on the GUI. |
|
Comment. |
|
DNS mapping TTL (Set to zero to use TTL in DNS response). |
|
External FQDN address name. |
|
Address name. Source firewall.address.name firewall.addrgrp.name. |
|
Interface connected to the source network that receives the packets that will be forwarded to the destination network. Source system .interface.name. |
|
IP address or address range on the external interface that you want to map to an address or address range on the destination network. |
|
Incoming port number range that you want to map to a port number range on the destination network. |
|
Enable to have the VIP send gratuitous ARPs. 0=disabled. Set from 5 up to 8640000 seconds to enable. |
|
Domain to use when integrating with FortiGSLB. |
|
Hostname to use within the configured FortiGSLB domain. |
|
Publicly accessible IP addresses for the FortiGSLB service. |
|
Index of this public IP setting. see <a href=’#notes’>Notes</a>. |
|
The publicly accessible IP address. |
|
Enable/disable HTTP2 support . Choices:
|
|
Enable/disable HTTP3/QUIC support . Choices:
|
|
Time in minutes that client web browsers should keep a cookie. Default is 60 minutes. 0 = no time limit. |
|
Domain that HTTP cookie persistence should apply to. |
|
Enable/disable use of HTTP cookie domain from host field in HTTP. Choices:
|
|
Generation of HTTP cookie to be accepted. Changing invalidates all existing cookies. |
|
Limit HTTP cookie persistence to the specified path. |
|
Control sharing of cookies across virtual servers. Use of same-ip means a cookie from one virtual server can be used by another. Disable stops cookie sharing. Choices:
|
|
For HTTP multiplexing, enable to add the original client IP address in the XForwarded-For HTTP header. Choices:
|
|
For HTTP multiplexing, enter a custom HTTPS header name. The original client IP address is added to this header. If empty, X-Forwarded-For is used. |
|
Enable/disable HTTP multiplexing. Choices:
|
|
Maximum number of concurrent requests that a multiplex server can handle . |
|
Maximum number of requests that a multiplex server can handle before disconnecting sessions . |
|
Time-to-live for idle connections to servers. |
|
Enable/disable redirection of HTTP to HTTPS. Choices:
|
|
Maximum supported HTTP versions. default = HTTP2 Choices:
|
|
Enable/disable verification that inserted HTTPS cookies are secure. Choices:
|
|
Custom defined ID. |
|
Range of mapped IPv6 addresses. Specify the start IPv6 address followed by a space and the end IPv6 address. |
|
IPv6 port number range on the destination network to which the external port number range is mapped. |
|
Method used to distribute sessions to real servers. Choices:
|
|
Mapped FQDN address name. Source firewall.address.name. |
|
IP address or address range on the destination network to which the external IP address is mapped. |
|
Mapped IP range. |
|
Port number range on the destination network to which the external port number range is mapped. |
|
Maximum number of incomplete connections. |
|
Name of the health check monitor to use when polling to determine a virtual server”s connectivity status. |
|
Health monitor name. Source firewall.ldb-monitor.name. |
|
Virtual IP name. |
|
Enable/disable NAT44. Choices:
|
|
Enable/disable NAT46. Choices:
|
|
Enable/disable forcing the source NAT mapped IP to the external IP for all traffic. Choices:
|
|
Enable/disable one click GSLB server integration with FortiGSLB. Choices:
|
|
Enable to add the Front-End-Https header for Microsoft Outlook Web Access. Choices:
|
|
Configure how to make sure that clients connect to the same server every time they make a request that is part of the same session. Choices:
|
|
Enable/disable port forwarding. Choices:
|
|
Port mapping type. Choices:
|
|
Protocol to use when forwarding packets. Choices:
|
|
QUIC setting. |
|
ACK delay exponent (1 - 20). |
|
Active connection ID limit (1 - 8). |
|
Enable/disable active migration . Choices:
|
|
Enable/disable grease QUIC bit . Choices:
|
|
Maximum ACK delay in milliseconds (1 - 16383). |
|
Maximum datagram frame size in bytes (1 - 1500). |
|
Maximum idle timeout milliseconds (1 - 60000). |
|
Maximum UDP payload size in bytes (1200 - 1500). |
|
Select the real servers that this server load balancing VIP will distribute traffic to. |
|
Dynamic address of the real server. Source firewall.address.name. |
|
Only clients in this IP range can connect to this real server. |
|
Enable to check the responsiveness of the real server before forwarding traffic. Choices:
|
|
Time in seconds that the system waits before re-activating a previously down active server in the active-standby mode. This is to prevent any flapping issues. |
|
HTTP server domain name in HTTP header. |
|
Real server ID. see <a href=’#notes’>Notes</a>. |
|
IP address of the real server. |
|
Max number of active connections that can be directed to the real server. When reached, sessions are sent to other real servers. |
|
Name of the health check monitor to use when polling to determine a virtual server”s connectivity status. Source firewall .ldb-monitor.name. |
|
Health monitor name. Source firewall.ldb-monitor.name. |
|
Port for communicating with the real server. Required if port forwarding is enabled. |
|
Set the status of the real server to active so that it can accept traffic, or on standby or disabled so no traffic is sent. Choices:
|
|
Enable/disable translation of hostname/IP from virtual server to real server. Choices:
|
|
Type of address. Choices:
|
|
Weight of the real server. If weighted load balancing is enabled, the server with the highest weight gets more connections. |
|
Protocol to be load balanced by the virtual server (also called the server load balance virtual IP). Choices:
|
|
Service name. |
|
Service name. Source firewall.service.custom.name firewall.service.group.name. |
|
Source address filter. Each address must be either an IP/subnet (x.x.x.x/n) or a range (x.x.x.x-y.y.y.y). Separate addresses with spaces. |
|
Source-filter range. |
|
Enable/disable use of “src-filter” to match destinations for the reverse SNAT rule. Choices:
|
|
Interfaces to which the VIP applies. Separate the names with spaces. |
|
Interface name. Source system.interface.name. |
|
Enable/disable FFDHE cipher suite for SSL key exchange. Choices:
|
|
Permitted encryption algorithms for SSL sessions according to encryption strength. Choices:
|
|
The name of the certificate to use for SSL handshake. Source vpn.certificate.local.name. |
|
Name of the certificate to use for SSL handshake. |
|
Certificate list. Source vpn.certificate.local.name. |
|
SSL/TLS cipher suites acceptable from a client, ordered by priority. |
|
Cipher suite name. Choices:
|
|
SSL/TLS cipher suites priority. see <a href=’#notes’>Notes</a>. |
|
SSL/TLS versions that the cipher suite can be used with. Choices:
|
|
Enable/disable support for preventing Downgrade Attacks on client connections (RFC 7507). Choices:
|
|
Maximum length of data in MB before triggering a client rekey (0 = disable). |
|
Allow, deny, or require secure renegotiation of client sessions to comply with RFC 5746. Choices:
|
|
Maximum number of client to FortiGate SSL session states to keep. |
|
Number of minutes to keep client to FortiGate SSL session state. |
|
How to expire SSL sessions for the segment of the SSL connection between the client and the FortiGate. Choices:
|
|
Number of bits to use in the Diffie-Hellman exchange for RSA encryption of SSL sessions. Choices:
|
|
Enable/disable including HPKP header in response. Choices:
|
|
Number of seconds the client should honor the HPKP setting. |
|
Certificate to generate backup HPKP pin from. Source vpn.certificate.local.name vpn.certificate.ca.name. |
|
Indicate that HPKP header applies to all subdomains. Choices:
|
|
Certificate to generate primary HPKP pin from. Source vpn.certificate.local.name vpn.certificate.ca.name. |
|
URL to report HPKP violations to. |
|
Enable/disable including HSTS header in response. Choices:
|
|
Number of seconds the client should honor the HSTS setting. |
|
Indicate that HSTS header applies to all subdomains. Choices:
|
|
Enable to replace HTTP with HTTPS in the reply”s Location HTTP header field. Choices:
|
|
Enable/disable HTTP host matching for location conversion. Choices:
|
|
Highest SSL/TLS version acceptable from a client. Choices:
|
|
Lowest SSL/TLS version acceptable from a client. Choices:
|
|
Apply SSL offloading between the client and the FortiGate (half) or from the client to the FortiGate and from the FortiGate to the server (full). Choices:
|
|
Select the cipher suites that can be used for SSL perfect forward secrecy (PFS). Applies to both client and server sessions. Choices:
|
|
Enable/disable sending empty fragments to avoid CBC IV attacks (SSL 3.0 & TLS 1.0 only). May need to be disabled for compatibility with older systems. Choices:
|
|
Permitted encryption algorithms for the server side of SSL full mode sessions according to encryption strength. Choices:
|
|
SSL/TLS cipher suites to offer to a server, ordered by priority. |
|
Cipher suite name. Choices:
|
|
SSL/TLS cipher suites priority. see <a href=’#notes’>Notes</a>. |
|
SSL/TLS versions that the cipher suite can be used with. Choices:
|
|
Highest SSL/TLS version acceptable from a server. Use the client setting by default. Choices:
|
|
Lowest SSL/TLS version acceptable from a server. Use the client setting by default. Choices:
|
|
Enable/disable secure renegotiation to comply with RFC 5746. Choices:
|
|
Maximum number of FortiGate to Server SSL session states to keep. |
|
Number of minutes to keep FortiGate to Server SSL session state. |
|
How to expire SSL sessions for the segment of the SSL connection between the server and the FortiGate. Choices:
|
|
Enable/disable VIP. Choices:
|
|
Configure a static NAT, load balance, server load balance, access proxy, DNS translation, or FQDN VIP. Choices:
|
|
Universally Unique Identifier (UUID; automatically assigned but can be manually reset). |
|
Enable to add an HTTP header to indicate SSL offloading for a WebLogic server. Choices:
|
|
Enable to add an HTTP header to indicate SSL offloading for a WebSphere server. 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: |
Notes
Note
Legacy fortiosapi has been deprecated, httpapi is the preferred way to run playbooks
The module supports check_mode.
Examples
- name: Configure virtual IP for IPv4.
fortinet.fortios.fortios_firewall_vip:
vdom: "{{ vdom }}"
state: "present"
access_token: "<your_own_value>"
firewall_vip:
add_nat46_route: "disable"
arp_reply: "disable"
color: "0"
comment: "Comment."
dns_mapping_ttl: "0"
extaddr:
-
name: "default_name_9 (source firewall.address.name firewall.addrgrp.name)"
extintf: "<your_own_value> (source system.interface.name)"
extip: "<your_own_value>"
extport: "<your_own_value>"
gratuitous_arp_interval: "0"
gslb_domain_name: "<your_own_value>"
gslb_hostname: "myhostname"
gslb_public_ips:
-
index: "<you_own_value>"
ip: "<your_own_value>"
h2_support: "enable"
h3_support: "enable"
http_cookie_age: "60"
http_cookie_domain: "<your_own_value>"
http_cookie_domain_from_host: "disable"
http_cookie_generation: "0"
http_cookie_path: "<your_own_value>"
http_cookie_share: "disable"
http_ip_header: "enable"
http_ip_header_name: "<your_own_value>"
http_multiplex: "enable"
http_multiplex_max_concurrent_request: "0"
http_multiplex_max_request: "0"
http_multiplex_ttl: "15"
http_redirect: "enable"
http_supported_max_version: "http1"
https_cookie_secure: "disable"
id: "36"
ipv6_mappedip: "<your_own_value>"
ipv6_mappedport: "<your_own_value>"
ldb_method: "static"
mapped_addr: "<your_own_value> (source firewall.address.name)"
mappedip:
-
range: "<your_own_value>"
mappedport: "<your_own_value>"
max_embryonic_connections: "1000"
monitor:
-
name: "default_name_46 (source firewall.ldb-monitor.name)"
name: "default_name_47"
nat_source_vip: "disable"
nat44: "disable"
nat46: "disable"
one_click_gslb_server: "disable"
outlook_web_access: "disable"
persistence: "none"
portforward: "disable"
portmapping_type: "1-to-1"
protocol: "tcp"
quic:
ack_delay_exponent: "3"
active_connection_id_limit: "2"
active_migration: "enable"
grease_quic_bit: "enable"
max_ack_delay: "25"
max_datagram_frame_size: "1500"
max_idle_timeout: "30000"
max_udp_payload_size: "1500"
realservers:
-
address: "<your_own_value> (source firewall.address.name)"
client_ip: "<your_own_value>"
healthcheck: "disable"
holddown_interval: "300"
http_host: "myhostname"
id: "72"
ip: "<your_own_value>"
max_connections: "0"
monitor:
-
name: "default_name_76 (source firewall.ldb-monitor.name)"
port: "0"
status: "active"
translate_host: "enable"
type: "ip"
weight: "1"
server_type: "http"
service:
-
name: "default_name_84 (source firewall.service.custom.name firewall.service.group.name)"
src_filter:
-
range: "<your_own_value>"
src_vip_filter: "disable"
srcintf_filter:
-
interface_name: "<your_own_value> (source system.interface.name)"
ssl_accept_ffdhe_groups: "enable"
ssl_algorithm: "high"
ssl_certificate: "<your_own_value> (source vpn.certificate.local.name)"
ssl_certificate_dict:
-
name: "default_name_94 (source vpn.certificate.local.name)"
ssl_cipher_suites:
-
cipher: "TLS-AES-128-GCM-SHA256"
priority: "<you_own_value>"
versions: "ssl-3.0"
ssl_client_fallback: "disable"
ssl_client_rekey_count: "0"
ssl_client_renegotiation: "allow"
ssl_client_session_state_max: "1000"
ssl_client_session_state_timeout: "30"
ssl_client_session_state_type: "disable"
ssl_dh_bits: "768"
ssl_hpkp: "disable"
ssl_hpkp_age: "5184000"
ssl_hpkp_backup: "<your_own_value> (source vpn.certificate.local.name vpn.certificate.ca.name)"
ssl_hpkp_include_subdomains: "disable"
ssl_hpkp_primary: "<your_own_value> (source vpn.certificate.local.name vpn.certificate.ca.name)"
ssl_hpkp_report_uri: "<your_own_value>"
ssl_hsts: "disable"
ssl_hsts_age: "5184000"
ssl_hsts_include_subdomains: "disable"
ssl_http_location_conversion: "enable"
ssl_http_match_host: "enable"
ssl_max_version: "ssl-3.0"
ssl_min_version: "ssl-3.0"
ssl_mode: "half"
ssl_pfs: "require"
ssl_send_empty_frags: "enable"
ssl_server_algorithm: "high"
ssl_server_cipher_suites:
-
cipher: "TLS-AES-128-GCM-SHA256"
priority: "<you_own_value>"
versions: "ssl-3.0"
ssl_server_max_version: "ssl-3.0"
ssl_server_min_version: "ssl-3.0"
ssl_server_renegotiation: "enable"
ssl_server_session_state_max: "100"
ssl_server_session_state_timeout: "60"
ssl_server_session_state_type: "disable"
status: "disable"
type: "static-nat"
uuid: "<your_own_value>"
weblogic_server: "disable"
websphere_server: "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: |
|
Last method used to provision the content into FortiGate Returned: always Sample: |
|
Last result given by FortiGate on last operation applied Returned: always Sample: |
|
Master key (id) used in the last call to FortiGate Returned: success Sample: |
|
Name of the table used to fulfill the request Returned: always Sample: |
|
Path of the table used to fulfill the request Returned: always Sample: |
|
Internal revision number Returned: always Sample: |
|
Serial number of the unit Returned: always Sample: |
|
Indication of the operation’s result Returned: always Sample: |
|
Virtual domain used Returned: always Sample: |
|
Version of the FortiGate Returned: always Sample: |