SDWAN Advanced – FortiOS 6.2.0

Per packet distribution and tunnel aggregation

This topic shows an example of how to aggregate IPSec tunnels. This example shows how to make per-packet loadbalancing among IPSec tunnels.

For example, a customer has two ISP connections, wan1 and wan2. Using these two connections, we create two VPN interfaces and configure traffic for per-packet load-balancing among IPSec tunnels.

This feature only allows static/DDNS tunnels to be members.

Dynamic (dialup) tunnels are not allowed because dialup instances tend to have different locations and hence different routings. This conflicts with the rule that all the members of an aggregate must have the same routing.

Sample topology

Sample configuration

On the FortiGate, first create two IPsec VPN interfaces. Then create an ipsec-aggregate interface and add this interface as an SD-WAN member.

FortiGate 1 configuration

To create two IPsec VPN interfaces on FortiGate 1:

config vpn ipsec phase1-interface edit “vd1-p1” set interface “wan1” set peertype any set net-device disable set proposal aes256-sha256 set dhgrp 14 set remote-gw 172.16.201.2 set psksecret ftnt1234

next edit “vd1-p2” set interface “wan2” set peertype any set net-device disable set proposal aes256-sha256 set dhgrp 14 set remote-gw 172.16.202.2 set psksecret ftnt1234

next

end

config vpn ipsec phase2-interface edit “vd1-p1” set phase1name “vd1-p1”

next edit “vd1-p2” set phase1name “vd1-p2”

next

end

To create an ipsec-aggregate interface on FortiGate 1:

config system ipsec-aggregate edit “agg1”

set member “vd1-p1” “vd1-p2” set algorithm L3

next

end config system interface edit “agg1”

set vdom “root” set ip 172.16.11.1 255.255.255.255 set allowaccess ping set remote-ip 172.16.11.2 255.255.255.255

end

To configure the firewall policy on FortiGate 1:

config firewall policy edit 1

set name “1” set srcintf “dmz” set dstintf “”virtual-wan-link”” set srcaddr “all” set dstaddr “all” set action accept set schedule “always” set service “ALL” set nat enable

next

end

To configure SD-WAN on FortiGate 1:

config system virtual-wan-link

set status enable config members

edit 1

set interface “agg1” set gateway 172.16.11.2

next end

end

FortiGate 2 configuration

To create two IPsec VPN interfaces on FortiGate 2:

config vpn ipsec phase1-interface

edit “vd2-p1”

set interface “wan1” set peertype any set net-device disable set proposal aes256-sha256 set dhgrp 14 set remote-gw 172.16.200.1 set psksecret ftnt1234

next edit “vd2-p2” set interface “wan2” set peertype any set net-device disable set proposal aes256-sha256 set dhgrp 14 set remote-gw 172.16.203.1 set psksecret ftnt1234

next

end

config vpn ipsec phase2-interface edit “vd2-p1”

set phase1name “vd2-p1”

next edit “vd2-p2”

set phase1name “vd2-p2”

next

end

To create an ipsec-aggregate interface on FortiGate 2:

config system ipsec-aggregate

edit “agg2”

set member “vd2-p1” “vd2-p2” set algorithm L3

next

end config system interface edit “agg2”

set vdom “root” set ip 172.16.11.2 255.255.255.255 set allowaccess ping set remote-ip 172.16.11.1 255.255.255.255

next

end

To configure the firewall policy on FortiGate 2:

config firewall policy edit 1

set name “1” set srcintf “dmz” set dstintf “”virtual-wan-link”” set srcaddr “all” set dstaddr “all” set action accept set schedule “always” set service “ALL” set nat enable

next

end

To configure SD-WAN on FortiGate 2:

config system virtual-wan-link

set status enable config members edit 1 set interface “agg2” set gateway 172.16.11.1

next

end

end

To use the diagnose command to display aggregate IPSec members:

# diagnose sys ipsec-aggregate list agg1 algo=L3 member=2 run_tally=2 members:

vd1-p1 vd1-p2

To use the diagnose command to check VPN status:

# diagnose vpn tunnel list

list all ipsec tunnel in vd 0

—————————————————–name=vd1-p1 ver=1 serial=2 172.16.200.1:0->172.16.201.2:0 dst_mtu=0

bound_if=10 lgwy=static/1 tun=intf/0 mode=auto/1 encap=none/520 options[0208]=npu frag-rfc run_state=1 accept_traffic=0

proxyid_num=1 child_num=0 refcnt=5 ilast=15 olast=676 ad=/0 stat: rxp=0 txp=0 rxb=0 txb=0

dpd: mode=on-demand on=1 idle=20000ms retry=3 count=0 seqno=0 natt: mode=none draft=0 interval=0 remote_port=0 proxyid=vd1-p1 proto=0 sa=0 ref=1 serial=1

src: 0:0.0.0.0/0.0.0.0:0 dst: 0:0.0.0.0/0.0.0.0:0

——————————————————

name=vd1-p2 ver=1 serial=3 172.16.203.1:0->172.16.202.2:0 dst_mtu=1500

bound_if=28 lgwy=static/1 tun=intf/0 mode=auto/1 encap=none/520 options[0208]=npu frag-rfc run_state=1 accept_traffic=1

proxyid_num=1 child_num=0 refcnt=12 ilast=1 olast=1 ad=/0 stat: rxp=1 txp=1686 rxb=16602 txb=111717

dpd: mode=on-demand on=1 idle=20000ms retry=3 count=0 seqno=0 natt: mode=none draft=0 interval=0 remote_port=0 proxyid=vd1-p2 proto=0 sa=1 ref=9 serial=1

src: 0:0.0.0.0/0.0.0.0:0 dst: 0:0.0.0.0/0.0.0.0:0

SA: ref=4 options=10226 type=00 soft=0 mtu=1438 expire=42164/0B replaywin=2048 seqno=697 esn=0 replaywin_lastseq=00000002 itn=0 qat=0

life: type=01 bytes=0/0 timeout=42902/43200

dec: spi=f6ae9f83 esp=aes key=16 f6855c72295e3c5c49646530e6b96002 ah=sha1 key=20 f983430d6c161d0a4cd9007c7ae057f1ff011334

enc: spi=8c72ba1a esp=aes key=16 6330f8c532a6ca5c5765f6a9a6034427 ah=sha1 key=20 e5fe385ed5f0f6a33f1d507601b15743a8c70187

dec:pkts/bytes=1/16536, enc:pkts/bytes=1686/223872

npu_flag=02 npu_rgwy=172.16.202.2 npu_lgwy=172.16.203.1 npu_selid=2 dec_npuid=1 enc_npuid=0

SD-WAN traffic shaping and QoS with SD-WAN

SD-WAN traffic shaping and QoS with SD-WAN

Use traffic shaper in a firewall shaping policy to control traffic flow. You can use it to control maximum and guaranteed bandwidth, or put certain traffic to one of the three different traffic priorities: high, medium, or low.

An advanced shaping policy can classify traffic into 30 groups. Use a shaping profile to define the percentage of the interface bandwidth that is allocated to each group. Each group of traffic is shaped to the assigned speed limit based on the outgoing bandwidth limit configured on the interface.

For more information, see the online help on shared policy traffic shaping and interface-based traffic shaping.

Sample topology

Sample configuration

This example shows a typical customer usage where the customer’s SD-WAN has two member: wan1 and wan2 and each is 10Mb/s.

An overview of the procedures to configure SD-WAN traffic shaping and QoS with SD-WAN includes:

  1. Give HTTP/HTTPS traffic high priority and give FTP low priority so that if there are conflicts, FortiGate will forward HTTP/HTTPS traffic first.
  2. Even though FTP has low priority, configure FortiGate to give it a 1Mb/s guaranteed bandwidth on each SD-WAN member so that if there is no FTP traffic, other traffic can use all the bandwidth. If there is heavy FTP traffic, it can still be guaranteed a 1Mb/s bandwidth.
  3. Traffic going to specific destinations such as a VOIP server uses wan1 to forward, and SD-WAN forwards with an Expedited Forwarding (EF) DSCP tag 101110.

To configure SD-WAN traffic shaping and QoS with SD-WAN in the GUI:

  1. On the FortiGate, enable SD-WAN and add wan1 and wan2 as SD-WAN members, then add a policy and static route.

