fortinet.fortios.fortios_system_virtual_wan_link module – Configure redundant internet connections using SD-WAN (formerly virtual WAN link) in Fortinet’s FortiOS and FortiGate.
Note
This module is part of the fortinet.fortios collection (version 2.1.6).
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_system_virtual_wan_link
.
New in version 2.0.0: of fortinet.fortios
Synopsis
This module is able to configure a FortiGate or FortiOS (FOS) device by allowing the user to set and modify system feature and virtual_wan_link 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:
|
|
Configure redundant internet connections using SD-WAN (formerly virtual WAN link). |
|
Physical interfaces that will be alerted. |
|
Physical interface name. Source system.interface.name. |
|
Enable/disable SD-WAN Internet connection status checking (failure detection). Choices:
|
|
SD-WAN status checking or health checking. Identify a server on the Internet and determine how SD-WAN verifies that the FortiGate can communicate with it. |
|
Address mode (IPv4 or IPv6). Choices:
|
|
Differentiated services code point (DSCP) in the IP header of the probe packet. |
|
Number of failures before server is considered lost (1 - 3600). |
|
HA election priority (1 - 50). |
|
String in the http-agent field in the HTTP header. |
|
URL used to communicate with the server if the protocol if the protocol is HTTP. |
|
Response string expected from the server if the protocol is HTTP. |
|
Status check interval in milliseconds, or the time between attempting to connect to the server (500 - 3600*1000 msec). |
|
Member sequence number list. |
|
Member sequence number. Source system.virtual-wan-link.members.seq-num. |
|
Status check or health check name. |
|
Packet size of a twamp test session, |
|
Twamp controller password in authentication mode |
|
Port number used to communicate with the server over the selected protocol. |
|
Enable/disable transmission of probe packets. Choices:
|
|
Time to wait before a probe packet is considered lost (500 - 5000 msec). |
|
Protocol used to determine if the FortiGate can communicate with the server. Choices:
|
|
Number of successful responses received before server is considered recovered (1 - 3600). |
|
Twamp controller security mode. Choices:
|
|
IP address or FQDN name of the server. |
|
Service level agreement (SLA). |
|
SLA ID. |
|
Jitter for SLA to make decision in milliseconds. (0 - 10000000). |
|
Latency for SLA to make decision in milliseconds. (0 - 10000000). |
|
Criteria on which to base link selection. Choices:
|
|
Packet loss for SLA to make decision in percentage. (0 - 100). |
|
Time interval in seconds that SLA fail log messages will be generated (0 - 3600). |
|
Time interval in seconds that SLA pass log messages will be generated (0 - 3600). |
|
Alert threshold for jitter (ms). |
|
Alert threshold for latency (ms). |
|
Alert threshold for packet loss (percentage). |
|
Warning threshold for jitter (ms). |
|
Warning threshold for latency (ms). |
|
Warning threshold for packet loss (percentage). |
|
Enable/disable update cascade interface. Choices:
|
|
Enable/disable updating the static route. Choices:
|
|
Algorithm or mode to use for load balancing Internet traffic to SD-WAN members. Choices:
|
|
FortiGate interfaces added to the virtual-wan-link. |
|
Comments. |
|
Cost of this interface for services in SLA mode (0 - 4294967295). |
|
The default gateway for this interface. Usually the default gateway of the Internet service provider that this interface is connected to. |
|
IPv6 gateway. |
|
Ingress spillover threshold for this interface (0 - 16776000 kbit/s). When this traffic volume threshold is reached, new sessions spill over to other interfaces in the SD-WAN. |
|
Interface name. Source system.interface.name. |
|
Priority of the interface (0 - 4294967295). Used for SD-WAN rules or priority rules. |
|
Sequence number(1-255). |
|
Source IP address used in the health-check packet to the server. |
|
Source IPv6 address used in the health-check packet to the server. |
|
Egress spillover threshold for this interface (0 - 16776000 kbit/s). When this traffic volume threshold is reached, new sessions spill over to other interfaces in the SD-WAN. |
|
Enable/disable this interface in the SD-WAN. Choices:
|
|
Measured volume ratio (this value / sum of all values = percentage of link volume, 1 - 255). |
|
Weight of this interface for weighted load balancing. (1 - 255) More traffic is directed to interfaces with higher weights. |
|
Create SD-WAN neighbor from BGP neighbor table to control route advertisements according to SLA status. |
|
SD-WAN health-check name. Source system.virtual-wan-link.health-check.name. |
|
IP address of neighbor. Source router.bgp.neighbor.ip. |
|
Member sequence number. Source system.virtual-wan-link.members.seq-num. |
|
Role of neighbor. Choices:
|
|
SLA ID. |
|
Waiting period in seconds when switching from the primary neighbor to the secondary neighbor from the neighbor start. (0 - 10000000). |
|
Enable/disable hold switching from the secondary neighbor to the primary neighbor. Choices:
|
|
Waiting period in seconds when switching from the secondary neighbor to the primary neighbor when hold-down is disabled. (0 - 10000000). |
|
Create SD-WAN rules (also called services) to control how sessions are distributed to interfaces in the SD-WAN. |
|
Address mode (IPv4 or IPv6). Choices:
|
|
Coefficient of reciprocal of available bidirectional bandwidth in the formula of custom-profile-1. |
|
Enable/disable use of SD-WAN as default service. Choices:
|
|
Enable/disable forward traffic DSCP tag. Choices:
|
|
Forward traffic DSCP tag. |
|
Enable/disable reverse traffic DSCP tag. Choices:
|
|
Reverse traffic DSCP tag. |
|
Destination address name. |
|
Address or address group name. Source firewall.address.name firewall.addrgrp.name. |
|
Destination address6 name. |
|
Address6 or address6 group name. Source firewall.address6.name firewall.addrgrp6.name. |
|
Enable/disable negation of destination address match. Choices:
|
|
End destination port number. |
|
Enable/disable SD-WAN service gateway. Choices:
|
|
User groups. |
|
Group name. Source user.group.name. |
|
Health check. Source system.virtual-wan-link.health-check.name. |
|
Waiting period in seconds when switching from the back-up member to the primary member (0 - 10000000). |
|
Priority rule ID (1 - 4000). |
|
Source interface name. |
|
Interface name. Source system.interface.name. |
|
Enable/disable negation of input device match. Choices:
|
|
Enable/disable use of Internet service for application-based load balancing. Choices:
|
|
Application control based Internet Service ID list. |
|
Application control based Internet Service ID. |
|
Application control based Internet Service group list. |
|
Application control based Internet Service group name. Source application.group.name. |
|
Control-based Internet Service ID list. |
|
Control-based Internet Service ID. |
|
Control-based Internet Service group list. |
|
Control-based Internet Service group name. Source application.group.name. |
|
Custom Internet service name list. |
|
Custom Internet service name. Source firewall.internet-service-custom.name. |
|
Custom Internet Service group list. |
|
Custom Internet Service group name. Source firewall.internet-service-custom-group.name. |
|
Internet Service group list. |
|
Internet Service group name. Source firewall.internet-service-group.name. |
|
Internet service ID list. |
|
Internet service ID. Source firewall.internet-service.id. |
|
Coefficient of jitter in the formula of custom-profile-1. |
|
Coefficient of latency in the formula of custom-profile-1. |
|
Link cost factor. Choices:
|
|
Percentage threshold change of link cost values that will result in policy route regeneration (0 - 10000000). |
|
Member sequence number. Source system.virtual-wan-link.members.seq-num. |
|
Control how the priority rule sets the priority of interfaces in the SD-WAN. Choices:
|
|
Priority rule name. |
|
Coefficient of packet-loss in the formula of custom-profile-1. |
|
Member sequence number list. |
|
Member sequence number. Source system.virtual-wan-link.members.seq-num. |
|
Protocol number. |
|
Quality grade. |
|
Service role to work with neighbor. Choices:
|
|
IPv4 route map route-tag. |
|
Service level agreement (SLA). |
|
Virtual WAN Link health-check. Source system.virtual-wan-link.health-check.name. |
|
SLA ID. |
|
Method to compare SLA value for sla and load balance mode. Choices:
|
|
Source address name. |
|
Address or address group name. Source firewall.address.name firewall.addrgrp.name. |
|
Source address6 name. |
|
Address6 or address6 group name. Source firewall.address6.name firewall.addrgrp6.name. |
|
Enable/disable negation of source address match. Choices:
|
|
Enable/disable service when selected neighbor role is standalone while service role is not standalone. Choices:
|
|
Start destination port number. |
|
Enable/disable SD-WAN service. Choices:
|
|
Type of service bit pattern. |
|
Type of service evaluated bits. |
|
User name. |
|
User name. Source user.local.name. |
|
Enable/disable SD-WAN. Choices:
|
|
Configure SD-WAN zones. |
|
Zone name. |
|
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” |
Examples
- hosts: fortigates
collections:
- fortinet.fortios
connection: httpapi
vars:
vdom: "root"
ansible_httpapi_use_ssl: yes
ansible_httpapi_validate_certs: no
ansible_httpapi_port: 443
tasks:
- name: Configure redundant internet connections using SD-WAN (formerly virtual WAN link).
fortios_system_virtual_wan_link:
vdom: "{{ vdom }}"
system_virtual_wan_link:
fail_alert_interfaces:
-
name: "default_name_4 (source system.interface.name)"
fail_detect: "enable"
health_check:
-
addr_mode: "ipv4"
diffservcode: "<your_own_value>"
failtime: "9"
ha_priority: "10"
http_agent: "<your_own_value>"
http_get: "<your_own_value>"
http_match: "<your_own_value>"
interval: "14"
members:
-
seq_num: "16 (source system.virtual-wan-link.members.seq-num)"
name: "default_name_17"
packet_size: "18"
password: "<your_own_value>"
port: "20"
probe_packets: "disable"
probe_timeout: "22"
protocol: "ping"
recoverytime: "24"
security_mode: "none"
server: "192.168.100.40"
sla:
-
id: "28"
jitter_threshold: "29"
latency_threshold: "30"
link_cost_factor: "latency"
packetloss_threshold: "32"
sla_fail_log_period: "33"
sla_pass_log_period: "34"
threshold_alert_jitter: "35"
threshold_alert_latency: "36"
threshold_alert_packetloss: "37"
threshold_warning_jitter: "38"
threshold_warning_latency: "39"
threshold_warning_packetloss: "40"
update_cascade_interface: "enable"
update_static_route: "enable"
load_balance_mode: "source-ip-based"
members:
-
comment: "Comments."
cost: "46"
gateway: "<your_own_value>"
gateway6: "<your_own_value>"
ingress_spillover_threshold: "49"
interface: "<your_own_value> (source system.interface.name)"
priority: "51"
seq_num: "52"
source: "<your_own_value>"
source6: "<your_own_value>"
spillover_threshold: "55"
status: "disable"
volume_ratio: "57"
weight: "58"
neighbor:
-
health_check: "<your_own_value> (source system.virtual-wan-link.health-check.name)"
ip: "<your_own_value> (source router.bgp.neighbor.ip)"
member: "62 (source system.virtual-wan-link.members.seq-num)"
role: "standalone"
sla_id: "64"
neighbor_hold_boot_time: "65"
neighbor_hold_down: "enable"
neighbor_hold_down_time: "67"
service:
-
addr_mode: "ipv4"
bandwidth_weight: "70"
default: "enable"
dscp_forward: "enable"
dscp_forward_tag: "<your_own_value>"
dscp_reverse: "enable"
dscp_reverse_tag: "<your_own_value>"
dst:
-
name: "default_name_77 (source firewall.address.name firewall.addrgrp.name)"
dst_negate: "enable"
dst6:
-
name: "default_name_80 (source firewall.address6.name firewall.addrgrp6.name)"
end_port: "81"
gateway: "enable"
groups:
-
name: "default_name_84 (source user.group.name)"
health_check: "<your_own_value> (source system.virtual-wan-link.health-check.name)"
hold_down_time: "86"
id: "87"
input_device:
-
name: "default_name_89 (source system.interface.name)"
input_device_negate: "enable"
internet_service: "enable"
internet_service_app_ctrl:
-
id: "93"
internet_service_app_ctrl_group:
-
name: "default_name_95 (source application.group.name)"
internet_service_ctrl:
-
id: "97"
internet_service_ctrl_group:
-
name: "default_name_99 (source application.group.name)"
internet_service_custom:
-
name: "default_name_101 (source firewall.internet-service-custom.name)"
internet_service_custom_group:
-
name: "default_name_103 (source firewall.internet-service-custom-group.name)"
internet_service_group:
-
name: "default_name_105 (source firewall.internet-service-group.name)"
internet_service_id:
-
id: "107 (source firewall.internet-service.id)"
jitter_weight: "108"
latency_weight: "109"
link_cost_factor: "latency"
link_cost_threshold: "111"
member: "112 (source system.virtual-wan-link.members.seq-num)"
mode: "auto"
name: "default_name_114"
packet_loss_weight: "115"
priority_members:
-
seq_num: "117 (source system.virtual-wan-link.members.seq-num)"
protocol: "118"
quality_link: "119"
role: "standalone"
route_tag: "121"
sla:
-
health_check: "<your_own_value> (source system.virtual-wan-link.health-check.name)"
id: "124"
sla_compare_method: "order"
src:
-
name: "default_name_127 (source firewall.address.name firewall.addrgrp.name)"
src_negate: "enable"
src6:
-
name: "default_name_130 (source firewall.address6.name firewall.addrgrp6.name)"
standalone_action: "enable"
start_port: "132"
status: "enable"
tos: "<your_own_value>"
tos_mask: "<your_own_value>"
users:
-
name: "default_name_137 (source user.local.name)"
status: "disable"
zone:
-
name: "default_name_140"
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)