See Creating the SD-WAN interface on page 105.

  1. When you add a firewall policy, enable Application Control.
  2. Go to Policy & Objects > Traffic Shapers and edit low-priority.
    1. Enable Guaranteed Bandwidth and set it to 1000
  3. Go to Policy & Objects > Traffic Shaping Policy and click Create New.
    1. Name the traffic shaping policy, for example, HTTP-HTTPS.
    2. Click the Source box and select all.
    3. Click the Destination box and select all.
    4. Click the Service box and select HTTP and HTTPS.
    5. Click the Outgoing Interface box and select SD-WAN.
    6. Enable both Shared Shaper and Reverse Shaper and select high-priority for both options. Click OK.
  4. Go to Policy & Objects > Traffic Shaping Policy and click Create New.
    1. Name the traffic shaping policy, for example, FTP.
    2. Click the Source box and select all.
    3. Click the Destination box and select all.
    4. Click the Service box and select FTP, FTP_GET, and FTP_PUT.
    5. Click the Outgoing Interface box and select SD-WAN.
    6. Enable both Shared Shaper and Reverse Shaper and select low-priority for both options. Click OK
  5. Go to Network > SD-WAN Rules and click Create New.
    1. Enter a name for the rule, such as Internet.
    2. In the Destination section, click the Address box and select the VOIP server you created in the firewall address.
    3. For Strategy, select Manual.
    4. For Interface preference, select wan1.
    5. Click OK.
  6. Use CLI commands to modify DSCP settings. See the DSCP CLI commands below.

To configure the firewall policy using the CLI:

config firewall policy edit 1 set name “1” set srcintf “dmz” set dstintf “”virtual-wan-link”” set srcaddr “all” set dstaddr “all” set action accept set schedule “always” set service “ALL” set nat enable

next

end

To configure the firewall traffic shaper priority using the CLI:

config firewall shaper traffic-shaper edit “high-priority” set maximum-bandwidth 1048576 set per-policy enable

next edit “low-priority” set guaranteed-bandwidth 1000 set maximum-bandwidth 1048576 set priority low set per-policy enable

next

end

To configure the firewall traffic shaping policy using the CLI:

config firewall shaping-policy edit 1 set name “http-https” set service “HTTP” “HTTPS” set dstintf “virtual-wan-link” set traffic-shaper “high-priority” set traffic-shaper-reverse “high-priority”

set srcaddr “all” set dstaddr “all” next edit 2 set name “FTP” set service “FTP” “FTP_GET” “FTP_PUT” set dstintf “virtual-wan-link” set traffic-shaper “low-priority” set traffic-shaper-reverse “low-priority”

set srcaddr “all” set dstaddr “all”

next

end

To configure SD-WAN traffic shaping and QoS with SD-WAN in the CLI:

config system virtual-wan-link set status enable config members edit 1 set interface “wan1” set gateway x.x.x.x

next edit 2 set interface “wan2” set gateway x.x.x.x

next

end config service edit 1 set name “SIP” set member 1 set dst “voip-server” set dscp-forward enable set dscp-forward-tag 101110

next

end

end

To use the diagnose command to check if specific traffic is attached to the correct traffic shaper:

# diagnose firewall iprope list 100015

policy index=1 uuid_idx=0 action=accept flag (0):

shapers: orig=high-priority(2/0/134217728) reply=high-priority(2/0/134217728) cos_fwd=0 cos_rev=0 group=00100015 av=00000000 au=00000000 split=00000000 host=0 chk_client_info=0x0 app_list=0 ips_view=0 misc=0 dd_type=0 dd_mode=0 zone(1): 0 -> zone(2): 36 38

source(1): 0.0.0.0-255.255.255.255, uuid_idx=6, dest(1): 0.0.0.0-255.255.255.255, uuid_idx=6, service(2):

[6:0x0:0/(1,65535)->(80,80)] helper:auto

[6:0x0:0/(1,65535)->(443,443)] helper:auto policy index=2 uuid_idx=0 action=accept

flag (0):

shapers: orig=low-priority(4/128000/134217728) reply=low-priority(4/128000/134217728) cos_fwd=0 cos_rev=0 group=00100015 av=00000000 au=00000000 split=00000000 host=0 chk_client_info=0x0 app_list=0 ips_view=0 misc=0 dd_type=0 dd_mode=0 zone(1): 0 -> zone(2): 36 38

source(1): 0.0.0.0-255.255.255.255, uuid_idx=6, dest(1): 0.0.0.0-255.255.255.255, uuid_idx=6, service(3):

[6:0x0:0/(1,65535)->(21,21)] helper:auto

[6:0x0:0/(1,65535)->(21,21)] helper:auto

[6:0x0:0/(1,65535)->(21,21)] helper:auto

FGT_A (root) #

To use the diagnose command to check if the correct traffic shaper is applied to the session:

# dia sys session list

session info: proto=6 proto_state=01 duration=11 expire=3599 timeout=3600 flags=00000000 sockflag=00000000 sockport=0 av_idx=0 use=5

origin-shaper=low-priority prio=4 guarantee 128000Bps max 1280000Bps traffic 1050Bps drops 0B reply-shaper= per_ip_shaper=

class_id=0 shaping_policy_id=2 ha_id=0 policy_dir=0 tunnel=/ helper=ftp vlan_cos=0/255 state=may_dirty npu npd os mif route_preserve

statistic(bytes/packets/allow_err): org=868/15/1 reply=752/10/1 tuples=2

tx speed(Bps/kbps): 76/0 rx speed(Bps/kbps): 66/0 orgin->sink: org pre->post, reply pre->post dev=39->38/38->39 gwy=172.16.200.55/0.0.0.0 hook=post dir=org act=snat 10.1.100.11:58241->172.16.200.55:21(172.16.200.1:58241) hook=pre dir=reply act=dnat 172.16.200.55:21->172.16.200.1:58241(10.1.100.11:58241) pos/(before,after) 0/(0,0), 0/(0,0) misc=0 policy_id=1 auth_info=0 chk_client_info=0 vd=4 serial=0003255f tos=ff/ff app_list=0 app=0 url_cat=0 rpdb_link_id = 00000000 dd_type=0 dd_mode=0 npu_state=0x100000

npu info: flag=0x00/0x00, offload=0/0, ips_offload=0/0, epid=0/0, ipid=0/0, vlan=0x0000/0x0000 vlifid=0/0, vtag_in=0x0000/0x0000 in_npu=0/0, out_npu=0/0, fwd_en=0/0, qid=0/0 no_ofld_reason: offload-denied helper total session 1

To use the diagnose command to check the status of a shared traffic shaper:

# diagnose firewall shaper traffic-shaper list

name high-priority maximum-bandwidth 131072 KB/sec guaranteed-bandwidth 0 KB/sec current-bandwidth 0 B/sec priority 2 tos ff packets dropped 0 bytes dropped 0 name low-priority maximum-bandwidth 131072 KB/sec guaranteed-bandwidth 125 KB/sec current-bandwidth 0 B/sec priority 4 tos ff packets dropped 0 bytes dropped 0

name high-priority maximum-bandwidth 131072 KB/sec guaranteed-bandwidth 0 KB/sec current-bandwidth 0 B/sec priority 2 policy 1 tos ff packets dropped 0 bytes dropped 0

name low-priority maximum-bandwidth 131072 KB/sec guaranteed-bandwidth 125 KB/sec current-bandwidth 0 B/sec priority 4 policy 2 tos ff packets dropped 0 bytes dropped 0

WAN path control – FortiOS 6.2

WAN path control

Performace SLA – link monitoring

Performance SLA link monitoring measures the health of links that are connected to SD-WAN member interfaces by sending probing signals through each link to a server and measuring the link quality based on latency, jitter, and packet loss. If a link is broken, the routes on that link are removed, and traffic is routed through other links. When the link is working again, the routes are reenabbled. This prevents traffic being sent to a broken link and lost.

In this example:

l Interfaces wan1 and wan2 connect to the internet through separate ISPs l The detection server IP address is 208.91.114.182

A performance SLA is created so that, if one link fails, its routes are removed and traffic is detoured to the other link.

To configure a Performance SLA using the GUI:

  1. On the FortiGate, enable SD-WAN and add wan1 and wan2 as SD-WAN members, then add a policy and static route. See Creating the SD-WAN interface on page 105 for details.
  2. Go to Network > Performance SLA.
  3. Click Create New. The Performance SLA page opens.
  4. Enter a name for the SLA and select a protocol.
  5. In the Server field, enter the detection server IP address (208.91.114.182 in this example).
  6. In the Participants field, select both wan1 and wan2.
  7. Configured the remaining settings as needed, then click OK.

To configure a Performance SLA using the CLI:

config system virtual-wan-link config health-check edit “server” set server “208.91.114.182”

set update-static-route enable

set members 1 2 next

end

end

To diagnose the Performance SLA status:

FGT # diagnose sys virtual-wan-link health-check Health Check(server):

Seq(1): state(alive), packet-loss(0.000%) latency(15.247), jitter(5.231) sla_map=0x0

Seq(2): state(alive), packet-loss(0.000%) latency(13.621), jitter(6.905) sla_map=0x0

Performace SLA – SLA targets

SLA targets are a set of constraints that are used in SD-WAN rules to control the paths that traffic take.

The available constraints are:

  • Latency threshold: Latency for SLA to make decision, in milliseconds (0 – 10000000, default = 5).
  • Jitterthreshold: Jitter for SLA to make decision, in milliseconds (0 – 10000000, default = 5). l Packet loss threshold: Packet loss for SLA to make decision, in percentage (0 – 100, default = 0).

To configure Performance SLA targets using the GUI:

  1. On the FortiGate, enable SD-WAN and add wan1 and wan2 as SD-WAN members, then add a policy and static route. See Creating the SD-WAN interface on page 105 for details.
  2. Go to Network > Performance SLA.
  3. Create a new Performance SLA or edit an existing one. See Performace SLA – link monitoring on page 114.
  4. Under SLA Targets, click the plus icon to add a target.
  5. Turn on or off the required constraints, and set their values.
  6. Configured the remaining settings as needed, then click OK.

To configure Performance SLA targets using the GUI:

config system virtual-wan-link config health-check edit “server” set server “208.91.114.182”

set members 1 2 config sla edit 1 set link-cost-factor latency jitter packet-loss set latency-threshold 10 set jitter-threshold 10 set packetloss-threshold 1

next

end

next

end

end

The link-cost-factor variable is used to select which constraints are enabled.

SD-WAN rules – best quality

SD-WAN rules are used to control how sessions are distributed to SD-WAN members. Rules can be configured in one of five modes:

  • auto: Interfaces are assigned a priority based on quality. l Manual (manual): Interfaces are manually assigned a priority. l Best Quality (priority): Interface are assigned a priority based on the link-cost-factor of the interface.
  • Lowest Cost (SLA) (sla): Interfaces are assigned a priority based on selected SLA settings. See SD-WAN rules lowest cost (SLA) on page 119.
  • Maximize Bandwith (SLA) (load-balance): Traffic is distributed among all available links based on the selected load balancing algorithm. See SD-WAN rules – maximize bandwidth (SLA) on page 121.

When using Best Quality mode, SD-WAN will choose the best link to forward traffic by comparing the link-cost-factor, selected from one of the following:

GUI CLI Description
Latency latency Select a link based on latency.
Jitter jitter Select a link based on jitter.
Packet Loss packet-loss Select a link based on packet loss.
Downstream inbandwidth Select a link based on available bandwidth of incoming traffic.
Upstream outbandwidth Select a link based on available bandwidth of outgoing traffic.
Bandwidth bibandwidth Select a link based on available bandwidth of bidirectional traffic.
custom-profile-1 custom-profile-1 Select link based on customized profile. If selected, set the following weights: l packet-loss-weight: Coefficient of packet-loss. l latency-weight: Coefficient of latency. l jitter-weight: Coefficient of jitter.

l bandwidth-weight: Coefficient of reciprocal of available bidirectional bandwidth.

In this example, your wan1 and wan2 SD-WAN interfaces connect to two ISPs that both go to the public internet, and you want Gmail services to use the link with the least latency.

To configure an SD-WAN rule to use Best Quality:

  1. On the FortiGate, enable SD-WAN and add wan1 and wan2 as SD-WAN members, then add a policy and static route. See Creating the SD-WAN interface on page 105 for details.
  2. Create a new Performance SLA named google. See Performace SLA – link monitoring on page 114.
  3. Go to Network > SD-WAN Rules.
  4. Click Create New. The Priority Rule page opens.
  5. Enter a name for the rule, such as gmail.
  6. Configure the following settings:
Field Setting
Internet Service Google-Gmail
Strategy Best Quality
Interface preference wan1 and wan2
Measured SLA google (created in step 2).
Quality criteria Latency
  1. Click OK to create the rule.

To configure an SD-WAN rule to use priority:

config system virtual-wan-link config health-check edit “google”

set server “google.com”

set members 1 2 next

end config service

edit 1

set name “gmail” set mode priority set internet-service enable set internet-service-id 65646 set health-check “google” set link-cost-factor latency set priority-members 1 2

next

end

end

To diagnose the Performance SLA status:

FGT # diagnose sys virtual-wan-link health-check google Health Check(google):

Seq(1): state(alive), packet-loss(0.000%) latency(14.563), jitter(4.334) sla_map=0x0

Seq(2): state(alive), packet-loss(0.000%) latency(12.633), jitter(6.265) sla_map=0x0

FGT # diagnose sys virtual-wan-link service 1 Service(1):

TOS(0x0/0x0), protocol(0: 1->65535), Mode(priority), link-cost-facotr(latency), link-costthreshold(10), health-check(google) Members:

1: Seq_num(2), alive, latency: 12.633, selected

2: Seq_num(1), alive, latency: 14.563, selected

Internet Service: Google-Gmail(65646)

As wan2 has a smaller latency, SD-WAN will put Seq_num(2) on top of Seq_num(1) and wan2 will be used to forward

Gmail traffic.

SD-WAN rules – lowest cost (SLA)

SD-WAN rules are used to control how sessions are distributed to SD-WAN members. Rules can be configured in one of five modes:

  • auto: Interfaces are assigned a priority based on quality. l Manual (manual): Interfaces are manually assigned a priority.
  • Best Quality (priority): Interface are assigned a priority based on the link-cost-factor of the interface. See SDWAN rules – best quality on page 116.
  • Lowest Cost (SLA) (sla): Interfaces are assigned a priority based on selected SLA settings.
  • Maximize Bandwidth (SLA) (load-balance): Traffic is distributed among all available links based on the selected load balancing algorithm. See SD-WAN rules – maximize bandwidth (SLA) on page 121.

When using Lowest Cost (SLA) mode (sla in the CLI), SD-WAN will choose the lowest cost link that satisfies SLA to forward traffic.

In this example, your wan1 and wan2 SD-WAN interfaces connect to two ISPs that both go to the public internet. The cost of wan2 is less than that of wan1. You want to configure Gmail services to use the lowest cost interface, but the link quality must meet a standard of latency: 10ms, and jitter: 5ms.

To configure an SD-WAN rule to use Lowest Cost (SLA):

  1. On the FortiGate, enable SD-WAN and add wan1 and wan2 as SD-WAN members, then add a policy and static route. See Creating the SD-WAN interface on page 105 for details.
  2. Create a new Performance SLA named google that includes an SLA Target 1 with Latency threshold = 10ms and Jitterthreshold = 5ms. See Performace SLA – link monitoring on page 114.
  3. Go to Network > SD-WAN Rules.
  4. Click Create New. The Priority Rule page opens.
  5. Enter a name for the rule, such as gmail.
  6. Configure the following settings:
Field Setting
Internet Service Google-Gmail
Strategy Lowest Cost (SLA)
Interface preference wan1 and wan2
Required SLA target google#1 (created in step 2).
  1. Click OK to create the rule.

To configure an SD-WAN rule to use sla:

config system virtual-wan-link config members edit 1 set interface “wan1”

set cost 10 next edit 2 set interface “wan2”

set cost 5 next

end

config health-check edit “google” set server “google.com” set members 1 2 config sla edit 1 set latency-threshold 10

set jitter-threshold 5

next

end

next

end config service edit 1 set name “gmail” set mode sla set internet-service enable set internet-service-id 65646 config sla edit “google” set id 1

next

end

set priority-members 1 2

next

end

end

To diagnose the Performance SLA status:

FGT # diagnose sys virtual-wan-link health-check google Health Check(google):

Seq(1): state(alive), packet-loss(0.000%) latency(14.563), jitter(4.334) sla_map=0x0

Seq(2): state(alive), packet-loss(0.000%) latency(12.633), jitter(6.265) sla_map=0x0

FGT # diagnose sys virtual-wan-link service 1

Service(1): Address Mode(IPV4) flags=0x0

TOS(0x0/0x0), Protocol(0: 1->65535), Mode(sla)

Members:<<BR>>

1: Seq_num(2), alive, sla(0x1), cfg_order(1), selected

2: Seq_num(1), alive, sla(0x1), cfg_order(0), selected

Internet Service: Google.Gmail(65646)

When both wan1 and wan2 meet the SLA requirements, Gmail traffic will only use wan2. If only wan1 meets the SLA requirements, Gmail traffic will only use wan1, even though it has a higher cost. If neither interface meets the requirements, wan2 will be used.

If both interface had the same cost and both met the SLA requirements, the first link configured in set prioritymembers would be used.

SD-WAN rules – maximize bandwidth (SLA)

SD-WAN rules are used to control how sessions are distributed to SD-WAN members. Rules can be configured in one of five modes:

  • auto: Interfaces are assigned a priority based on quality. l Manual (manual): Interfaces are manually assigned a priority. l Best Quality (priority): Interface are assigned a priority based on the link-cost-factor of the interface. See SDWAN rules – best quality on page 116. l Lowest Cost (SLA) (sla): Interfaces are assigned a priority based on selected SLA settings. See SD-WAN rules lowest cost (SLA) on page 119.
  • Maximize Bandwidth (SLA) (load-balance): Traffic is distributed among all available links based on the selected load balancing algorithm.

When using Maximize Bandwidth mode (load balance in the CLI), SD-WAN will all of the links that satisfies SLA to forward traffic based on a round-robin load balancing algorithm.

In this example, your wan1 and wan2 SD-WAN interfaces connect to two ISPs that both go to the public internet. You want to configure Gmail services to use both of the interface, but the link quality must meet a standard of latency: 10ms, and jitter: 5ms. This can maximize the bandwidth usage.

To configure an SD-WAN rule to use Maximize Bandwidth (SLA):

  1. On the FortiGate, enable SD-WAN and add wan1 and wan2 as SD-WAN members, then add a policy and static route. See Creating the SD-WAN interface on page 105 for details.
  2. Create a new Performance SLA named google that includes an SLA Target 1 with Latency threshold = 10ms and Jitterthreshold = 5ms. See Performace SLA – link monitoring on page 114.
  3. Go to Network > SD-WAN Rules.
  4. Click Create New. The Priority Rule page opens.
  5. Enter a name for the rule, such as gmail.
  6. Configure the following settings:
Field Setting
Internet Service Google-Gmail
Strategy Maximize Bandwidth (SLA)
Interface preference wan1 and wan2
Required SLA target google#1 (created in step 2).
  1. Click OK to create the rule.

To configure an SD-WAN rule to use SLA:

config system virtual-wan-link config health-check edit “google” set server “google.com” set members 1 2 config sla edit 1 set latency-threshold 10 set jitter-threshold 5

next

end

next

end config service edit 1 set name “gmail” set mode load-balance set internet-service enable set internet-service-id 65646 config sla edit “google” set id 1

next

end

set priority-members 1 2

next

end

end

To diagnose the performance SLA status:

FGT # diagnose sys virtual-wan-link health-check google Health Check(google):

Seq(1): state(alive), packet-loss(0.000%) latency(14.563), jitter(4.334) sla_map=0x0

Seq(2): state(alive), packet-loss(0.000%) latency(12.633), jitter(6.265) sla_map=0x0

FGT # diagnose sys virtual-wan-link service 1

Service(1): Address Mode(IPV4) flags=0x0

TOS(0x0/0x0), Protocol(0: 1->65535), Mode(load-balance)

Members:<<BR>>

1: Seq_num(1), alive, sla(0x1), num of pass(1), selected

2: Seq_num(2), alive, sla(0x1), num of pass(1), selected

Internet Service: Google.Gmail(65646)

When both wan1 and wan2 meet the SLA requirements, Gmail traffic will use both wan1 and wan2. If only one of the interfaces meets the SLA requirements, Gmail traffic will only use that interface.

If neither interface meets the requirements, the rule is not matched and traffic will try to use a following rule, but if no rules match, traffic will still be processed with the implicit rule algorithm, see Implicit rule on page 110.

MPLS (SIP and backup) + DIA (cloud apps)

This topic covers a typical customer usage scenario where the customer’s SD-WAN has two members: MPLS and DIA. DIA is mostly used for direct Internet access to Internet applications, for example, Office365, Google applications, Amazon, Dropbox, etc. MPLS is mostly used for SIP and works as a backup when DIA is not working.

Sample topology

Sample configuration

This sample configures all SIP traffic to use MPLS while all other traffic uses DIA. If DIA is not working, the traffic will use MPLS.

To configure an SD-WAN rule to use SIP and DIA using the GUI:

  1. On the FortiGate, enable SD-WAN and add wan1 and wan2 as SD-WAN members, then add a policy and static route.

See Creating the SD-WAN interface on page 105.

  1. When you add a firewall policy, enable Application Control.
  2. Go to Network > SD-WAN Rules.
  3. Click Create New. The Priority Rule page opens.
  4. Enter a name for the rule, such as SIP.
  5. Click the Application box to display the popup dialog box; then select the applicable SIP applications.
  6. For Strategy, select Manual.
  7. For Interface preference, select MPLS.
  8. Click OK.
  9. Click Create New to create another rule.
  10. Enter a name for the rule, such as Internet.
  11. Click the Address box to display the popup dialog box and select all.
  12. For Strategy, select Manual.
  13. For Interface preference, select DIA.
  14. Click OK.

To configure the firewall policy using the CLI:

config firewall policy edit 1 set name “1” set srcintf “dmz” set dstintf “”virtual-wan-link”” set srcaddr “all” set dstaddr “all” set action accept set schedule “always” set service “ALL” set utm-status enable set fsso disable set application-list “g-default” set ssl-ssh-profile “certificate-inspection”

set nat enable

next

end

To configure an SD-WAN rule to use SIP and DIA using the CLI:

config system virtual-wan-link set status enable config members edit 1 set interface “MPLS” set gateway x.x.x.x

next edit 2 set interface “DIA” set gateway x.x.x.x

next

end config service edit 1 set name “SIP” set member 1 set internet-service enable

set internet-service-app-ctrl 34640 152305677 38938 26180 26179 30251

next edit 2 set name “Internet” set input-device “dmz” set member 2 set dst “all”

next

end end

All SIP traffic uses MPLS. All other traffic goes to DIA. If DIA is broken, the traffic uses MPLS. If you use VPN instead of MPLS to run SIP traffic, you must configure a VPN interface, for example vpn1, and then replace member 1 from MPLS to vpn1 for SD-WAN member.

To use the diagnose command to check performance SLA status using the CLI:

FGT_A (root) # diagnose sys virtual-wan-link service 1

Service(1): Address Mode(IPV4) flags=0x0

TOS(0x0/0x0), Protocol(0: 1->65535), Mode(manual) Members:<<BR>>

1: Seq_num(1), alive, selected

Internet Service: SIP(4294836224 34640) SIP.Method(4294836225 152305677) SIP.Via.NAT

(4294836226 38938) SIP_Media.Type.Application(4294836227 26180) SIP_Message(4294836228 26179) SIP_Voice(4294836229 30251)

FGT_A (root) # diagnose sys virtual-wan-link service 2

Service(2): Address Mode(IPV4) flags=0x0

TOS(0x0/0x0), Protocol(0: 1->65535), Mode(manual) Members:<<BR>>

1: Seq_num(2), alive, selected

Dst address: 0.0.0.0-255.255.255.255

FGT_A (root) #

FGT_A (root) # diagnose sys virtual-wan-link internet-service-app-ctrl-list

Ctrl application(SIP 34640):Internet Service ID(4294836224)

Ctrl application(SIP.Method 152305677):Internet Service ID(4294836225)

Ctrl application(SIP.Via.NAT 38938):Internet Service ID(4294836226)

Ctrl application(SIP_Media.Type.Application 26180):Internet Service ID(4294836227)

Ctrl application(SIP_Message 26179):Internet Service ID(4294836228)

Ctrl application(SIP_Voice 30251):Internet Service ID(4294836229)

FGT_A (root) #

Basic SD-WAN setup – FortiOS 6.2

Basic SD-WAN setup

Creating the SD-WAN interface

This recipe provides an example of how to start using SD-WAN for load balancing and redundancy.

In this example, two ISP internet connections (wan1 and wan2) use SD-WAN to balance traffic between them at 50% each.

To configure SD-WAN using the GUI:

  1. On the FortiGate, enable SD-WAN and add interfaces wan1 and wan2 as members:
    1. Go to Network > SD-WAN.
    2. Set the Status to Enable.
    3. Click the plus icon to add members, using the ISPs’ proper gateways for each member.
    4. Click Apply to save your settings.
  2. Create a static route with virtual-wan-link enabled:
    1. Go to Network > Static Routes.
    2. Click Create New. The New Static Route page opens.
    3. From the Interface drop-down list, select SD-WAN.
    4. Click OK to save your changes.
  3. Create a firewall policy to allow the traffic:
    1. Go to Policy & Objects > IPv4 Policy.
    2. Click Create New. The New Policy page opens.
    3. For the Incoming Interface, select DMZ.
    4. For the Outgoing Interface, select SD-WAN.
    5. Configure the remaining settings as needed, then click OK to create the policy. Outgoing traffic will balance between wan1 and wan2 at a 50:50 ratio.

To configure SD-WAN using the CLI:

  1. On the FortiGate, configure the wan1 and wan2 interfaces:

config system interface edit “wan1” set alias to_ISP1 set ip 172.16.20.1 255.255.255.0

next edit “wan2” set alias to_ISP2 set ip 10.100.20.1 255.255.255.0

next

end

  1. Enable SD-WAN and add the interfaces as members:

config system virtual-wan-link set status enable config members edit 1 set interface “wan1” set gateway 172.16.20.2

next edit 2 set interface “wan2” set gateway 10.100.20.2

next

end

end

  1. Configure a static route:

config router static edit 1 set distance 1 set virtual-wan-link enable

next end

  1. Configure a firewall policy:

config firewall policy edit 2 set name “VWL” set srcintf “dmz” set dstintf “virtual-wan-link” set srcaddr “all” set dstaddr “all” set action accept set schedule “always” set service “ALL” set nat enable

next

end

  1. Use a diagnose command to check the state of the SD-WAN:

# diagnose sys virtual-wan-link member

Member(1): interface: wan1, gateway: 172.16.20.2, priority: 0, weight: 0

Member(2): interface: wan2, gateway: 10.100.20.2, priority: 0, weight: 0

Using DHCP interface

This recipe provides a sample configuration for customer using the DHCP interface as SD-WAN members. SD-WAN members can be all static IP interfaces, all DHCP interfaces, or a mix of both IP and DHCP interfaces.

In this example, we’ll use a customer who has two ISP internet connections: wan1 and wan2. wan1 is a DHCP interface and wan2 is a static IP address interface.

Sample topology

To configure DHCP interface on the GUI:

  1. Enable SD-WAN and add wan1 and wan2 as SD-WAN members.
    1. Go to Network > SD-WAN and ensure Status is Enable.
    2. In the SD-WAN Interface Members section, click the + button and add two members: wan1 and wan2.

l For the static IP member, enter the Gateway address. l For the DHCP member, do not change the Gateway.

  1. Click Apply.
  1. Create static route and enable virtual-wan-link.
  2. Go to Network > Static Routes and click Create New.
  3. Click the Interface dropdown list and select SD-WAN.
  4. Click OK.
  5. Create policy for this traffic.
  6. Go to Policy & Objects > IPv4 Policy and click Create New.
  7. For the Incoming Interface, select dmz.
  8. For the Outgoing Interface, select SD-WAN
  9. Configure other options as needed.
  10. Click OK.

Outgoing traffic is balanced between wan1 and wan2 at about 50% each.

To configure the interface on the CLI:

config system interface edit “wan1” set alias to_ISP1 set mode dhcp

next edit “wan2” set alias to_ISP2 set ip 10.100.20.1 255.255.255.0

next

end

To configure SD-WAN on the CLI:

config system virtual-wan-link set status enable config members

edit 1 set interface “wan1”

next edit 2 set interface “wan2” set gateway 10.100.20.2

next

end

end

To configure static route on the CLI:

config router static edit 1

set distance 1 set virtual-wan-link enable

next end

To configure firewall policy on the CLI:

config firewall policy edit 2 set name “VWL” set srcintf “dmz” set dstintf “virtual-wan-link” set srcaddr “all” set dstaddr “all” set action accept set schedule “always” set service “ALL” set nat enable

next

end

To use the diagnose command to check SD-WAN state:

# diagnose sys virtual-wan-link member

Member(1): interface: wan1, gateway: 172.16.20.2, priority: 0, weight: 0

Member(2): interface: wan2, gateway: 10.100.20.2, priority: 0, weight: 0 Implicit rule

SD-WAN supports five types of implicit rules (load-balance mode):

  • Source IP (CLI command: source-ip-based): SD-WAN will load balance the traffic equally among its members according to a hash algorithm based on the source IP addresses.
  • Session (weight-based): SD-WAN will load balance the traffic according to the session numbers ratio among its members.
  • Spillover (usage-based): SD-WAN will use the first member until the bandwidth reaches its limit, then use the second, and so on.
  • Source-Destination IP (source-dest-ip-based): SD-WAN will load balance the traffic equally among its members according to a hash algorithm based on both the source and destination IP addresses.
  • Volume (measured-volume-based): SD-WAN will load balance the traffic according to the bandwidth ratio among its members.

Examples

The following four examples demonstrate how to use the implicit rules (load-balance mode).

Example 1

Outgoing traffic is equally balanced between wan1 and wan2, using source-ip-based or source-dest-ip-based mode.

Using the GUI:

  1. On the FortiGate, enable SD-WAN and add wan1 and wan2 as SD-WAN members, then add a policy and static route. See Creating the SD-WAN interface on page 105 for details.
  2. Go to Network > SD-WAN Rules.
  3. Edit the sd-wan rule (the last default rule).
  4. For the Load Balancing Algorithm, select either Source IP or Source-Destination IP.
  5. Click OK.

Using the CLI:

  1. Enable SD-WAN and add wan1 and wan2 as SD-WAN members, then add a policy and static route. See Creating the SD-WAN interface on page 105 for details.
  2. Set the load balancing algorithm: Source IP based:

config system virtual-wan-link set load-balance-mode source-ip-based

end

Source-Destination IP based:

config system virtual-wan-link set load-balance-mode source-dest-ip-based

end

Example 2

Outgoing traffic is balanced between wan1 and wan2 with a customized ratio, using weight-based mode: wan1 runs 80% of the sessions, and wan2 runs 20% of the sessions.

Using the GUI:

  1. Go to Network > SD-WAN Rules.
  2. Edit the sd-wan rule (the last default rule).
  3. For the Load Balancing Algorithm, select Sessions.
  4. Enter 80 in the wan1 field, and 20 in the wan2
  5. Click OK.

Using the CLI:

config system virtual-wan-link set load-balance-mode weight-based config members edit 1 set interface “wan1” set weight 80

next edit 2 set interface “wan2” set weight 20

next

end

end

Example 3

Outgoing traffic is balanced between wan1 and wan2 with a customized ratio, using measured-volume-based mode: wan1 runs 80% of the volume, and wan2 runs 20% of the volume.

Using the GUI:

  1. Go to Network > SD-WAN Rules.
  2. Edit the sd-wan rule (the last default rule).
  3. For the Load Balancing Algorithm, select Volume.
  4. Enter 80 in the wan1 field, and 20 in the wan2
  5. Click OK.

Using the CLI:

config system virtual-wan-link set load-balance-mode measured-volume-based config members edit 1 set interface “wan1” set volume-ratio 80 next

edit 2 set interface “wan2” set volume-ratio 20

next

end

end

Example 4

Load balancing can be used to reduce costs when internet connections are charged at different rates. For example, if wan2 charges based on volume usage and wan1 charges a fixed monthly fee, we can use wan1 at its maximum bandwidth, and use wan2 for overflow.

In this example, wan1’s bandwidth is 10Mbps down and 2Mbps up. Traffic will use wan1 until it reaches its spillover limit, then it will start to use wan2. Note that auto-asic-offload must be disabled in the firewall policy.

Using the GUI:

  1. On the FortiGate, enable SD-WAN and add wan1 and wan2 as SD-WAN members, then add a policy and static route. See Creating the SD-WAN interface on page 105 for details.
  2. Go to Network > SD-WAN Rules.
  3. Edit the sd-wan rule (the last default rule).
  4. For the Load Balancing Algorithm, select Spillover.
  5. Enter 10000 in the wan1 Ingress SpilloverThreshold field, and 2000 in the wan1 Egress SpilloverThreshold
  6. Click OK.

Using the CLI:

config system virtual-wan-link set load-balance-mode usage-based config members edit 1 set interface “wan1” set spillover-threshold 2000 set ingress-spillover-threshold 10000

next

end end

SD-WAN – FortiOS 6.2

SD-WAN

SD-WAN is a software-defined approach to managing Wide-Area Networks (WAN). It allows you to offload internetbound traffic, meaning that private WAN services remain available for real-time and mission critical applications. This added flexibility improves traffic flow and reduces pressure on the network.

SD-WAN platforms create hybrid networks that integrate broadband and other network services into the corporate WAN while maintaining the performance and security of real-time and sensitive applications.

SD-WAN with Application Aware Routing can measure and monitor the performance of multiple services in a hybrid network. It uses application routing to offer more granular control of where and when an application uses a specific service, allowing better use of the overall network.

Some of the key benefits of SD-WAN include:

  • Reduced cost with transport independence across MPLS, 3G/4G LTE, and others. l Improve business application performance thanks to increased availability and agility.
  • Optimized user experience and efficiency with SaaS and public cloud applications.

SD-WAN has 3 objects:

  • SD-WAN interface

Also called members, SD-WAN interfaces are the ports and interfaces that are used to run traffic. At least one interface must be configured for SD-WAN to function; up to 255 member interfaces can be configured. See Creating the SD-WAN interface on page 105.

  • Performance-SLA

Also called health-check, performance SLAs are used to monitor member interface link quality, and to detect link failures. They can be used to remove routes, and to reroute traffic when an SD-WAN member cannot detect the server. They can also be used in SD-WAN rules to select the preferred member interface for forwarding traffic. See Performace SLA – link monitoring on page 114.

  • SD-WAN rule

Also called service, SD-WAN rules are used to control path selection. Specific traffic can be dynamically sent to the best link, or use a specific route. There are five modes: l auto: Assign interfaces a priority based on quality. l manual: Assign interfaces a priority manually. l priority: Assign interfaces a priority based on the link-cost-factor quality of the interface. l sla: Assign interfaces a priority based on selected SLA settings. l load-balance: Distribute traffic among all available links based on the load balance algorithm.

DNS – FortiOS 6.2

DNS

Introduction

DNS (Domain Name System) is used by devices connecting to the Internet to locate websites by mapping a domain name to a website’s IP address. For example, a DNS server maps the domain name www.fortinet.com to the IP address 66.171.121.34.

A FortiGate can serve different roles based on user requirements:

  • A FortiGate can control which DNS serves network uses. l A FortiGate can function as a DNS server.
  • FortiGuard Dynamic Domain Name Service (DDNS) allows a remote administrator to access a FortiGate’s Internetfacing interface using a domain name that remains constant even when its IP address changes.

FortiOS supports DNS configuration for both IPv4 and IPv6 addressing. When a user requests a website, the FortiGate looks to the configured DNS servers to provide the IP address of the website in order to know which server to contact to complete the transaction.

The FortiGate queries the DNS servers whenever it needs to resolve a domain name into an IP address, such as for NTP or web servers defined by their domain names.

FGT_A (dns) # set

*primary Primary DNS server IP address. secondary       Secondary DNS server IP address. dns-over-tls Enable/disable/enforce DNS over TLS.

ssl-certificate Name of local certificate for SSL connections. domain Search suffix list for hostname lookup.

ip6-primary     Primary DNS server IPv6 address. ip6-secondary Secondary DNS server IPv6 address.

timeout  DNS query timeout interval in seconds (1 – 10). retry Number of times to retry (0 – 5). dns-cache-limit      Maximum number of records in the DNS cache. dns-cache-ttl Duration in seconds that the DNS cache retains information.

cache-notfound-responses     Enable/disable response from the DNS server when a record is not in cache. source-ip      IP address used by the DNS server as its source IP.

FGT_A (dns) # set Important DNS commands

dns-over-tls

FortiGate version 6.2 adds DNS over TLS (DoT) support. DoT is a security protocol for encrypting and wrapping DNS queries and answers via the Transport Layer Security (TLS) protocol.

FGT_A (dns) # set dns-over-tls disable     Disable DNS over TLS. enable     Use TLS for DNS queries if TLS is available. enforce       Use only TLS for DNS queries. Does not fall back to unencrypted DNS queries if TLS is unavailable.

cache-notfound-responses

When you enable DNS cache not found responses, any DNS requests that are returned with NOT FOUND can be stored in the cache. When enabled, the DNS server is not asked to resolve the host name for NOT FOUND entries.

config system dns set cache-notfound-responses enable

end dns-cache-limit

This command enables you to set how many DNS entries are stored in the cache. Entries that remain in the cache provide a quicker response to requests than going out to the Internet to get the same information.

config system dns set dns-cache-limit 2

end dns-cache-ttl

This command enables you to set how long entries remain in the cache.

FGT_A (dns) # set dns-cache-limit dns-cache-limit Enter an integer value from <0> to <4294967295> (default = <5000>). DNS troubleshooting

The FortiGate CLI can collect the following list of DNS debug information.

FGT_A (global) # diagnose test application dnsproxy worker idx: 0 1. Clear DNS cache

  1. Show stats
  2. Dump DNS setting
  3. Reload FQDN
  4. Requery FQDN
  5. Dump FQDN
  6. Dump DNS cache
  7. Dump DNS DB
  8. Reload DNS DB
  9. Dump secure DNS policy/profile
  10. Dump Botnet domain
  11. Reload Secure DNS setting
  12. Show Hostname cache
  13. Clear Hostname cache
  14. Show SDNS rating cache
  15. Clear SDNS rating cache
  16. DNS debug bit mask
  17. Restart dnsproxy worker

The example below shows useful information about the ongoing DNS connection.

Important fields include:

tls 1 if the connection is TLS. 0 for non-TLS connection.
rt Round trip time of the DNS latency.
probe The number of probes sent.

FGT_A (global) # diagnose test application dnsproxy 3 worker idx: 0

vdom: root, index=0, is master, vdom dns is disabled, mip-169.254.0.1 dns_log=1 tls=0 cert= dns64 is disabled

vdom: vdom1, index=1, is master, vdom dns is enabled, mip-169.254.0.1 dns_log=1 tls=0 cert= dns64 is disabled

dns-server:208.91.112.220:53 tz=-480 tls=0 req=0 to=0 res=0 rt=0 rating=1 ready=0 timer=37 probe=9 failure=0 last_failed=0

dns-server:8.8.8.8:53 tz=0 tls=0 req=73 to=0 res=73 rt=5 rating=0 ready=1 timer=0 probe=0 failure=0 last_failed=0

dns-server:65.39.139.63:53 tz=0 tls=0 req=39 to=0 res=39 rt=1 rating=0 ready=1 timer=0 probe=0 failure=0 last_failed=0

dns-server:62.209.40.75:53 tz=60 tls=0 req=0 to=0 res=0 rt=0 rating=1 ready=0 timer=37 probe=9 failure=0 last_failed=0

dns-server:209.222.147.38:53 tz=-300 tls=0 req=0 to=0 res=0 rt=0 rating=1 ready=0 timer=37 probe=9 failure=0 last_failed=0

dns-server:173.243.138.221:53 tz=-480 tls=0 req=0 to=0 res=0 rt=0 rating=1 ready=0 timer=37 probe=9 failure=0 last_failed=0

dns-server:45.75.200.89:53 tz=0 tls=0 req=0 to=0 res=0 rt=0 rating=1 ready=0 timer=37 probe=9 failure=0 last_failed=0

DNS_CACHE: hash-size=2048, ttl=1800, min-ttl=60, max-num=-1

DNS FD: udp_s=12 udp_c=17:18 ha_c=22 unix_s=23, unix_nb_s=24, unix_nc_s=25 v6_udp_s=11, v6_udp_c=20:21, snmp=26, redir=13, v6_redir=14

DNS FD: tcp_s=29, tcp_s6=27, redir=31 v6_redir=32

FQDN: hash_size=1024, current_query=1024

DNS_DB: response_buf_sz=131072

LICENSE: expiry=2015-04-08, expired=1, type=2

FDG_SERVER:208.91.112.220:53

FGD_CATEGORY_VERSION:8

SERVER_LDB: gid=eb19, tz=-480, error_allow=0 FGD_REDIR_V4:208.91.112.55 FGD_REDIR_V6:

DNS proxy performance enhancement

For a FortiGate with multiple CPUs, version 6.2 adds a new CLI command to allow the customer to set the DNS process number from 1 to the number of CPUs. The default DNS process number is 1.

config system global set dnsproxy-worker-count 4

end

Note: The range of dnsproxy-worker-count is 1 to the number of CPUs that the FortiGate has.

To debug DNS proxy on the worker ID, use the following command. The following example runs test commands on the second dnsproxy worker. If you do not specify worker ID, the default worker ID is 0.

#diagnose test application dnsproxy 7 1

Similarly, the following command enables debug on the second worker.

#diagnose debug application dnsproxy -1 1

For debugging, you can also enable it on all workers by specifying -1 as worker ID.

#diagnose debug application dnsproxy -1 -1

DNS local domain list

End-users who commonly use incomplete URLs without a domain (for example: http://host1) rely on the proxy to locate the domain and resolve the address. If the configured domain is company.com and the URL is http://host1, the DNS feature will send a request for host1.company.com to a DNS server for the IP address. If you have local Microsoft domains on the network, you can enter a domain name in the Local Domain Name field. In situations where all three fields are configured, the FortiGate first looks to the local domain, and if no match is found, sends a request to the external DNS servers.

Whenever a client requests a URL which does not include a fully qualified domain name (FQDN), FortiGate resolves the URL by traversing through the DNS suffix list and doing a DNS query for each entry until the first match. Sample configuration

To configure a FortiGate’s DNS domain list in the GUI:

  1. By default, FortiGate is configured to use FortiGuard’s DNS servers which are primary (208.91.112.53) and secondary (208.91.112.52).
  2. To configure the DNS server addresses, go to Network > DNS and select Specify, then enter the preferred DNS server addresses.

For example: 172.16.200.1 as the primary DNS server and 172.16.200.2 as the secondary.

  1. FortiGate supports a total of eight local domain lists.

To configure a FortiGate’s DNS domain list in the CLI:

Additional DNS configuration options are available in the CLI using the config system dns command.

New CLI commands added in 6.2 allow users to set up to eight domains. Retry Time and Timeout values can be configured to define how many attempts the FortiGate makes to search a particular domain and when FortiGate gives up on the domain.

FGT_B (dns) # set domain

*domain   DNS search domain list separated by space (maximum 8 domains)

config system dns set primary 172.16.200.1

set domain “sample.com” “example.com” “domainname.com” end

FG3H1E5818900749 (global) # config system dns

FG3H1E5818900749 (dns) # set

*primary Primary DNS server IP address. secondary       Secondary DNS server IP address. domain Search suffix list for hostname lookup. ip6-primary    Primary DNS server IPv6 address. ip6-secondary Secondary DNS server IPv6 address.

timeout  DNS query timeout interval in seconds (1 – 10). retry Number of times to retry (0 – 5). dns-cache-limit      Maximum number of records in the DNS cache. dns-cache-ttl Duration in seconds that the DNS cache retains information.

cache-notfound-responses     Enable/disable response from the DNS server when a record is not in cache. source-ip      IP address used by the DNS server as its source IP.

FG3H1E5818900749 (dns) # set timeout timeout     Enter an integer value from <1> to <10> (default = <5>).

FG3H1E5818900749 (dns) # set retry retry   Enter an integer value from <0> to <5> (default = <2>).

DNS local domain example

In the example below, the local domain resolves host1 to 1.1.1.1 and host2 to 2.2.2.2. The local DNS server has an entry for host1 mapped to the FQDN of host1.sample.com and a second entry for host2 mapped to the FQDN of host2.example.com.

ping host1

PING host1.sample.com (1.1.1.1): 56 data bytes

ping host2

PING host2.example.com (2.2.2.2): 56 data bytes

Using FortiGate as a DNS server

This topic provides the following sample configurations: l About using a DNS server to resolve internal and external requests

l About using an internal DNS server for internal requests and a public DNS server for external requests

You can also create local DNS servers for your network. Depending on your requirements, you can manually maintain your entries (master DNS server) or use it as a jumping point where the server refers to an outside source (slave DNS server).

In version 6.2, FortiGate as a DNS server also supports TLS connections to a DNS client.

Sample configuration about DNS servers

This section describes how to set up a FortiGate to use a DNS server for resolving internal and external requests.

To configure FortiGate as a DNS server using the GUI:

  1. Ensure the DNS Database feature is visible.
  2. Go to System > Feature Visibility and ensure DNS Database is enabled.
  3. Add the DNS entry to the FortiGate DNS server.
  4. Go to Network > DNS Servers.
  5. Under DNS Database, click Create New.
    • For Type, select Master.
    • For View, select Shadow.

View controls the accessibility of the DNS server. If you select Public, external users can access or use the DNS server. If you select Shadow, only internal users can use it.

  • Enter a DNS Zone, for example, WebServer. l Enter the Domain Name of the zone, for example, com. l Enter the Hostname of the DNS server, for example, Corporate. l Enter the Contact Email Address for the administrator, for example, admin@example.com. l Disable Authoritative.
  • Click OK.
  1. Under DNS Entries, click Create New.
    • Select the Type, for example, Address (A). l Enter the Hostname, for example, example. l Specify the remaining fields depending on the Type you select.
    • Click OK.
  1. Enable the DNS service on the interface.
  1. Go to Network > DNS Servers.
  2. Under DNS Service, click Create New. l Select the Interface.

l For Mode, select Recursive. l Click OK.

To configure FortiGate as a DNS server using the CLI:

config system dns-database edit “example” set domain “fortinet.com” config dns-entry edit 1 set hostname “example” set ip 2.3.3.4

next

end set primary-name “Corporate” set contact “admin@example.com”

next

end

To configure DNS query using the CLI:

config system dns-server

edit wan1 set mode recursive end

Run dig to query the FortiGate DNS server. Dig (Domain Information Grouper) is a Unix-like network administration command line tool for querying DNS servers.

root@PC05:~# dig @172.16.200.1 example.fortinet.com

; <<>> DiG 9.11.0-P1 <<>> @172.16.200.1 example.fortinet.com

; (1 server found) ;; global options: +cmd ;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51137

;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:

;example.fortinet.com.          IN      A

;; ANSWER SECTION:

example.fortinet.com. 86400 IN        A       2.3.3.4

;; Query time: 0 msec

;; SERVER: 172.16.200.1#53(172.16.200.1)

;; WHEN: Thu Jan 10 10:24:01 PST 2019

;; MSG SIZE rcvd: 54

Sample configuration about internal and public DNS servers

This section describes how to set up a FortiGate to use an internal DNS server for resolving internal requests and a public DNS server for resolving external requests.

To configure FortiGate using the CLI:

  1. Set up a forwarder for the DNS database:

In this example, an IP address of 172.16.100.100 is used to resolve the domain fortinet.com:

config system dns-database edit “corp” set domain “fortinet.com” set authoritative disable set forwarder “172.16.100.100”

next

  1. Set up a listening interface:

In this example, you are setting up the listening interface to connect to the host. FGT_A (dns-server) # show config system dns-server edit “wan1”

next

end

  1. Set the system DNS to 8.8.8.8 for all other queries:

config system dns set primary 8.8.8.8 end

Technical information

The Type of the DNS Database Zone can be one of the following:

  • A Master zone is an editable version of a zone. l A Slave zone is a synchronized read-only copy from another DNS server that holds the master zone.

The View of the DNS Database Zone can be one of the following:

  • Public view is usually a general (outside) view of a DNS zone.
  • Shadow views in this context are used to present a different view of a zone to local networks, that is, shadow view might contain different IPs and names).

The DNS Database Zone can be one of the following categories:

  • An Authoritative zone claims to hold all existing entries concerning this zone. A DNS server holding an authoritative zone serves requests to this zone only from its local zone file, that is, it does not perform additional recursive requests such as matching this zone to other defined DNS servers for zone records which do not exist in this zone file.
  • An Unauthoritative zone serves the records it holds itself from the local zone file and performs recursive request to other defined DNS servers for requests that match the zone but are not listed in the local zone file.

The Mode of the DNS Service can be one of the following:

  • Recursive DNS servers performs DNS lookups to other defined DNS servers for any zone requests they cannot fulfill from local files. l Non-recursive DNS servers only serve from local zone files. l Forward to system DNS forwards the query to the FortiGate’s configured system DNS.

FortiGuard DDNS

If your ISP changes your external IP address regularly and you have a static domain name, you can configure the external interface to use a dynamic DNS (DDNS) service. This ensures that external users and customers can always connect to your company firewall. If you have a FortiGuard subscription, you can use FortiGuard as the DDNS server.

You can configure FortiGuard as the DDNS server using the GUI or CLI.

Sample topology

Sample configuration

To configure FortiGuard as a DDNS server in the FortiGate using the GUI:

  1. Go to Network > DNS and enable FortiGuard DDNS.
  2. Select the Interface with the dynamic connection.
  3. Specify the other fields.

To configure FortiGuard as a DDNS server in the FortiGate using the CLI:

config system fortiguard set ddns-server-ip set ddns-server-port end

If you don’t have a FortiGuard subscription or want to use a different DDNS server, you can configure DDNS in the CLI. You can configure a DDNS for each interface. Only the first configured port appears in the FortiGate GUI. Additional commands vary depending on the DDNS server you select. Use the following CLI commands:

config system ddns edit <DDNS_ID> set monitor-interface <external_interface> set ddns-server <ddns_server_selection> next end

You can configure FortiGate to refresh DDNS IP addresses. FortiGate periodically checks the DDNS server that is configured.

To configure FortiGate to refresh DDNS IP addresses using the CLI:

config system ddns edit <1> set ddns-server FortiGuardDDNS set use-public-ip enable set update-interval seconds

next end

The possible values for update-interval are 60 to 2592000 seconds, and the default is 300 seconds.

When clear-text is disabled, FortiGate uses the SSL connection to send and receive (DDNS) updates.

To disable cleartext and set the SSL certificate using the CLI:

config system ddns set clear-text disable set ssl-certificate <cert_name> end

A DHCP server has an override command option that allows DHCP server communications to go through DDNS to perform updates for the DHCP client. This enforces a DDS update of the AA field every time even if the DHCP client does not request it. This allows supporting the allow/ignore/deny client-updates options.

To enable DDNS update override using the CLI:

config system dhcp server edit <0>

set ddns-update_override enable

next end

 

FortiView – FortiOS 6.2

FortiView

FortiView from disk

Prerequisites

All FortiGates with an SSD disk.

Restrictions

  • Desktop models (for example: under 100D) with SSD only supports five minutes and one hour view. l Medium models (for example: 200D, 500D) with SSD supports up to 24 hours view.
  • Large models (for example: 1500D and above) with SSD supports up to seven days view.
  • Confirm that the setting is enabled:

config log setting set fortiview-weekly-data enable

end

Configuration

A firewall policy needs to be in place with traffic logging enabled. For best operation with FortiView, internal interface roles should be clearly defined as LAN; DMZ and internet facing or external interface roles should be defined as WAN.

To enable FortiView from Disk:

  1. Enable disk logging from the FortiGate GUI.
    1. Go to Log & Report > Log Settings > Local Log.
    2. Select the checkbox next to Disk.
  2. Enable historical FortiView from the FortiGate GUI.
    1. Go to Log & Report > Log Settings > Local Log.
    2. Select the checkbox next to Enable Historical FortiView.
  3. Click Apply.

To include sniffer traffic and local-deny traffic when FortiView from Disk:

This feature is only supported through the CLI.

config report setting

set report-source forward-traffic sniffer-traffic local-deny-traffic

end

Source View

Top Level

Sample entry:

Time l Realtime or Now entries are determined by the FortiGate’s system session list.
  l Historical or 5 minutes and later entries are determined by traffic logs, with additional information coming from UTM logs.
Graph l The graph shows the bytes sent/received in the time frame. Realtime does not include a chart.
  l Users can customize the time frame by selecting a time period within the graph.
Bubble Chart l Bubble chart shows the same information as the table, but in a different graphical manner.
Columns l Source shows the IP address (and user as well as user avatar if configured) of the source device.
  l Device shows the device information as listed in User& Device > Device Inventory. Device detection should be enabled on the applicable interfaces for best function.
  l Threat Score is the threat score of the source based on UTM features such as web filter and antivirus. It shows threat scores allowed and threat scores blocked.
  l Bytes is the accumulated bytes sent/received. In realtime, this is calculated from the session list, and in historical it is from logs.
  l Sessions is the total sessions blocked/allowed. In realtime, this is calculated from the session list, and in historical it is from logs.
  l Source is a simplified version of the first column, including only the IP address without extra information.
  l Source Interface is the interface from which the traffic originates. In realtime, this is calculated from the session list, and in historical it is from the logs.
  l More information can be shown in a tooltip while hovering over these entries.

93

l For realtime, two more columns are available, Bandwidth and Packets, both of which come from the session list.

Drilldown Level

Sample entry:

Graph l The graph shows the bytes sent/received in the time frame. Realtime does not include a chart.
  l Users can customize the time frame by selecting a time period within the graph.
Summary

Information

l Shows information such as the user/avatar, avatar/source IP, bytes, and sessions total for the time period.
  l Can quarantine host (access layer quarantine) if they are behind a FortiSwitch or FortiAP.
  l Can ban IP addresses, adds the source IP address into the quarantine list.
Tabs l Drilling down entries in any of these tabs (except sessions tab) will take you to the underlying traffic log in the sessions tab.
  l Applications shows a list of the applications attributed to the source IP. This can include scanned applications (using application control in a firewall policy or unscanned applications.

config log gui-display set fortiview-unscanned-apps enable end

  l Destinations shows destinations grouped by IP address/FQDN.
  l Threats lists the threats caught by UTM profiles. This can be from antivirus, IPS, webfilter, application control, etc.
  l Web Sites contains the websites which were detected either with webfilter, or through FQDN in traffic logs.
  l Web Categories groups entries into their categories as dictated by the Web Filter Database.
  l Search Phrases shows entries of search phrases on search engines captured by a web filter UTM profile, with deep inspection enabled in firewall policy.
  l Policies groups the entries into which polices they passed through or were blocked by.
  l Sessions shows the underlying logs (historical) or sessions (realtime). Drilldowns from other tabs end up showing the underlying log located in this tab.
  l More information can be shown in a tooltip while hovering over these entries.

Troubleshooting

  • Use diagnose debug application httpsd -1 to check which filters were passed through httpsd.

For example:

[httpsd 3163 – 1546543360 info] api_store_parameter[227] — add API parameter ‘filter’: ‘{ “source”: “10.1.100.30”, “application”: “TCP\/5228”, “srcintfrole”: [ “lan”,

“dmz”, “undefined” ] }’ (type=object)

  • Use diagnose debug application miglogd 0x70000 to check what the SQL command is that is passed to the underlying SQL database.

For example:

fortiview_request_data()-898: total:31 start:1546559580 end:1546563179

_dump_sql()-799: dataset=fv.general.chart, sql:select a.timestamp1,ses_al,ses_ bk,r,s,ifnull(sc_l,0),ifnull(sc_m,0),ifnull(sc_h,0),ifnull(sc_c,0) from (select timestamp-(timestamp%60) timestamp1 ,sum(case when passthrough<>’block’ then sessioncount else 0 end) ses_al,sum(case when passthrough=’block’ then sessioncount else 0 end) ses_bk,sum(rcvdbyte) r,sum(sentbyte) s from grp_traffic_all_src where timestamp BETWEEN 1546559580 and 1546563179 and 1=1 AND srcip in (‘10.1.100.11’) AND srcintfrole in (‘lan’,’dmz’,’undefined’) group by timestamp1 ) a left join (select timestamp-(timestamp%60) timestamp1 ,sum(case when threat_level=1 then crscore else 0 end) sc_l,sum(case when threat_level=2 then crscore else 0 end) sc_ m,sum(case when threat_level=3 then crscore else 0 end) sc_h,sum(case when threat_ level=4 then crscore else 0 end) sc_c from grp_threat where timestamp BETWEEN 1546559580 and 1546563179 and 1=1 AND srcip in (‘10.1.100.11’) AND srcintfrole in (‘lan’,’dmz’,’undefined’) group by timestamp1 ) b on a.timestamp1 = b.timestamp1; takes 40(ms), agggr:0(ms)

  • Use exe report flush-cache and exe report recreate-db to clear up any irregularities that may be caused by upgrading or cache issues.