Professional Documents
Culture Documents
FortiOS 5.0
A P r a c t i c a l G u i d e t o G e t t i n g t h e B e s t f r o m Yo u r F o r t i G a t e
Fortinet Publishing
FortiGate Cookbook 5.0 Volume 1
A Practical Guide to Getting the best from Your FortiGate
FortiOS 5.0.1
31 July 2013
01-501-153797-20130731
Copyright© 2013 Fortinet, Inc. All rights reserved. Fortinet®, FortiGate®, and FortGuard®, are
registered trademarks of Fortinet, Inc., and other Fortinet names herein may also be trademarks of
Fortinet. All other product or company names may be trademarks of their respective owners.
Performance metrics contained herein were attained in internal lab tests under ideal conditions,
and performance may vary. Network variables, different network environments and other conditions
may affect performance results. Nothing herein represents any binding commitment by Fortinet,
and Fortinet disclaims all warranties, whether express or implied, except to the extent Fortinet
enters a binding written contract, signed by Fortinet’s General Counsel, with a purchaser that
expressly warrants that the identified product will perform according to the performance metrics
herein. For absolute clarity, any such warranty will be limited to performance in the same ideal
conditions as in Fortinet’s internal lab tests. Fortinet disclaims in full any guarantees. Fortinet
reserves the right to change, modify, transfer, or otherwise revise this publication without notice,
and the most current version of the publication shall be applicable.
Visit these links for more information and documentation for your Fortinet products:
Fortinet Knowledge Base - http://kb.fortinet.com
Technical Documentation - http://docs.fortinet.com
Training Services - http://campus.training.fortinet.com
Technical Support - http://support.fortinet.com
You can report errors or omissions in this or any Fortinet technical document to
techdoc@fortinet.com.
FortiOS Cookbook
Contents
Introduction 6
About FortiGate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Administrative interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Registering your Fortinet product . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
For more information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
FortiOS 5.0.1 3
http://docs.fortinet.com/
Contents
4 FortiGate Cookbook
http://docs.fortinet.com/
Contents
Authentication 350
Creating a security policy to identify users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Identify users and restrict access to websites by category . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Configuring FSSO for single sign-on user access in a Windows AD environment. . . . . . . . . . . . . . . . . . . . . . . . . . 357
Authenticating with FortiAuthenticator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Stopping the “Connection is untrusted” message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Index 377
FortiOS 5.0.1 5
http://docs.fortinet.com/
FortiOS Cookbook
Introduction
The FortiGate Cookbook provides administrators who are new to FortiGate appliances with
examples of how to implement many basic and advanced FortiGate configurations.
FortiGate products offer administrators a wealth of features and functions for securing their
networks, but to cover the entire scope of configuration possibilities would easily surpass the limits
set forth for this book. Fortunately, much more information can be obtained in the FortiOS Handbook.
The latest version is available from the Fortinet Technical Documentation website
(http://docs.fortinet.com) and is also accessible as FortiGate online help.
NA
T
inte betw
and rna ee
the l ne n pr
P .1
1
ri 6
va 8.
2
rne rk e
te 1.
in 0/2
t
te 5
1. al
r n 5.
8. rn
99
al 25
16 te
2. in
n 5.
et 2
w 55
o .0
rk
19
2. Ga 20 an1
.1 wa 4
FortiGate
Gate Unitt
.1 w
20 te .1
20 y
Route mode
in NAT/Route
.2
20
2.
17
17
This cookbook contains a series of sections (or recipes) that describe how to solve problems. Each
section begins with a description of the problem and is followed by a step-by-step solution. Most
sections conclude with results that describe how to verify that the problem was successfully
resolved. Many sections also contain troubleshooting information, best practices and additional
details about the FortiGate features used to solve the problem. Scattered throughout this document
you will also find dedicated troubleshooting sections and sections that describe FortiGate
troubleshooting features such as the packet sniffer and diagnose debug command.
This FortiGate Cookbook was written for FortiOS 5.0 patch 1 (FortiOS 5.0.1).
A PDF copy of this document is available from the FortiGate Cookbook website
(http://docs.fortinet.com/cookbook.html). You can send comments about this document and ideas
for new recipes to techdoc@fortinet.com. New recipes may be published on the FortiGate Cookbook
website and added to future versions of the cookbook.
FortiOS 5.0.1 6
http://docs.fortinet.com/
Introduction About FortiGate
About FortiGate
A FortiGate appliance represents the latest response to the ever changing Internet security threat
landscape. You already know quite well how Internet security covers a wide range of disciplines
across a broad set of services, protocols and network topologies. The FortiGate appliance is
designed specifically to cover a wide range of solutions for your networking requirements, from the
smallest office to the largest Internet service provider. Comprising custom designed silicon and a
dedicated operating system this combination of FortiGate, FortiASIC and FortiOS provides a wide
range of solutions that scale from the smallest office to the largest internet service provider.
APPLICATION
CONTROL
Internal network
FortiGate Unit
The FortiOS feature set is constantly evolving and today provides both IPv6 as well as IPv4
protection, high availability, a full suite of dynamic routing protocols, traffic shaping, IPsec and SSL
VPN, user authentication, WAN optimization, and secure WiFi. UTM has been extended beyond virus
scanning and web filtering to include intrusion protection, application control, endpoint security, and
data leak prevention. Application control combined with a whole host of monitoring functions and
network vulnerability scanning provides a complete and detailed picture of the traffic on your
networks allowing you to detect and isolate threats before they happen and take action to control
traffic as it passes through your network.
FortiOS 5.0.1 7
http://docs.fortinet.com/
Administrative interfaces Introduction
The advanced capabilities of your FortiGate appliance require an equally advanced and global
presence for ensuring as complete a defence as possible. Updated many times a day, the FortiGuard
network provides a series of databases which are either installed directly or queried on demand to
realize the goal of complete content protection. Whether you are scanning for hundreds of thousands
of viruses, checking millions of URLs or looking for that next SPAM outbreak FortiGuard is the place
to turn.
To ease the introduction of your new FortiGate units they have been designed to operate in what we
call NAT/Route mode or Transparent mode. In NAT/Route mode the FortiGate unit functions as a
router connecting two or more different networks together. Using static and advanced dynamic
routing, in NAT/Route mode the FortiGate unit routes packets between its attached networks. You
can also use security policies and firewall objects to apply network address translation (NAT) to traffic
as it passes back and forth between different networks. NAT hides addresses on private networks to
improve security and also simplifies routing between networks.
In Transparent mode the FortiGate unit is installed in a network transparently to layer 3, without
changing the IP addressing of the network in any way. Its presence on the network restricted to a
single management IP address. In transparent mode, traffic can pass through the FortiGate unit
without any address translation or routing taking place.
Administrative interfaces
A full set of options is available to configure and manage FortiGate units including the web-based
manager for visual management, the CLI for command-line-based management, and FortiExplorer
which allows management over a USB connection.
Web-based Manager
Also called the Web Interface or Web UI, the FortiGate web-based manager is an advanced point and
click, drag and drop interface that provides quick access to most FortiGate configuration settings
and includes a configuration wizard and complementary visual monitoring and management tools.
Using the web-based manager you can for example, add a security policy to monitor application
activity on a network, view the results of this application monitoring policy, and then add additional
policies or change the existing policy to block or limit the traffic produced by some applications.
The web-based manager also provides a wide range of monitoring and reporting tools that provide
detailed information about traffic and events on the FortiGate unit. All aspects of FortiGate operation
can be monitored from the web-based manager. Specialized monitoring pages are available for most
features.
You access the web-based manager using HTTP or a secure HTTPS connection from any web
browser. By default you can access the web-based manager by connecting to the FortiGate interface
usually attached to a protected network.
Configuration changes made from the web-based manager take effect immediately, without resetting
the unit or interrupting service.
8 FortiGate Cookbook
http://docs.fortinet.com/
Introduction Revision History
FortiExplorer
FortiExplorer provides a user-friendly and accessible tool that you can use to configure a FortiGate
unit over a standard USB connection. Once you have installed FortiExplorer software on a PC
running Windows or Mac OS X and established a USB connection between the PC and your
FortiGate unit you can use FortiExplorer to register your FortiGate unit, check for and perform
FortiOS firmware updates, use the FortiExplorer configuration wizard to quickly set up the FortiGate
unit and connect to the web-based manager or CLI.
Revision History
Table 1: FortiGate Cookbook Revision History
Version Changes
01-500-153797-20121231 Initial Version
FortiOS 5.0.1 9
http://docs.fortinet.com/
For more information Introduction
Training
Fortinet Training Services provides courses that orient you quickly to your new equipment, and
certifications to verify your knowledge level. Fortinet provides a variety of training programs to serve
the needs of our customers and partners world-wide.
To learn about the training services that Fortinet provides, visit the Fortinet Training Services web site
at http://campus.training.fortinet.com, or email training@fortinet.com.
Documentation
The Fortinet Technical Documentation web site, http://docs.fortinet.com, provides the most up-to-
date versions of Fortinet publications, as well as additional technical documentation such as
technical notes.
In addition to the Fortinet Technical Documentation web site, you can find Fortinet technical
documentation on the Fortinet Tools and Documentation CD, and on the Fortinet Knowledge Base.
Please send information about any errors or omissions in this or any Fortinet technical document to
techdoc@fortinet.com.
10 FortiGate Cookbook
http://docs.fortinet.com/
FortiOS Cookbook
NA
T
in b
and ternaetwee
the l ne n pr
P .1
1
ri 6
va 8.
2
rne rk e
te 1.
in 0/2
t
te 5
1. al
r n 5.
8. r n
99
al 25
16 te
2. in
n 5.
et 2
w 55
o .0
rk
19
2. Ga 20 an1
.1 wa 4
FortiGate
Gate Unitt
.1 w
20 te .1
20 y
in NAT/Route
Route mode
.2
20
2.
17
17
Solution
Most commonly, FortiGate units are installed as a gateway or router between a private network and
the Internet. The FortiGate unit operates NAT/Route mode to hide the addresses of the private
network from prying eyes on the Internet.
1 Connect the FortiGate wan1 interface to your ISP-supplied equipment.
N1 dem
WA Mo
ISP
Inte
r na
l
Inte
r na
lN
etw
ork
12 FortiGate Cookbook
http://docs.fortinet.com/
Connecting a private network to the Internet in NAT/Route mode
IP/Netmask 172.20.120.14/255.255.255.0
8 Select OK.
9 Select internal, then select Edit.
10 Change the following settings:
IP/Netmask 192.168.1.99/255.255.255.0
11 Select OK.
12 Go to Router > Static > Static Route and select Create New.
If you are having trouble with this step your FortiGate unit may be configured differently. Try going to
System > Network > Routing and under Static Route select Create New.
Device wan1
Gateway 172.20.120.2
A default route always has a Destination IP/Mask of 0.0.0.0/0.0.0.0. Normally you would have only
one default route. If the static route list already contains a default route, you can edit it or delete it
and add a new one.
14 Select OK.
16 Add the following security policy that allows users on the private network to access the Internet.
Schedule always
Service ALL
Action ACCEPT
18 Select OK.
Some FortiGate models include this security policy in the default configuration. If you have one of
these models, this step has already been done for you and as soon as your FortiGate unit is
connected and the computers on your internal network are configured, they should be able to
access the Internet.
This policy allows all traffic out with no other restrictions. While a good policy to use to test internet
connectivity, it is highly recommended that you configure security policies that scan for viruses and
other threats, and limit such global use.
Results
Open a web browser and browse to www.fortinet.com.
Go to Policy > Policy > Policy. Right-click on any of the column headings and select Column
Settings and add the Count column. This information shows the packet counts for the security
policy you added to verify that it is processing traffic.
Your FortiGate model may already have the Count feature set by default.
Go to Policy > Monitor > Policy Monitor to view the sessions being processed by the FortiGate unit.
A graph illustrating active sessions for each policy is displayed. Since there is only one policy, the
graph contains only one entry. You can select the bar graph for policy 1 to view the top sessions by
source address, destination address, or destination port.
If you can browse the web from the internal network, your configuration is successful. If you cannot,
try the steps described in “Troubleshooting NAT/Route mode installations” on page 20 to find the
solution.
14 FortiGate Cookbook
http://docs.fortinet.com/
Connecting a private network to the Internet in NAT/Route mode
In 92
te .1
1
r n 68
al .1
n .0/
et 2
w 5
o 5.
rk 2
ad 55
d .25
re 5
se .0
ss
99
C wo m
n au
1.
o r at
16 l
2. na
et to
m k ic
8.
19 ter
p g a
u et lly
In
te
r s I P f ro
o co m
e
n n D
od
r
ve
th fig H
m
er
e u C
ss
S
p ra P
ri it
re
va o
d
H
ad
te n
H 1
D
D AN
P
C
W
FortiGate
eUUnit
nit
in NAT/Route mode
co
IS ra
n
ig
P tio
u
p n
ro w
vi it
d h
es D
IP HC
P
Solution
If your Internet Service Provider uses DHCP to automatically provide Internet connectivity, only one
FortiGate configuration step is required to get a FortiGate unit installed and allowing connections
from a private network to the Internet.
The solution involves connecting your FortiGate unit to your ISP and your Internal network,
configuring the computers on your internal network to get their IP configuration automatically (using
DHCP), and then powering on the FortiGate unit and configuring it to get network settings from your
ISP using DHCP.
To use this one-step configuration solution, the default configuration of your FortiGate unit must
include a DHCP server for the internal interface and a default security policy that allows all sessions
from the internal network to the Internet. This default configuration is available on many desktop
FortiGate and FortiWifi models.
16 FortiGate Cookbook
http://docs.fortinet.com/
Connecting a private network to the Internet in one step
N1 dem
WA Mo
ISP
Inte
r na
l
Inte
rna
l Ne
two
rk
4 If required, configure the PCs to get their IP network configuration automatically using DHCP.
All of the PCs should acquire an IP address on the 192.168.1.0/255.255.255.0 network.
5 On one of the PCs, open a web browser and browse to https://192.168.1.99.
6 Log in to the FortiGate web-based manager by entering admin as the Name and leaving the
password blank.
7 Go to System > Network > Interface and Edit the wan1 interface.
8 Set the Addressing Mode to DHCP and select Retrieve default gateway from server.
9 Select OK.
If your ISP uses PPPoE or manual addressing you can configure the wan1 interface for these
options instead of DHCP.
Results
To test the connectionOn any of the PCs connected to the FortiGate internal interface, open a web
browser and browse to any Internet website using any of the PCs connected to the FortiGate internal
interface. You should also be able to connect to the Internet using FTP or any other protocol or
connection method.
You should then be able to view a graph of your active session from the FortiGate interface.Go to
Policy > Monitor > Policy Monitor to view the sessions being processed by the FortiGate unit.
The source address of most sessions is an address on the 192.168.1.0 network. The source NAT IP
for most sessions are the IP address acquired by the wan1 interface. The policy ID is 1, which is the
ID of the default security policy that allows users in the internal network to connect to the Internet.
You can see results by going to Policy > Policy > Policy Monitor to view a graph of active sessions
for each policy. Since there is only one policy, that graph contains only one entry. You can select the
bar graph to view the top sessions by source address, destination address, or destination port.
Since there is currently only one policy, the graph contains only one entry. You can select the bar
graph to view the top sessions by source address or use the dropdown menu in the top right corner
to view the top sessions by destination address or destination port.
Alternatively, tThe Top Sessions by Source Address dashboard widget presents another view of
sessions that you can customize also drill down to get more information about the current sessions.
Other dashboard widgets display session history, traffic history and per-IP bandwidth usage.
If the IP address seems incorrect or is missing, select Renew to renew the lease and get new IP
configuration information from the ISP. If you cannot get a valid IP address in this manner, the
FortiGate unit cannot communicate with the ISP’s DNS server.
Make sure the options to retrieve a default gateway and override the internal DNS are selected. If
your ISP does not supply a DNS server through DHCP, you can go to System > Network > DNS
and manually add one. or more DNS server IP addresses for the FortiGate unit to use. These DNS
server IP addresses are also used by the FortiGate DHCP server to provide the IP configuration
for PCs on the internal network.
If your ISP does not supply a default gateway through DHCP you can go to Router > Static >
Static Route > Create New and manually add a default route that points from the wan1 interface
to the ISP’s default gateway.
18 FortiGate Cookbook
http://docs.fortinet.com/
Connecting a private network to the Internet in one step
2 If the internal network is configured to get IP addresses from the FortiGate DHCP server, go to
System > Network > DHCP Server and Edit the DHCP server for the internal interface.
Verify that the DHCP server configuration uses the system DNS setting. Go to System > Monitor
> DHCP Monitor to view information about the PCs that have been configured by the FortiGate
unit DHCP server. There should be one entry here for each PC on the network that should have
received its address using DHCP.
Check the network configuration of the PCs on the internal network to make sure they are getting
the correct IP configuration from the FortiGate DHCP server. If they are not, they may not be able
to communicate with the FortiGate internal interface. If this is the case, attempt to renew their
DHCP lease, check other network configuration settings on the PC, and verify the physical
connections are correct.
The Use System DNS Setting DHCP server option causes the FortiGate DHCP server to supply
the DNS IP addresses in the System > Network > DNS page of the web-based manager. If
Override internal DNS is selected for a FortiGate interface that gets its configuration from a DHCP
server, the DNS server IP addresses acquired from the ISP are supplied by the FortiGate DHCP
server instead.
If a PC on the internal network sends a DHCP request to the FortiGate unit before it has acquired
DNS IP addresses from the ISP, then the FortiGate unit sends the DNS IP addresses DNS
web-based manager page. To make sure the PCs receive the correct DNS server IP addresses, you
can update the PCs DHCP leases.
If this does not solve the problem, use the steps described in “Troubleshooting NAT/Route mode
installations” on page 20 to find and fix the problem.
N int d th
AT er e
be nal Int
tw ne er
an
ee tw ne
P .1
1
ri 6
n or t
9
va 8.
pr k
2
te 1.
iv
at
in 0/2
e
te 5
1. al
r n 5.
8. rn
99
al 25
16 te
2. in
n 5.
et 2
w 55
o .0
rk
19
2. a 20 an1
.1 wa 4
FortiGate
Gate Unitt
.1 w
20 te .1
20 y
in NAT/Route
Route mode
.2
20
G
2.
17
17
Solution
Use the following steps to find and fix the problem that is preventing users from connecting to the
Internet.
1 Check the physical network connections between the PC and the FortiGate unit, as well as
between the FortiGate unit and your ISP’s equipment.
The Unit Operation dashboard widget indicates the connection status of FortiGate network
interfaces (System > Dashboard > Status).
2 Check the ISP-supplied equipment to make sure it is operating correctly.
3 Verify that you can connect to the internal IP address of the FortiGate unit.
For example, use a browser to connect to the web-based manager from the FortiGate internal
interface by browsing to its IP address (for example, https://192.168.1.99).
From the PC, ping the internal interface IP address. For example:
ping 192.168.1.99
If you cannot connect to the internal interface, verify the IP configuration of the PC and make sure
cables are connected and all network equipment, such as switches, is powered on and operating.
Go to the next step when you can connect to the internal interface.
4 Check the configuration of the FortiGate interface that connects to the Internet to make sure it
includes the proper addressing mode.
• If the addressing mode is manual, make sure the IP address and netmask areis correct.
• If the addressing mode is DHCP, see “What if it didn’t work?” on page 18.
20 FortiGate Cookbook
http://docs.fortinet.com/
Troubleshooting NAT/Route mode installations
5 To verify that you can communicate from the FortiGate unit to the Internet, access the FortiGate
CLI and use the execute ping command to ping an address or domain name on the Internet.
You can also use the execute traceroute command to troubleshoot connectivity to the
Internet.
6 Verify the DNS configurations of the FortiGate unit and the PCs on the internal network. You can
check for DNS errors by pinging or using traceroute to connect to a domain name. If the name
cannot be resolved the FortiGate unit or PC cannot connect to a DNS server and you should
confirm the DNS server IP addresses are present and correct. For example:
execute ping www.fortinet.com
ping: cannot resolve www.fre.com: Unknown host
Schedule always
Service ALL
Action ACCEPT
22 FortiGate Cookbook
http://docs.fortinet.com/
Inserting a FortiGate unit into a network without changing the network configuration (transparent mode)
Se
c
be allo urity
twe w p
seg en traffi olicie
me netw c s
10 nts or
.31 Int k
.10 er n
1.0 al n
/25 etw
5.2 ork
55 00
.25 1.1
5.0
1 .10
1 0.3
FortiGate
rtiGate Unit in
in
Transparent mode
Management IP
10.31.101.40 Ro
ute
r
This solution requires adding network security without replacing the router. The FortiGate unit will
block access from the Internet to the private network while allowing users on the private network to
connect to the Internet. The FortiGate unit will also monitor application usage and find and remove
viruses.
Solution
Install a FortiGate unit in transparent mode between the internal network and the router. Add a
security policy to the FortiGate unit that allows users on the internal network to connect to the
Internet and add virus scanning and application control to this security policy. No network changes
are required, except to provide the FortiGate unit with a management IP address.
Changing to transparent mode removes most configuration changes made in NAT/Route mode. If
you want to keep your current NAT/Mode configuration you should backup your configuration from
the System Information dashboard widget before proceeding.
4 Select OK.
5 Log in to the web-based manager by browsing to https://10.31.101.40.
You will need to change the IP address of the PC to an address on the 10.31.101.0/255.255.255.0
subnet.
6 Go to System > Network > DNS and add Primary and Secondary DNS servers.
7 Go to Policy > Policy > Policy and select Create New.
8 Leave the Policy Type as Firewall and leave the Policy Subtype as Address to add the following
security policy that allows users on the private network to access the Internet.
Schedule always
Service ALL
Action ACCEPT
11 Connect the FortiGate unit between the network and the router.
Connect the wan1 interface to the router internal interface. Connect the internal network to the
FortiGate internal interface.
24 FortiGate Cookbook
http://docs.fortinet.com/
Inserting a FortiGate unit into a network without changing the network configuration (transparent mode)
Results
From a PC on the internal network, open a web browser and browse to www.fortinet.com. You
should also be able to connect to the site.
Go to Policy > Policy > Policy. Right-click on the column headings and select Column Settings and
add the Count column. Check the Count column for the security policy you added to verify that it is
processing traffic.
Go to Policy > Monitor > Policy Monitor to view the sessions being processed by the FortiGate unit.
The source address of most sessions should be an address on the 10.31.10.0 network. The Src NAT
IP and Src NAT port columns are blank because no NAT it taking place. The policy ID is 1, which is
usually the ID of first security policy that you added.
You can also see results by viewing the graph of active session for each policy. Since there is only
one policy, that graph contains only one entry. You can select the bar graph for policy 1 to view the
top sessions by source address, destination address, or destination port/service.
The Top Sessions dashboard widget presents another view of sessions that you can also drill down
into to get more info about current sessions. Other dashboard widgets display session history, traffic
history, and per-IP bandwidth usage.
If a FortiGate unit operating in transparent mode is installed between a DHCP server and PCs that
get their address by DHCP, you must add a security policy to allow the DHCP server’s response to
get back through the FortiGate unit from the DHCP server to the DHCP client. The internal to wan1
policy allows the DHCP request to get from the client to the server, but the response from the server
is a new session, not a typical response to the originating request, so the FortiGate unit will not
accept this new session unless you add a wan1 to internal policy with the service set to DHCP.
If you can browse the Internet from the internal network, your configuration is successful. If you
cannot, try the steps described in “Troubleshooting transparent mode installations” on page 26 to
find the problem.
Se
c
be allo urity
twe w p
seg en traffi olicie
me netw c s
10 nts or
.31 Int k
.10 er n
1.0 al n
/25 etw
5.2 ork
55
0
.25
10
5.0
1.
10
1.
.3
10
FortiGate
rtiGate Unit iin
n
Transparent mode
Management IP
10.31.101.40 Ro
ute
r
Solution
Use the following steps to find and fix the problem that is preventing users from connecting through
the FortiGate unit.
1 Check the physical network connections between the network and the FortiGate unit, and
between the FortiGate unit and the Internet. The Unit Operation dashboard widget indicates the
connection status of FortiGate network interfaces.
2 Check the router and ISP-supplied equipment to make sure it is operating correctly.
3 Verify that you can connect to the internal interface by connecting to the management IP address
of the FortiGate unit from the internal network.
From the internal network, ping the management IP address. If you cannot connect to the internal
interface, verify the IP configuration of the PC and make sure the cables are connected and all
switches and other devices on the network are powered on and operating. Go to the next step
when you can connect to the internal interface.
4 To verify that you can communicate from the FortiGate unit to the Internet, access the FortiGate
CLI and use the execute ping command to ping an address on the Internet. You can also use
the execute traceroute command to troubleshoot connectivity to the Internet.
26 FortiGate Cookbook
http://docs.fortinet.com/
Troubleshooting transparent mode installations
5 Verify the DNS configurations of the FortiGate unit and the PCs on the internal network. You can
check for DNS errors by pinging or using traceroute to connect to a domain name. If the name
cannot be resolved the FortiGate unit or PC cannot connect to a DNS server and you should
confirm the DNS server IP addresses are present and correct.
For example:
ping www.fortinet.com
ping: cannot resolve www.fre.com: Unknown host
Schedule always
Service ALL
Action ACCEPT
28 FortiGate Cookbook
http://docs.fortinet.com/
Verifying the current firmware version and upgrading
Solution
View the current firmware version from the web-based manager and CLI. Download a new version of
FortiOS from the Fortinet Customer Support web site and install it from the web-based manager. You
must register your FortiGate unit to access firmware images. Register the FortiGate unit by visiting
http://support.fortinet.com and select Product Registration.
Always review the Release Notes before installing a new firmware version. They provide the
recommended upgrade path for the firmware release as well as additional information not available
in other documentation. Only perform a firmware upgrade during a maintenance window.
1 Log in to the web-based manager and view the dashboard System Information widget to see
the Firmware Version currently installed on your FortiGate unit.
From the FortiGate CLI you can also enter the following command. The first output line indicates
FortiOS firmware version installed on your FortiGate unit:
get system status
Version: Fortigate-60C v4.0,build0458,110627 (MR3 Patch 1)
Virus-DB: 11.00773(2010-05-04 13:32)
Extended DB: 0.00000(2010-03-16 10:31)
IPS-DB: 3.00000(2011-05-18 15:09)
FortiClient application signature package: 1.421(2011-09-08 10:19)
Serial-Number: FGT60C3G10002814
BIOS version: 04000010
Log hard disk: Need format
Internal Switch mode: switch
Hostname: FGT60C3G10002814
Operation Mode: NAT
Current virtual domain: root
Max number of virtual domains: 10
Virtual domains status: 1 in NAT mode, 0 in TP mode
Virtual domain configuration: disable
Results
The FortiGate unit uploads the firmware image file, upgrades to the new firmware version, restarts,
and displays the FortiGate login. This process takes a few minutes.
From the FortiGate web-based manager, go to System > Dashboard > Status. In the System
Information widget, the Firmware Version will show the updated version of FortiOS (or from the CLI
enter get system status).
30 FortiGate Cookbook
http://docs.fortinet.com/
Verifying the current firmware version and upgrading
You have only 3 seconds to press any key. If you do not press a key soon enough, the FortiGate unit
reboots and you must log in and repeat the execute reboot command.
If you successfully interrupt the startup process, the messages similar to the following appear
(depending on the FortiGate BIOS version):
[G]: Get firmware image from TFTP server.
[F]: Format boot device.
[B[: Boot with backup firmware and set as default
[C]: Configuration and information
[Q]: Quit menu and continue to boot with default firmware.
[H]: Display this list of options.
Enter G, F, Q, or H:
6 Type G to get to the new firmware image form the TFTP server.
7 When prompted, enter the TFTP server IP address, and local FortiGate IP address.
The IP address can be any IP address that is valid for the network the interface is connected to.
Make sure you do not enter the IP address of another device on this network.
When loading the firmware using this method, the existing configuration is reset to defaults. You will
need to reconfigure the IP addresses and load the configuration file from the System Information
widget on the Dashboard.
FortiGuard
Network
Solution
If you have purchased FortiGuard services and registered your FortiGate unit it should automatically
connect to the FortiGuard Distribution Network (FDN) and display license information about your
FortiGuard services. Verify whether the FortiGate unit is communicating with the FDN by checking
the License Information dashboard widget. The FortiGate unit automatically connects with the
FortiGuard network to verify the FortiGuard Services status for the FortiGate unit.
Any subscribed services should have a green check mark beside them, indicating that connections
are successful. A grey X indicates that the FortiGate unit cannot connect to the FortiGuard network,
or that the FortiGate unit is not registered. A red X indicates that the FortiGate unit was able to
connect but that a subscription has expired, or has not been activated.
Use the following steps to troubleshoot FortiGuard services.
1 Verify that you have registered your FortiGate unit, purchased FortiGuard services, and that the
services have not expired.
You can verify the support status for your FortiGate unit at the Fortinet Support website
(https://support.fortinet.com/).
2 Verify the status of the FortiGuard services on the FortiGate unit.
You can view the status of FortiGuard services from the License Information dashboard widget
or from the System > Config > FortiGuard page. The status information displayed here should
match the information on the support site.
If the information doesn’t match there may be a problem with communication between the
FortiGate unit and the FortiGuard network.
You can also view the FortiGuard connection status by going to System > Config > FortiGuard.
32 FortiGate Cookbook
http://docs.fortinet.com/
Setting up and troubleshooting FortiGuard services
3 Verify that the FortiGate unit can communicate with the Internet.
The FortiGate unit should be able to communicate with the FortiGuard network if it can
communicate with the Internet.
4 Go to Router > Monitor > Routing Monitor (For desktop FortiGate units, go to System >
Network > Routing) and verify that a default route is available and configured correctly.
5 Go to System > Network > DNS and make sure the primary and secondary DNS servers are
correct, as provided by your ISP. The FortiGate unit connects to the FortiGuard network using a
domain name, not a numerical IP address.
If the FortiGate interface connected to the Internet gets its IP address using DHCP, you should
make sure Override internal DNS is selected so that the FortiGate unit gets its DNS server IP
addresses from the ISP using DHCP.
6 Verify that the FortiGate unit can connect to the DNS servers using the execute ping command
to ping them.
7 You can also attempt a traceroute from FortiGate CLI to an external network using a domain
name for a location, for example, enter the command:
execute traceroute www.fortiguard.com
If the command cannot find the numeric IP address of www.fortiguard.com, then the FortiGate
unit cannot connect to the configured DNS servers.
8 Make sure that at least one security policy includes antivirus.
If no security policies include antivirus, the antivirus database may not be updated.
9 Verify that the FortiGate unit can communicate with the FortiGuard network.
At System > Config > FortiGuard > Antivirus and IPS Options, you can select Update now to
force an immediate update of the antivirus and IPS databases. After a few minutes, you can verify
if the updates were successful.
10 Test the availability of web filtering and email filtering lookups from System > Config >
FortiGuard > Web Filtering and Email Filtering options by selecting the Test Availability
button.
If the test is not successful, try changing the port that is used for web filtering and email filtering
lookups. The FortiGate unit uses port 53 or 8888 to communicate with the FortiGuard network
and some ISPs may block one of these ports.
11 Determine if there is anything upstream that might be blocking FortiGuard traffic, either on the
network or on the ISP’s network.
Many firewalls block all ports by default, and often ISPs block low-numbered ports (such as 53).
FortiGuard uses port 53 by default, so if it is being blocked, you need to either open the port or
change the port used by the FortiGate unit.
34 FortiGate Cookbook
http://docs.fortinet.com/
Setting up and troubleshooting FortiGuard services
The following flags in get webfilter status indicate the server status:
• D - the server was found through the DNS lookup of the hostname. If the hostname returns
more than one IP address, all of them will be flagged with D and will be used first for INIT
requests before falling back to the other servers.
• I - the server to which the last INIT request was sent.
• F - the server has not responded to requests and is considered to have failed.
• T - the server is currently being timed.
ad mi
ad
m nis
in tr
_p at
ro o r s
In
te
fil
e
rn
al
N
et
w
or
k
Fo HC
rt P
D
iG S
at er
e ve
U r
ni
t
Solution
Create a new administrator with the super_admin profile, to enable full access to all FortiGate
features.
1 Go to System > Admin > Administrators and select Create New to add the following
administrator:
Administrator Terry_White
Type Regular
Password password
2 Select OK.
36 FortiGate Cookbook
http://docs.fortinet.com/
Setting up an administrator account on the FortiGate unit
Administrator names and passwords are case-sensitive. You cannot include the < > ( ) # ”
characters in an administrator name or password. Spaces are allowed, however, not as the first or
last character. Spaces in a name or password can be confusing and require the use of quotes to
enter the name in the CLI.
The admin profile dictates what parts of the FortiGate configuration the administrator can see and
configure from web-based manager and CLI. You can add multiple profiles and assign users and
administrators different profiles, depending on what they are tasked to do with the FortiGate unit.
Results
Log in to the FortiGate using the user name of Terry_White and the password of password. As this
administrator, you can view all web-based manager pages and change all FortiGate configuration
settings.
From the FortiGate web-based manager,go to Log & Report > Event Log > System to verify that the
login activity occurred.
Select the log entry to view detailed information, which indicates the admin user connected. The
Message field indicates that Terry White logged in successfully from 192.168.1.1.
Go to System > Dashboard > Status, and view the System Information widget. The Current
Administrator field indicates the number of administrators logged in.
38 FortiGate Cookbook
http://docs.fortinet.com/
Setting up an administrator account on the FortiGate unit
99
1.
16 l
2. na
8.
19 ter
In
19
In 8.1
2.
te .0
16
rn /2
4
al 55
.1
N .2
20 ay 0
et 5
2. w .12
G 2. 1
w 5.
17 AN
.2
or 25
17 ate 20
20
k 5
.1
Primary ISP
.0
H 2
D AN
P
C
W
Backup ISP
Solution
This solution describes how to improve the reliability of a network’s connection to the Internet by
using two Internet connections to two different ISPs. In this solution, the primary ISP is connected to
wan1 with a static IP and the backup ISP is connected to wan2 using DHCP.
To allow the internal network to use wan1 to connect to the Internet add internal to wan1 security
policies. Add duplicate internal to wan2 security policies to use wan2 to connect to the Internet.
You can choose to reduce the amount of traffic when the wan2 interface is operating by adding
fewer security polices for connections to the wan2 interface. You could also use techniques such as
traffic shaping to limit the amount of traffic processed by the wan2 interface. You could also add
security policies that include FortiGuard web filtering or other web filtering techniques to block
popular but less important websites. Application control could also be used to limit the applications
that can be used when traffic is using the wan2 interface.
If you are using a desktop FortiGate unit, go to System > Admin > Settings, and select Dynamic
Routing, then Apply.
SP
a ry I
N 1 Prim
WA
Inte
rna
l
Inte
rna
lN
etw
ork
2 From a PC on the Internal network, log in to the FortiGate web-based manager using admin and
no password.
3 Go to System > Network > Interface and Edit the wan1 interface and change the following
settings:
IP/Netmask 172.20.120.14/255.255.255.0
IP/Netmask 192.168.1.99/255.255.255.0
5 Go to Router > Static > Static Route and select Create New to add the following default route.
Device wan1
Gateway 172.20.120.2
6 Go to System > Network > DNS and add Primary and Secondary DNS servers.
42 FortiGate Cookbook
http://docs.fortinet.com/
Connecting to two ISPs for redundant Internet connections
Some FortiGate models include this security policy in the default configuration. If you have one of
these models, this step has already been done for you.
Schedule always
Service ALL
Action ACCEPT
11 Select OK.
Make sure Retrieve Default Gateway from server is selected so that a default route is added to
the routing table. Normally in a dual Internet configuration, you would not select Override internal
DNS because you would not want the FortiGate unit to use the backup ISP’s DNS servers.
SP
u pI
ck
Ba
N 2
WA
ISP
ary
1 Prim
N
WA
Int
er n
al
Int
ern
al
Ne
tw
ork
Schedule always
Service ALL
Action ACCEPT
44 FortiGate Cookbook
http://docs.fortinet.com/
Connecting to two ISPs for redundant Internet connections
Set the default primary route to wan1 and add a ping server for wan1 and wan2
As a result of this configuration, the FortiGate unit will have two default routes, one that directs traffic
to wan1 and one that directs traffic to wan2. The default route to wan2 is obtained from the backup
ISP’s DHCP server. The ping servers verify the ability of the wan1 and wan2 interfaces to connect to
the Internet.
Because the wan2 default route is acquired from the ISP using DHCP, the distance of the wan2
default route must be changed by editing the wan2 interface.
1 Go to Router > Static > Static Route and Edit the wan1 default route.
2 Set the Distance to 10.
3 Go to System > Network > Interface list. Edit the wan2 interface and set the distance to 20 (or
any number higher than 10).
4 To confirm which default route is now actually being used by the FortiGate unit, go to Router >
Monitor > Routing Monitor to view the current FortiGate routing table. Routes that are not active
do not appear on the routing monitor. In this example, only the one static route should appear: the
wan1 default route. Its distance should be 10. Connected routes for the connected interfaces
should also appear.
If you edit the wan2 interface and set the distance to a lower value, for example, five, the wan1
default route is removed from the router monitor and is replaced with the wan2 default route,
because the wan2 route has the lower distance. You can also have both default routes appear in the
router monitor by setting their distances to the same value, for example. 10. When both routes have
the same distance, this is known as equal cost multi path (ECMP) routing and both default routes
are used. Sessions are load balanced between them. For an example, see “Distributing sessions
between dual redundant Internet connections with usage-based ECMP” on page 54.
5 Go to Router > Static > Settings and select Create New and add the wan1 ping server:
Interface wan1
Failover Threshold 5
6 Select Create New and add the wan2 ping server. The wan2 ping server is optional for this
configuration. However adding the wan2 ping server means the FortiGate unit will record even log
messages when the wan2 ping server can’t reach its destination.
Interface wan2
Failover Threshold 5
Results
If the wan1 ping server can connect to its ping server IP address the routing monitor appears as
shown above with a default route to the wan1 interface. All traffic to the Internet uses the wan1
interface and the internal to wan1 security policy. You can verify this by viewing the routing monitor
and by going to Policy > Policy > Policy. Right-click on the column headings and select Column
Settings and add the Count column. In the Count column, the internal to wan1 policy count will
increase, while the internal to wan2 count will not.
If you change the network so that the wan1 ping server cannot connect to its ping server IP address,
(for example, by physically disconnecting the cable from the wan1 interface), the default route should
change to the wan2 interface (called default route failover):
46 FortiGate Cookbook
http://docs.fortinet.com/
Connecting to two ISPs for redundant Internet connections
During a failover, incoming sessions received by a firewall VIP security policy from the wan1
interface before the failover may be sent out the wan2 interface after the failover. Outbound
sessions initiated by the server and sent out the VIP security policy will have their source IP address
modified according to the interface that sends the session to the Internet. If the wan1 link fails,
outgoing VIP sessions automatically fail over to wan2. The source address of these sessions
depends on the address defined in the firewall VIP.
If you can browse the web from the internal network, your configuration is successful. If you cannot,
try the steps described in “Troubleshooting NAT/Route mode installations” on page 20 to find the
problem.
Because the wan2 default route is acquired from the ISP using DHCP, the priority of the wan2
default route must be changed by editing the wan2 interface from the CLI.
1 Go to Router > Static > Static Route and Edit the wan1 default route.
2 Set the Distance to 10 and the Priority to 5
3 Enter the following CLI command to edit the distance and priority of the wan2 default route.
config system interface
edit wan2
set distance 10
set priority 20
end
Since the wan1 default route has the lowest priority it is considered the best route and all traffic
heading from the private network for the Internet uses the wan1 interface.
When two different distances are used on the wan1 and wan2 default routes, traffic originating from
the Internet can only be responded to by the interface with the default route with the lowest
distance metric (wan1). If a user from the Internet has established a connection to the Internal
network through the wan1 interface, the user would lose their connection if the wan1 connection to
the Internet fails. After a brief interruption the user would automatically re-connect through the
wan2 interface. When the wan1 Internet connection comes back, the user’s connection would be
interrupted a second time because it would have to switch back to the wan1 interface since the
wan2 interface would no longer be able to process traffic.
When ECMP is implemented, both interfaces are able to respond to traffic initiated from the Internet
as the routing is based on the session tables. The user would still lose their connection when the
wan1 Internet connection fails, but after connecting through the wan2 interface the user’s
connection would be able to continue on the wan2 interface after the wan1 connection was
restored resulting in only a single interruption.
A number of ECMP scenarios are available. For another, see “Distributing sessions between dual
redundant Internet connections with usage-based ECMP” on page 54.
48 FortiGate Cookbook
http://docs.fortinet.com/
Using a modem as a redundant Internet connection
99
1.
16 l
2. na
8.
19 ter
1
9
In
2
In 8.1
.1
te .0
6
r n /2
al 5
4
.1
N 5.2
20 ay 0
et 5
2. w .12
G 2. 1
w 5
17 AN
.2
o .2
17 ate 20
20
rk 5
.1
5
Primary ISP
.0
em
od
M
Backup ISP
Solution
This solution describes how to improve the reliability of a network’s connection to the Internet by
using two Internet connections. The primary internet connection is to the wan1 interface and the
backup internet connection is a dial-up connection using a modem and the FortiGate modem
interface. The modem interface is configured to be redundant for the wan1 interface and a ping
server is added for the wan1 interface. When the ping server determines that the wan1 interface
cannot connect to the Internet, the FortiGate unit dials the modem and the modem becomes the
active Internet connection.
You can choose to reduce the amount of traffic when the modem interface is operating, by adding
fewer security polices for connections to the modem interface. You could also use techniques such
as traffic shaping to limit the amount of traffic processed by the modem interface. You could also
add security policies that include FortiGuard web filtering or other web filtering techniques to block
popular, but less important websites. Application control could also be used to limit the applications
that can be used when traffic is using the modem interface.
If you are using a desktop FortiGate unit, go to System > Admin > Settings, and select Dynamic
Routing, then Apply.
P
IS
y
ar
im
Pr
1
AN
W
In
te
rn
Inal
te
rn
al
N
et
w
or
k
2 From a PC on the Internal network, log in to the FortiGate web-based manager using admin and
no password.
3 Go to System > Network > Interface and Edit the wan1 interface and change the following
settings:
IP/Netmask 172.20.120.14/255.255.255.0
IP/Netmask 192.168.1.99/255.255.255.0
5 Go to Router > Static > Static Route and select Create New to add the following default route.
Device wan1
Gateway 172.20.120.2
50 FortiGate Cookbook
http://docs.fortinet.com/
Using a modem as a redundant Internet connection
6 Go to Router > Static > Settings, select Create New, and add the following ping server:
Interface wan1
Failover Threshold 5
7 Go to System > Network > DNS and add Primary and Secondary DNS servers.
8 Go to Policy > Policy > Policy and select Create New.
9 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
10 Add the following security policy that allows users on the private network to access the Internet
through the wan1 interface.
Schedule always
Service ALL
Action ACCEPT
12 Select OK.
Connect a USB modem to the USB port, or insert an express card modem into the express card slot
of the FortiGate unit. You may have to restart the FortiGate unit after connecting an external modem.
P
IS
p
ku
ac
B
em
od
M
te m
In ode
ce
P
rfa
M
IS
y
ar
im
Pr
1
AN
W
In
te
rn
al
In
te
rn
al
N
et
w
or
k
Mode Redundant
Password Passw0rd
4 Select Apply.
5 Go to Policy > Policy > Policy and select Create New.
6 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
52 FortiGate Cookbook
http://docs.fortinet.com/
Using a modem as a redundant Internet connection
7 Add the following security policy that allows users on the private network to access the Internet
through the modem interface.
Schedule always
Service ALL
Action ACCEPT
Results
Test default route failover by physically disconnecting the wan1 interface cable. The modem will dial
in and when connected, the routing monitor wil show the modem default route. Connect to the
Internet and verify that the connection works and that traffic is accepted by an internal to modem
security policy.
With the modem dialed in if you cannot connect to the Internet, try the steps described in
“Troubleshooting NAT/Route mode installations” on page 20 to find the problem.
99
1.
16 l
2. na
8.
19 ter
1
In
9
2
In 8.1
.1
te .0
6
r n /2
4
al 5
.1
N 5.2
20 ay 0
et 5
2. w .12
G 2. 1
w 5
17 AN
.2
17 ate 20
o .2
20
rk 5
.1
Primary ISP
5
.0
2. Ga 20 N2
.1 wa 0
.1 A
30 te .1
30 W
20 y
.2
2.
17
17
Backup ISP
Solution
Use spillover (also known as usage-based) Equal Cost Multipath (ECMP) routing route. When one
Internet connection reaches a defined traffic level, sessions spill over to the other connection.
If you are using a desktop FortiGate unit, go to System > Admin > Settings, and select Dynamic
Routing, then Apply.
1 Go to Router > Static > Static Route, select Create New to add default route for the wan1
interface:
Device wan1
Gateway 172.20.120.2
Distance 10
54 FortiGate Cookbook
http://docs.fortinet.com/
Distributing sessions between dual redundant Internet connections with usage-based ECMP
Device wan2
Gateway 172.30.120.2
Distance 10
For ECMP to work, both default routes must have the same Distance and Priority.
3 Go to Router > Static > Settings and select Spillover as the ECMP Load Balance Method.
4 Under Dead Gateway Detection, select Create New to add the dead gateway detection for the
wan1 interface.:
Interface wan1
Ping Interval 5
Failover Threshold 5
5 Select OK and select Create New to add the dead gateway detection for the wan2 interface:
Interface wan2
Ping Interval 5
Failover Threshold 5
6 Select OK.
7 In the interface table, double-click wan1 and enter the Spillover Threshold to 10000 kbits/s and
select Edit.
8 In the interface table, double-click the wan2 interface and set the Spillover Threshold to 20000
kbits/s and select Edit.
You must add spillover thresholds to both interfaces, since the default spillover threshold of 0
means no bandwidth limiting. If one of the interfaces had a spillover threshold of 0, it would process
all sessions.
Results
Most sessions from the internal network to the Internet should use the wan1 interface. When traffic
on the wan1 interface reaches the spillover threshold, new sessions should begin using the wan2
interface. When usage on the wan1 interface reduces below the spillover threshold new sessions
should will again use the wan1 interface.
Usage-based ECMP routing is not actually load balancing, since routes are not distributed evenly
among the interfaces. A spillover threshold of 10000 kbits (10 Mbps) means that when the wan1
interface usage reaches 10 Mbps new sessions are spilled over to the wan2 interface. So during low
traffic times, wan1 would be processing all sessions.
The spillover threshold does not strictly limit the bandwidth processed by the interface because
new sessions with destination IP addresses that are already in the routing cache will use the cached
routes. This means, that even if wan1 is exceeding its bandwidth limit, new sessions can continue
to be sent out on wan1 if their destination addresses are already in the routing cache.
You can adjust the spillover thresholds to change how sessions are distributed between the ISPs as
you become familiar with your traffic patterns. You can use the Traffic History dashboard widget to
view bandwidth usage for the wan1 and wan2 interfaces.
You can see whether an interface is exceeding its Spillover Threshold by using this CLI command:
diagnose netlink dstmac list
The output is like this:
dev=wan2 mac=00:00:00:00:00:00 rx_tcp_mss=0 tx_tcp_mss=0 overspill-threshold=0 bytes=0
over_bps=0 sampler_rate=0
dev=wan1 mac=00:00:00:00:00:00 rx_tcp_mss=0 tx_tcp_mss=0 overspill-threshold=0 bytes=0
over_bps=0 sampler_rate=0
In the output, over_bps=1 means that the interface is exceeding its threshold, over_bps=0 means
that the interface has not exceeded its threshold.
56 FortiGate Cookbook
http://docs.fortinet.com/
Protecting a web server on a DMZ network
Web Server
DMZ network address
10.10.10.123
9
9
1.
16 l
2. na
8.
19 ter
in
dm .10
z .10
10
DMZ network
10.10.10.0/255.255.255.0
.1
0
Private internal network
192.168.1.0/255.255.255.0
2. ul 20 an1
User Address range .1 ou 4
17 efa 0.1 w
20 t r .1
20 te
192.168.1.100 to .2
D .2
192.168.1.150
2
17
Web Server
Internet address
172.20.120.123
Solution
This solution protects and provides access to the web server by:
• Installing the web server on a DMZ (demilitarized zone) network separate from your internal
network that exposes the web server to the Internet and the internal network.
• Connecting the DMZ network to a FortiGate interface (the DMZ or any other available interface).
• Creating a destination NAT (DNAT) security policy that includes UTM protection and that allows
users on the Internet to access the web server.
• Creating a route mode security policy that allows users on the internal network to access the web
server.
When you connect multiple networks to your FortiGate unit, you might want to add interface aliases
that describe the function of the interface or the network connected to it. Aliases are easy to add:
go to System > Network > Interface, edit an interface and then add descriptive text to the Alias
field. The alias appears with the interface name in most places on the web-based manager.
IP/Netmask 10.10.10.10/255.255.255.0
IP/Netmask 192.168.1.99/255.255.255.0
Alias Internet
IP/Netmask 172.20.120.14/255.255.255.0
6 Go to Router > Static > Static Route and Edit the default route.
7 For desktop FortiGate units, go to System > Network > Routing.
Device wan1(Internet)
Gateway 172.20.120.2
8 Go to System > Network > DNS and add Primary and Secondary DNS servers.
58 FortiGate Cookbook
http://docs.fortinet.com/
Protecting a web server on a DMZ network
IP address 10.10.10.123
Netmask 255.255.255.0
If the web server does not have the correct default gateway, its response packets will not reach the
DMZ interface, so the web server will appear to not be responding.
Create a DNAT security policy to allow sessions from the Internet to the web server
Configure DNAT (port forwarding) by creating a firewall virtual IP (VIP) that maps the Internet address
of the web server (172.20.120.123) to the actual IP address of the web server on the DMZ network
(10.10.10.123). Then, add this VIP to a security policy that allows users on the Internet to browse to
the Internet address of the web server (in this example, 172.20.120.123) to connect through the
FortiGate unit to the web server on the DMZ network.
1 Go to Firewall Objects > Virtual IP > Virtual IP and select Create New.
2 Complete the following:
Name Web-server-DNAT
3 Select OK.
4 Go to Policy > Policy > Policy and select Create New
5 Leave the Policy Type as Firewall and leave the Policy Subtype as Address and complete the
following:
Schedule always
Action ACCEPT
6 In the UTM Security Profiles section, select AntiVirus, Application Control, and IPS.
7 Select OK.
Create a route mode security policy to allow users on the internal network to connect to the web
server on the DMZ network
By using a route mode policy, users on the internal network can connect to the web server using its
actual DMZ IP address (by browsing to http://10.10.10.123 or https://10.10.10.123). Since users on
the internal network know the real address of the web server, you do not have to enable NAT in the
security policy that allows this access.
1 Go to Firewall Objects > Address > Address and select Create New to add a firewall address
for the user address range on the internal network.
Name Internal-user-addresses
Type Subnet
2 Select OK
60 FortiGate Cookbook
http://docs.fortinet.com/
Protecting a web server on a DMZ network
3 Select Create New to add a firewall address for the web server on the DMZ network.
Name DMZ-web-server-address
Type Subnet
Schedule Always
Action ACCEPT
7 In the UTM Security Profiles section select AntiVirus, Application Control, and IPS.
8 Select OK.
For this policy, you could have selected Enable NAT to enable source NAT. However, doing this
would mean that all packets from the internal network connecting to the web server would have the
same source address (the IP address of the DMZ interface). If you do not select Enable NAT you
can record web server usage according to the actual source address of sessions from the internal
network.
Add a security policy to allow users on the internal network to connect to the Internet
1 Go to Policy > Policy > Policy and select Create New.
2 Leave the Policy Type as Firewall and leave the Policy Subtype as Address and complete the
following:
Schedule Always
Service ALL
Action ACCEPT
3 In the UTM Security Profiles section, select AntiVirus and Application Control.
4 Select OK.
Results
Test the configuration by connecting to the web server from the internal network and from the
Internet.
If any of the following tests fail, re-check your FortiGate configuration. Also, make sure the web
server has the correct default route. This is especially important for connections from the internal
network because the security policies do not perform source NAT, so the web server needs the
correct default route to be able to send return packets correctly. You can also try the steps
described in “Troubleshooting NAT/Route mode installations” on page 20.
Testing the connection from the internal network to the web server
From the internal network, browse to the web server’s actual IP address (http://10.10.10.123 or
https://10.10.10.123). The connection should be successful. This communication uses the internal to
dmz policy. Go to Policy > Monitor > Policy Monitor to view sessions accepted by the internal to
dmz policy (in the example, policy 3). Sessions for other policies may also be visible.
Drill down to view details about the sessions accepted by the policy. They should all be HTTP (port
80) or HTTPS (port 443) sessions. The source address should be an address on the internal network
and the destination address should be the real address of the web server (10.10.10.123). The NAT
columns should be blank because no address translation is taking place.
62 FortiGate Cookbook
http://docs.fortinet.com/
Protecting a web server on a DMZ network
You can also view similar session information using the FortiGate packet sniffer. The following sniffer
output shows HTTP traffic (port 80) between a PC with IP address 192.168.1.110 and the web server
(IP address 10.10.10.123). You can see the HTTP sessions between the PC and the internal interface
and between the dmz interface and the web server. Note that the source and destination addresses
and ports are not translated:
The following FortiGate sniffer output shows HTTPS traffic (port 443) between IP address
192.168.1.110 and the web server (IP address 10.10.10.123). You can see the HTTPS sessions
between the PC and the internal interface and between the dmz interface and the web server. Note
that the source and destination addresses and ports are not translated:
diagnose sniffer packet any 'port 443' 4 10
interfaces=[any]
filters=[port 443]
5.124564 internal in 192.168.1.110.4366 -> 10.10.10.123.443: syn 3141078769
5.128308 dmz out 192.168.1.110.4366 -> 10.10.10.123.443: syn 3141078769
5.128538 dmz in 10.10.10.123.443 -> 192.168.1.110.4366: syn 2403170564 ack 3141078770
5.130991 internal out 10.10.10.123.443 -> 192.168.1.110.4366: syn 2403170564 ack 3141078770
5.131151 internal in 192.168.1.110.4366 -> 10.10.10.123.443: ack 2403170565
5.131414 dmz out 192.168.1.110.4366 -> 10.10.10.123.443: ack 2403170565
5.131702 internal in 192.168.1.110.4366 -> 10.10.10.123.443: psh 3141078770 ack 2403170565
5.138192 dmz out 192.168.1.110.4366 -> 10.10.10.123.443: psh 3141078770 ack 2403170565
5.138361 dmz in 10.10.10.123.443 -> 192.168.1.110.4366: ack 3141078914
5.138632 internal out 10.10.10.123.443 -> 192.168.1.110.4366: ack 3141078914
You could also use the following sniffer command to get similar results:
diagnose sniffer packet any 'host 192.168.1.110 or 10.10.10.123' 4 10
You can also view similar information using the packet sniffer. The following sniffer output shows
HTTP traffic (destination port 80) from 172.20.120.12 to 172.20.120.123. All packets received by the
wan1 interface have a source address of 172.20.120.12 and a destination address of
172.20.120.123. All packets exiting from the dmz interface have a source address of 172.20.120.12
and a destination address of 10.10.10.123:
64 FortiGate Cookbook
http://docs.fortinet.com/
Protecting a web server on a DMZ network
es
lici
y po raffic work
t
i
cur w
t net nts inte
Se allo ween gme rna
t se l
be Protected
Email Server
10.31.101.200
wa IP
n1 ent 40
g em .101.
n a 1
Ma 10.3
FortiGate
F tiG t U
Unit
in Transparent
mode
1
0 Us 10
.3 e .3
U 1. dr 1.
1 r 1
.1 A .1
se 0/ es [1
00
0 d 0
1.1
r 25 s -3
N 5 R 0
.10
et .2 a ]
w 5 ng
1
0.3
o 5. e
rk 2
1
5
5
.0
Router
Solution
Insert a FortiGate unit in transparent mode between the email server and the network. Configure the
FortiGate unit to allow sessions from the network to the email server and apply antivirus protection to
these sessions to keep viruses from reaching the email server.
Users on the Internal network connect to the email server to get their mail using IMAP, IMAPS, POP3,
POP3S, or HTTPS (for webmail) and to send outgoing email using SMTP or SMTPS. The email server
sends outgoing email by connecting to the Internet using SMTP or SMTPS and receives incoming
email from the Internet using SMTP or SMTPS.
66 FortiGate Cookbook
http://docs.fortinet.com/
Protecting an email server with a FortiGate unit without changing the network (transparent Mode)
5 Select OK.
6 Log in to the web-based manager by browsing to https://10.31.101.40.
You will need to change the IP address of the PC to an address on the 10.31.101.0/255.255.255.0
subnet.
7 Go to System > Network > Interface and Edit the wan1 interface.
8 For Administrative Access select HTTPS and SSH and select OK.
9 Go to System > Network > DNS and add Primary and Secondary DNS servers.
Name Email_Server_Address
Interface internal
Name Email_User_Network
Type IP Range
Interface wan1
Schedule Always
Action ACCEPT
68 FortiGate Cookbook
http://docs.fortinet.com/
Protecting an email server with a FortiGate unit without changing the network (transparent Mode)
Schedule Always
Action ACCEPT
11 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
12 Add a security policy that allows the email server to receive incoming email from the Internet
using SMTP and SMTPS:
Schedule Always
Action ACCEPT
15 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
16 Add a security policy that allows the email server to connect to any DNS server:
Email_Server_Addr
Source Address
ess
Schedule Always
Service DNS
Action ACCEPT
17 Select OK.
18 Connect the FortiGate unit between the email server and the user network.
Connect the wan1 interface to a switch connected to the user network. Connect the internal
interface to email server.
Results
The functionality of the email server should not be changed after the FortiGate unit is inserted. To
confirm this, you should access the email server from the user network using all the email protocols
that users on the network normally use.
As you test email services, in the web-based manager, you can go to Policy > Monitor > Policy
Monitor to view the FortiGate security policy activity. The Policy Monitor displays bar graphs that
show the sessions for each policy. The bar graphs are labelled with the policy ID.
If no other security policies have been added to the FortiGate unit, and if you followed the steps in
the order listed, the FortiGate will have 4 security policies.
70 FortiGate Cookbook
http://docs.fortinet.com/
Protecting an email server with a FortiGate unit without changing the network (transparent Mode)
When you connect from the user network to the email server using one of the email protocols (POP3,
IMAP, or HTTPS) the sessions are accepted by policy 1 and the policy monitor could look similar to
this:
The policy monitor shows sessions accepted by policy 1. You can display information about the
sessions by selecting the bar graph. For example, you can display the source and destination
addresses and services used by sessions accepted by policy 1 as well as a listing of all active
sessions. When you send an outgoing email to the server using SMTP, the policy monitor could look
similar to this:
The policy monitor shows sessions accepted by three policies. Drilling down into the policy 1 graph
shows SMTP sessions and possibly POP3 and HTTPS sessions between an address on the user
network and the email server. Drilling down into the policy 2 graph shows SMTP sessions between
the email server and an Internet address caused by the email server sending outgoing email. Drilling
down into the policy 4 graph shows DNS sessions between the email server and a DNS server.
You can test virus scanning by attaching a virus test file to an email message. You can get the EICAR
test file from http://www.eicar.org.
The Log and Archive Statistics dashboard widget displays information about viruses caught
including details about the date an time on which the virus was detected, the source and destination
address of the session in which the virus was caught, and the service.
Finally, when the file is removed from the email its replaced with a message similar to the following:
Dangerous Attachment has been Removed. The file "eicar.com" has been removed because of a virus.
It was infected with the "EICAR_TEST_FILE" virus. File quarantined as:
""."http://www.fortinet.com/ve?vid=2172"
You can customize this message by going to System > Config > Replacement Message > UTM >
Virus Block Message. The default message specifies that the file is quarantined. If you have not
configured quarantine, you can remove this part of the message.
If you can send and receive email, your configuration is successful. If you cannot, try the steps
described in “Troubleshooting transparent mode installations” on page 26 to find the problem.
72 FortiGate Cookbook
http://docs.fortinet.com/
Using port pairing to simplify a transparent mode installation
n1
wa
a l to pair wa
n1
t
er n por
Int Protected
Web Server
10.31.101.210
inte IP
rna
l ent 40
g em .101.
na 1
Ma 10.3
FortiGate
F tiG t Unit
in Transparent
mode
1
0 U 10
.3 s .3
U 1 . re 1 .
1 er 1
.1 A .1
se 0/ s [1
00
0 d 0
r 25 s R -3
1.1
n 5 a 0
et .2 n ]
0
w 5 g
1.1
o 5. e
rk 2
.3
10
5
5
.0
Router
Solution
You can enable port pairing in transparent mode to so that all traffic accepted by one FortiGate
interface can only exit out of another FortiGate interface. Restricting traffic in this way simplifies your
FortiGate configuration because security policies between these interfaces are pre-configured. All
you have to do is make the physical configurations and then add a port pair. Then, when you create a
new security policy for sessions accepted by one of the interfaces in the pair, the second interface is
automatically added to the security policy.
3 Go to System > Dashboard > Status > System Information and beside Operation Mode select
Change and configure the following:
4 Select OK.
5 Log in to the web-based manager by browsing to https://10.31.101.40.
You will need to change the IP address of the PC to an address on the 10.31.101.0/255.255.255.0
subnet.
6 Go to System > Network > DNS and add Primary and Secondary DNS servers.
Creating the internal and wan1 port pair and adding firewall addresses and security policies
1 Go to System > Network > Interface.
2 Select the down-arrow on the Create New button and select Port Pair.
3 Configure the following port pair:
Name internal-wan1-port-pair
internal
Selected Members
wan1
You can only add interfaces to a port pair if no other configuration objects have been added for the
interfaces. For example, you can not add an interface to a port pair if you have added security
policies or firewall addresses for it.
4 Select OK.
5 Go to Firewall Objects > Address > Address and add select Create New to add the following
firewall addresses
For the web server:
Name Web-Server-Address
Type Subnet
Interface any
74 FortiGate Cookbook
http://docs.fortinet.com/
Using port pairing to simplify a transparent mode installation
Name Web-Server-User-Network
Type IP Range
Interface any
Schedule Always
Action ACCEPT
9 In the UTM Security Profiles section, select AntiVirus and Application Control.
10 Select OK and select Create New.
11 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
12 Add a security policy that allows connections from the web server to the user network and the
Internet using any service:
Web-Server-
Source Address
Address
Schedule Always
Service ALL
Action ACCEPT
13 In the UTM Security Policies section, select AntiVirus and Application Control.
14 Select OK.
15 Connect the web server to the FortiGate wan1 interface and the user network to the FortiGate
internal interface.
Results
Connect to the web server from the internal network. Go to Policy > Policy > Policy and verify that
the count (right-click the column headers and add the Count column if it does not appear on the
table) for the internal to wan1 policy has increased indicating that this policy is accepting traffic from
the user network to the web server. Go to Policy > Monitor > Policy Monitor to drill down for more
information about the sessions accepted by the internal to wan1 policy.
If you can connect to the web server, and if the web server can connect to the Internet, your
configuration is successful. If you cannot, try the steps described in “Troubleshooting transparent
mode installations” on page 26 to find the problem.
76 FortiGate Cookbook
http://docs.fortinet.com/
Connecting networks without translating addresses (FortiGate unit in Route mode)
9
9
1.
16 l
2. na
8.
19 ter
d
10. mz
P .1
in
1
ri 6
9
va 8
2
10.
te .1.
1 DMZ network
0.1
in 0/2
te 5
0 10.10.10.0/255.255.255.0
r n 5.
al 25
N 5.
et 2
w 55
o .0
rk
2. ul 20 an1
.1 ou 4
17 efa 0.1 w
20 t r .1
20 te
.2
D .2
2
17
Solution
Install the FortiGate unit in NAT/Route mode between the subnets and create route mode security
policies that allow sessions between the networks without performing address translation.
Name dmz
IP/Netmask 10.10.10.10/255.255.255.0
Name internal
IP/Netmask 192.168.1.99/255.255.255.0
Name wan1
IP/Netmask 172.20.120.14/255.255.255.0
wan1
DMZ internal
3 Go to Router > Static > Static Route and Edit the default route.
For desktop FortiGate units, go to System > Network > Routing.
Device wan1(Internet)
Gateway 172.20.120.2
4 Go to System > Network > DNS and add Primary and Secondary DNS servers.
78 FortiGate Cookbook
http://docs.fortinet.com/
Connecting networks without translating addresses (FortiGate unit in Route mode)
5 Configure the following IP network settings for the computers on the internal network.
IP address 192.168.1.x
Netmask 255.255.255.0
6 Configure the IP following IP network settings for the computers on the DMZ network.
IP address 10.10.10.x
Netmask 255.255.255.0
If the devices on both networks do not have the correct default route, their response packets will
not be returned to the source network.
Create route mode security policies to allow connections between the internal and DMZ networks
1 Go to Firewall Objects > Address > Address and select Create New to add a firewall address
for the internal network.
Name Internal-network
Type IP Range
Interface Internal
Name DMZ-network
Type IP Range
Interface dmz
Schedule Always
Service ALL
Action ACCEPT
6 In the UTM Security Profiles section, select AntiVirus and Application Control.
7 Select OK and select Create New.
8 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
9 Add a security policy that allows users on the DMZ network to connect to the internal network.
Schedule Always
Service ALL
Action ACCEPT
10 In the UTM Security Profiles section, select AntiVirus and Application Control.
To make these NAT policies, you could have selected Enable NAT to enable source NAT. However,
doing this would mean that all packets from the one network connecting to the other network would
have the same source address as the FortiGate unit interface connected to that network.
80 FortiGate Cookbook
http://docs.fortinet.com/
Connecting networks without translating addresses (FortiGate unit in Route mode)
Results
Test the configuration by connecting from one network to the other, for example by pinging an
address on the internal network from the DMZ network. You can use the FortiGate sniffer to show the
ping packets going from one network to the other and the replies coming back without any NAT. The
following example shows a device at 10.10.10.20 pinging 192.168.1.120.
diagnose sniffer packet any 'icmp' 4 8
interfaces=[any]
filters=[icmp]
6.916578 dmz in 10.10.10.20 -> 192.168.1.120: icmp: echo request
6.916794 internal out 10.10.10.20 -> 192.168.1.120: icmp: echo request
6.917459 internal in 192.168.1.120 -> 10.10.10.20: icmp: echo reply
6.917595 dmz out 192.168.1.120 -> 10.10.10.20: icmp: echo reply
7.918637 dmz in 10.10.10.20 -> 192.168.1.120: icmp: echo request
7.918723 internal out 10.10.10.20 -> 192.168.1.120: icmp: echo request
7.919303 internal in 192.168.1.120 -> 10.10.10.20: icmp: echo reply
7.919391 dmz out 192.168.1.120 -> 10.13.10.20: icmp: echo reply
If any of the connections fail, re-check your FortiGate configuration and make sure the devices on
each network have the correct default route. You can also try the steps described in
“Troubleshooting NAT/Route mode installations” on page 20.
in 2.
w
xp pro
te 16
eb
19
lic xy
rn 8
al .1
it
.9
9
P
riv Ne
at tw
e o
In rk
te
rn
la
Solution
Use the following steps to enable the explicit web proxy on the FortiGate internal interface and
configure it to accept HTTP traffic on port 8080.
Enabling the explicit web proxy on an interface connected to the Internet is a security risk because
anyone on the Internet who finds the proxy could use it to hide their source address. If you enable
the proxy on such an interface make sure authentication is required to use the proxy.
Adding a web proxy security policy to allow the web proxy to accept traffic
1 Go to Policy > Policy > Policy and select Create New.
2 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
82 FortiGate Cookbook
http://docs.fortinet.com/
Setting up the explicit web proxy for users on a private network
Schedule always
Service webproxy
Action ACCEPT
Results
Web browsers configured to use the proxy server are able to connect to the Internet. If no other
security policies allow HTTP traffic from the private network connect to the Internet then users must
use the explicit proxy to connect to the Internet.
You can add authentication to the explicit web proxy security policy to require users to authenticate
before connecting to the Internet.
Fo b C
W
rt a
e
iG ch
at e
e
Solution
In this configuration, all of the users on the private network access the Internet though a single
security policy on the FortiGate unit that accepts all sessions connecting to the Internet. Web
caching is just added to this security policy.
The example also describes how to configure the security policy to cache HTTP traffic on port 80 and
8080 by adding a protocol options profile that looks for HTTP traffic on TCP ports 80 and 8080.
3 Select Apply.
84 FortiGate Cookbook
http://docs.fortinet.com/
Setting up web caching of Internet content for users on a private network
Results
The FortiGate web cache intercepts all HTTP traffic accepted by the security policy and attempts to
serve cached content instead of downloading content from the Internet.
You can go to WAN Opt. & Cache > Monitor > Cache Monitor to view the Web Cache Monitor
showing caching results for the last 10 minutes, Hour, Day, or Month.
FortiGate
Cluster
al
rn
te
in
h
itc
P .1
1
ri 6
w
9
va 8
S
2
1
te .1.
an
in 0/2
w
m
te 5
d
r n 5.
al 25
N 5.
2
an
et 2
w 55
w
o .0
rk
h
z
itc
m
d
w
S
2
te al
an
ou rn
al
R e
r
rn
xt
E
te
in
1
an
w
Solution
Configure two FortiGate units to form a FortiGate HA cluster. Configure basic settings on the cluster
to allow users on the internal network to access the Internet.
The FortiGate units to be clustered must have the same hardware configuration, including the
following:
• The same hard disk configuration.
• The same AMC or FMC cards installed in the same slots.
• The same interface/hub/switch mode if the FortiGate units contain a switch interface.
• The same soft switch configuration.
Also you should make sure that:
• No FortiGate interfaces are configured for DHCP or PPPoE addressing.
• Both FortiGate units have the same firmware build.
• Both FortiGate units are set to the same operating mode (NAT or transparent).
• Both FortiGate units are set to the same VDOM mode.
86 FortiGate Cookbook
http://docs.fortinet.com/
Employing high availability to improve network reliability
Setting up HA
1 Power on a FortiGate unit and log into the web-based manager.
2 On the System Information Dashboard widget, beside Host Name select Change.
3 Enter a New Name and select OK.
Changing the host name makes it easier to identify individual cluster units when the cluster is
operating.
4 Go to System > Config > HA and change the following settings to enable HA mode:
Mode Active-Passive
Password HAPassw0RD
5 Set dmz and wan2 to be the Heartbeat Interfaces and set the Priority of both to 50.
FortiGate units cannot form a cluster if a FortiGate interface is configured to get its IP address using
DHCP or PPPoE. If the FortiGate unit reverts back standalone mode after you select OK, check the
FortiGate interfaces and if required change the addressing mode of all of the interfaces to Manual.
The best practice is to configure and connect two or more heartbeat interfaces. If heartbeat
communication is interrupted, the cluster will form a so-called split-brain configuration where both
cluster units operate like standalone FortiGate units, but with the same network configuration,
resulting in a service interruption. Redundant heartbeat links avoids this problem.
6 Select OK.
The FortiGate unit negotiates to establish an HA cluster. When you select OK you may temporarily
lose connectivity with the FortiGate unit because HA changes the MAC addresses of the FortiGate
interfaces. To be able to reconnect sooner, you can update the ARP table of your PC by deleting the
ARP table entry for the FortiGate unit (or just deleting all ARP table entries). You may be able to
delete the ARP table of your PC from a command prompt using a command similar to arp -d.
You can optionally configure one of the FortiGate units with a higher Device Priority so that this unit
always becomes the primary unit.
9 Connect FortiGate units to each other to form a cluster and connect the cluster to the network.
• Connect the wan1 interfaces of each cluster unit to a switch connected to the Internet.
• Connect the internal interfaces of each cluster unit to a switch connected to the internal
network.
• Connect the dmz interfaces of the cluster units together using a crossover or regular Ethernet
cable.
• Connect the wan2 interfaces of the cluster units together using a crossover or regular Ethernet
cable.
10 Power on the FortiGate units.
As they start, they negotiate to choose the primary unit and to form a cluster. This negotiation
occurs with no user intervention and normally just takes a few seconds.
The FortiGate units must be connected together by at least one heartbeat interface for to
negotiation to take place.
IP/Netmask 172.20.120.14/255.255.255.0
IP/Netmask 192.168.1.99/255.255.255.0
88 FortiGate Cookbook
http://docs.fortinet.com/
Employing high availability to improve network reliability
4 Go to Router > Static > Static Route and select Create New to add the following default route.
For desktop FortiGate units, go to System > Network > Routing and select Create New.
Device wan1
Gateway 172.20.120.2
5 Go to System > Network > DNS and add Primary and Secondary DNS servers.
6 Go to Policy > Policy > Policy and select Create New.
7 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
8 Add the following security policy that allows users on the private network to access the Internet.
Some FortiGate models include this security policy in the default configuration. If you have one of
these models, this step has already been done for you and as soon as your FortiGate unit is
connected, and the computers on your internal network are configured, they should be able to
access the Internet.
Schedule always
Service ALL
Action ACCEPT
Results
Just like a standard FortiGate NAT/Route
mode configuration, users on the Internal
network should be able to connect to the
Internet. Check the System Information
Widget on the dashboard to confirm the
HA status.
When a cluster first starts up, do the
following to make sure that it is configured
and operating correctly.
1 Set ping to continuously ping the
cluster, and then start a large
download, or, in some other way,
establish ongoing traffic through the
cluster.
2 While traffic is going through the cluster, disconnect the power from one of the cluster units.
Traffic should continue with minimal interruption.
3 Start up the cluster unit that you powered off.
The unit should re-join the cluster with little or no affect on traffic.
4 Disconnect a cable for one of the HA heartbeat interfaces.
The cluster should keep functioning, using the other HA heartbeat interface.
5 Log in to the web-based manager and from the Dashboard, verify that the System Information
widget displays both cluster units.
6 Verify that the Unit Operation graphic shows that the correct cluster unit interfaces are
connected.
7 Go to System > Config > HA and verify that all of the cluster units are displayed on the cluster
members list.
8 From the cluster members list, edit the primary unit (master), and verify the cluster configuration is
as expected.
9 Go to System > Config > HA > View HA Statistics and view information about the cluster and
the traffic it is processing.
90 FortiGate Cookbook
http://docs.fortinet.com/
Upgrading the firmware installed on a FortiGate HA cluster
Solution
You can upgrade the FortiOS firmware running on an HA cluster in the same manner as upgrading
the firmware running on a standalone FortiGate unit. During a normal firmware upgrade, the cluster
upgrades the primary unit and all subordinate units to run the new firmware image. The firmware
upgrade takes place without interrupting communication through the cluster.
Upgrading cluster firmware to a new major release (for example upgrading from 4.0 MRx to 5.0
MRx) is supported for clusters. Make sure you are taking an upgrade path described in the Release
Notes. Even so you should back up your configuration. Only perform a firmware upgrade during a
maintenance window.
View the current firmware version from the web-based manager or CLI. Download a new version of
FortiOS from the Fortinet Customer Support web site and install it from the web-based manager.
Firmware images for all FortiGate units are available on the Fortinet Customer Support web site. You
must register your FortiGate unit to access firmware images. Register the FortiGate unit by visiting
http://support.fortinet.com and select Product Registration.
1 Log in to the web-based manager and view the dashboard System Information widget to see
the Firmware Version currently installed on your FortiGate unit.
From the FortiGate CLI, you can also enter the following command. The first output line indicates
FortiOS firmware version installed on your FortiGate unit:
Always remember to back up your configuration before doing any firmware upgrades.
11 Find the firmware image file that you downloaded and select OK to upload and install the
firmware build on the FortiGate unit.
Results
To upgrade the firmware without interrupting communication through the cluster, the cluster goes
through a series of steps that involve first upgrading the firmware running on the subordinate units,
then making one of the subordinate units the primary unit, and finally upgrading the firmware on the
former primary unit. These steps are transparent to the user and the network, but depending upon
your HA configuration may result in the cluster selecting a new primary unit.
92 FortiGate Cookbook
http://docs.fortinet.com/
Upgrading the firmware installed on a FortiGate HA cluster
From the FortiGate web-based manager go to System > Dashboard > Status. In the System
Information widget, the Firmware Version will show the updated version of FortiOS (or from the CLI
enter get system status).
There is a possibility that the firmware upgrade from the web-based manager does not load
properly. If this occurs, you may find that some of the FortiGate units in the cluster will not boot, or
continuously reboot.
It is best to perform a fresh install of the firmware from a reboot using the CLI. This procedure
installs a firmware image and resets each FortiGate unit to default settings. Once the new firmware
versions is installed you can restore the configuration of the FortiGate units in the cluster and the
cluster should reform. For more information, see “Installing FortiGate firmware from a TFTP server”
on page 30.
S 92 AN
al .1 I
es 6 D
1 L
10 0 rk
ID 0 wo
N 8.3 30
V
et 0
N 8.1 et
w .0
LA 6 n
o
V .1 ing
rk
r
19 ee
in
2
ng
E
VLAN
Switch
al
rn
te
in
1
an
w
M 1 LA
ar 92 N
FortiGate
FortiGat
te Unit
Unit
ke .1 I
ti 68 D
n . 2
in NAT/Route mode
g 2 0
V
N 0.
et 0
w
o
rk
Solution
This solution uses VLANs to connect three networks to the FortiGate internal interface.
• Packets from each network pass through a VLAN switch before reaching the FortiGate unit. The
VLAN switch adds different VLAN tags to packets from each network.
• To handle VLANs on the FortiGate unit, add VLAN interfaces to the internal interface for each
network
• Add a DHCP server to each VLAN interface.
• Create security policies to allow each network to access the Internet.
This solution assumes you have configured a VLAN switch to tag packets from the three networks.
94 FortiGate Cookbook
http://docs.fortinet.com/
Connecting multiple networks to a FortiGate interface using virtual LANs
Name Engineering-net
Type VLAN
Interface internal
VLAN ID 10
2 Select Create New to add a VLAN interface for the marketing network:
Name Marketing-net
Type VLAN
Interface internal
VLAN ID 20
3 Select Create New to add a VLAN interface for the sales network:
Name Sales-net
Type VLAN
Interface internal
VLAN ID 30
Mode Server
Type Regular
IP 192.168.10.100 - 192.168.10.200
2 Select OK and select Create New to add a DHCP server for the engineering network:
Mode Server
Type Regular
IP 192.168.20.100 - 192.168.20.200
3 Select OK and select Create New to add a DHCP server for the sales network:
Mode Server
Type Regular
IP 192.168.30.100 - 192.168.30.200
96 FortiGate Cookbook
http://docs.fortinet.com/
Connecting multiple networks to a FortiGate interface using virtual LANs
4 Select OK.
5 Configure the computers on the networks to get their addresses using DHCP.
6 For computers with manual IP configurations, make sure their default routes point to the correct
FortiGate VLAN interface.
Schedule Always
Service ALL
Action ACCEPT
Schedule Always
Service ALL
Action ACCEPT
8 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
9 Add a security policy that allows users on the sales network to connect to the Internet.
Schedule Always
Service ALL
Action ACCEPT
10 Select OK.
Results
Users from any of the networks should be able to connect to the Internet. Go to Policy > Monitor >
Policy Monitor to view information about sessions through the FortiGate unit.
If users on the networks cannot connect to the Internet, re-check your FortiGate configuration. You
can also try the steps described in “Troubleshooting NAT/Route mode installations” on page 20.
98 FortiGate Cookbook
http://docs.fortinet.com/
Using Virtual Domains to host more than one FortiOS instance on a single FortiGate unit
17
2.
20
po .20
.1
rt3
20
Gateway
Router
VD
17
172.20.120.2 OM
2.
20
po .10
-B
.1
rt1
20
VD
OM
po 2.1
-A
rt4 68
19
.
20
.1
po 2.1
rt2 68
19
FortiGate Unit
with two Virtual
.
10
.1
Domains
Company B
Company A 192.168.20.0
192.168.10.0
Solution
Use Virtual domains (VDOMs) to divide the FortiGate unit into two or more virtual instances of FortiOS
that function similar to two independent FortiGate units. Each VDOM has its own physical interfaces,
routing configuration, and security policies.
This example simulates an ISP that provides Company A and Company B with Internet services.
Each company would have its own Internet IP address and internal network. This configuration
requires:
• Two VDOMs: VDOM-A and VDOM-B each operating in NAT/Route mode with two interfaces, one
for a connection to the Internet and one for a connection to the internal network.
• The routing configuration of the example is simplified to only require a default static route from
each VDOM to an Internet gateway router.
2 Go to Global > VDOM > VDOM and select Create New to create two VDOMs with the following
configuration:
For company A:
Name VDOM-A
Enable Select
For company B:
Name VDOM-B
Enable Select
3 Go to Global > Network > Interface and Edit port1 and add it to VDOM-A.
4 Go to Global > Admin > Administrators and select Create New to add an administrator for
VDOM-A.
Administrator a-admin
Type Regular
Password passw0rda
5 Go to Global > Admin > Administrators and select Create New to add an administrator for
VDOM-B.
Administrator b-admin
Type Regular
Password passw0rdb
Device port1
Gateway 172.20.120.2
4 Go to System > Network > DHCP Server and select Create New.
Mode Server
Type Regular
IP 192.168.10.100-192.168.10.200
11 Create a security policy allowing users on the company A internal network to connect to the
Internet.
Schedule always
Service ALL
Action ACCEPT
13 Select OK.
You should be able to connect to the Internet, if not check the configuration or use the steps
described in “Troubleshooting NAT/Route mode installations” on page 20 to find the problem.
15 Configure the computers on the company A network to get their IP configuration automatically
using DHCP.
Device port3
Gateway 172.20.120.2
5 Go to System > Network > DHCP Server and select Create New to add a DHCP server.
Mode Server
Type Regular
IP 192.168.20.100-192.168.20.200
11 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
12 Create a security policy that allows users on the company B internal network to connect to the
Internet.
Schedule always
Service ALL
Action ACCEPT
14 Select OK.
You should be able to connect to the Internet, if not check the configuration or use the steps
described in “Troubleshooting NAT/Route mode installations” on page 20 to find the problem.
16 Configure the computers on the company B network to get their IP configuration automatically
using DHCP.
Results
Connect to the Internet from the company A and company B networks. From either VDOM, go to
Policy > Monitor > Policy Monitor and confirm that the policies that you added are allowing traffic
through the individual VDOMs.
You can use the packet sniffer to verify that traffic is staying in a VDOM. For example, enter the
following command from the FortiGate CLI and then ping from one of the internal networks to an
address on the Internet.
diagnose sniffer packet any 'icmp' 4 10
interfaces=[any]
filters=[icmp]
10.728968 port4 in 192.168.20.100 -> 66.171.121.34: icmp: echo request
10.729158 port3 out 172.20.120.20 -> 66.171.121.34: icmp: echo request
10.821152 port3 in 66.171.121.34 -> 172.20.120.20: icmp: echo reply
10.821288 port4 out 66.171.121.34 -> 192.168.20.100: icmp: echo reply
11.729230 port4 in 192.168.20.100 -> 66.171.121.34: icmp: echo request
11.729431 port3 out 172.20.120.20 -> 66.171.121.34: icmp: echo request
11.821349 port3 in 66.171.121.34 -> 172.20.120.20: icmp: echo reply
11.821481 port4 out 66.171.121.34 -> 192.168.20.100: icmp: echo reply
The command output shows sessions only uses the port4 and port3 interfaces, both of which are in
VDOM-B.
If you log in as an administrator with the super_admin profile, you can sniff any interface. If you log
in as a-admin or b-admin (an administrator for a single VDOM), you can only sniff interfaces in the
administrator’s VDOM. To access the packet sniffer, you must log in to a VDOM, you cannot access
the packet sniffer from the global configuration.
a
ad dmin
min _p
istr rofi
ato le
rs
Int m
er n ad aint_
al N min m
etw istr onit
ork ato or
r
F
DH ortiG
CP ate
Se Un
rve it
r
Solution
Create a new admin profile that only allows the administrator to view and maintain configuration
options, and viewing and configuring log information and reports. Create an administrative user, Terry
White, with the monitoring profile.
1 Go to System > Admin > Admin Profile and select Create New.
2 Enter the Profile Name of maint_monitor and set the following settings to Read-Write:
• FortiGuard Update
• Maintenance
• Log & Report
3 Select OK.
Type Regular
Password password
5 Select OK.
The admin profile dictates what of the FortiGate configuration the administrator can see and
configure from web-based manager and CLI. You can add multiple profiles and assign users and
administrators different profiles depending on what they are tasked to do with the FortiGate unit.
Results
Log in to the FortiGate using the user name of Terry_White and the password of password. When
logged in, the web-based manager menus and sub-menus related to the access control you
configured appear. The OK or Apply buttons will appear in settings that may be editable on a
Read-Write page.
To confirm that Terry White has logged in successfully, from the FortiGate web-based manager go to
Log & Report > Event Log > System to see the login message.
Select the log entry to view the detailed information, which indicates the admin user connected. The
Message row indicates that Terry White connected successfully from 172.20.120.83. The Profile
Name row also indicates the admin profile in use.
Go to System > Dashboard > Status, and look at the System Information widget. In the Current
Administrator row, it will indicate the number of administrators logged in
.
Solution
There are a number of measure that you can take to provide maximum security for your FortiGate
unit. Some may seem obvious, but are easily overlooked in the grand scheme of setting up a network
device such as a FortiGate unit.
• Use NTP to set the system time so that system time is always correct. Correct system time is
necessary for analyzing log messages.
• Record as many log messages as you can without affecting FortiGate performance. More log
messages means more visibility into what’s happening with the system.
• Synchronize log messages with an external log server (syslog or FortiAnalyzer) to have a backup
of log messages for analysis if the FortiGate unit is compromised.
• Incorporate log message reviews into regular administration procedures (especially admin
authentication logs).
• Disable weak encryption and unencrypted services. For example, all administrator access should
be over HTTPS and SSH not HTTP and Telnet. For IPsec VPN configurations use 3DES or higher
levels of AES encryption and higher levels of SHA authentication.
At least one account should always have the super_admin profile as this profile is required to add
and remove administrators. To improve security only a very few administrators (usually one) should
be able to add new administrators.
If you want some administrator accounts to have limited access to the FortiGate configuration you
can create custom admin profiles that only allow access to selected parts of the configuration. To
add custom admin profiles, go to System > Admin > Admin Profile and select Create New.
For example, if you want to add an admin profile that does not allow changing security policies, when
you configure the admin profile set Firewall Configuration to None or Ready Only.
Change the admin account name and limit access to this account
The default super_admin administrator account, admin, is a well known administrator name so if this
account is available it could be easier for attackers to access the FortiGate unit because they know
they can log in with this name, only having to determine the password. You can improve security by
changing this name to one more difficult for an attacker to guess.
To do this, create a new administrator account with the super_admin admin profile and log in as that
administrator. Then go to System > Admin > Administrators and Edit the admin administrator and
change the Administrator name.
Once the account has been renamed you could delete the super_admin account that you just added.
Consider also only using the super-admin account for adding or changing administrators. The less
this account is used to less likely that it could be compromised. You could also store the account
name and password for this account in a secure location in case for some reason the account name
or password is forgotten.
Use trusted hosts to limit where administrators can log into the FortiGate unit from
Setting trusted hosts for an administrator limits what computer/location an administrator can log into
the FortiGate unit from. When you identify a trusted host, the FortiGate unit will only accept the
administrator’s login from the configured IP address of the trusted host. Any attempt to log in with the
same credentials from any other IP address will be dropped.
To ensure the administrator has access from different locations, you can enter up to ten trusted host
IP addresses. For higher security, use an IP address with a net mask of 255.255.255.255, and enter
an IP address (non-zero) in each of the three default trusted host fields.
The trusted hosts apply to HTTP and HTTPS access to the web-based manager, ping, snmp access
and the CLI when accessed through Telnet or SSH. CLI access through the console port is not
affected.
Ensure all entries contain actual IP addresses, not the default 0.0.0.0, even if it is a non-address
such as 1.1.1.1.
If you make a change to the default port number for HTTP, HTTPS, Telnet, or SSH, ensure that each
port number is unique.
If you change the HTTP or HTTPS administrative access port number, the number must be included
in the URL that the administrator uses to connect to the web-based manager in the format of
http[s]://<ip_address>:<port>. For example, if you are connecting to the web-based manager using
HTTPS on port 2112, the url would be https://192.168.1.99:2112.
Creating a local DNS server listing for internal sites and servers
Problem
Keeping DNS traffic for company server lookups off of the Internet and on the internal network.
Internal server
name: info.company.com
IP: 192.168.1.2
Internal DNS
Queries
FortiGate
Int DNS Database
er n
al N
etw
ork
Fo
rtiG
ate
Un
it
Solution
On a FortiGate unit, enable DNS databases, create an internal DNS database with the
IPs/names/URLs of internal sites, and enable the DNS server on the FortiGate internal interface.
Configure the internal network to use the FortiGate internal interface as the authoritative DNS server.
This way, when internal users request a URL, the FortiGate unit will look to its internal DNS. To lookup
external names, the FortiGate unit forwards DNS requests to external DNS servers.
The DNS server setting on the devices on the internal network must use the FortiGate internal
interface as their DNS server.
1 Go to System > Admin > Settings, select DNS Database and select Apply.
2 Go to System > Network > DNS Server and select Create New to add a new DNS Database:
Type Master
View Shadow
3 Select OK.
4 To add DNS Entries, select Create New and enter the name and IP address of an internal site:
Hostname info
IP Address 192.168.1.2
5 Select OK.
6 Go to System > Network > DNS Server and select Create New under DNS Service on
Interface to configure the mode for queries to the DNS database received at the Internal
interface.
Interface Internal
Mode Recursive
7 Select OK.
Results
To verify that the DNS database is being used, go to System > Network > DNS and temporarily
remove the primary and secondary DNS server settings. That is, leave them empty, and browse to
the http://info.company.com web site. The web site will appear, while surfing to any other site will
not work. This shows that the FortiGate unit is using its internal DNS database to resolve the
configured web site.
Reserved
IP: 10.10.10.18
E D MAC: 00:13:72:38:6a:39
RV
SE
RE
Int
er n
al N
etw
ork
F
DH ortiG
CP ate
Se Un
rve it
r
Solution
If you have an existing DHCP server enabled on the FortiGate unit, enable IP reservation within the
DHCP service settings and then add the MAC addresses of PCs that you want to always get the
same IP address.
1 Go to System > Network > DHCP Server and Edit the DHCP server.
2 Select the blue arrow for MAC Address Access Control List and select Create New.
3 Add a MAC IP address pair:
Reserve IP 10.10.10.18
4 Select OK.
If the PC is already connected and has acquired an IP address from the DHCP server, you can set
get its MAC address and IP address by selecting Add from DHCP Client List. When the list
appears, select the PC from the list and select Add To Reserved.
Results
The PC will always acquire the reserved IP address from the FortiGate DHCP server.
Verify that the PC has acquired the correct IP address by viewing its IP configuration or status. For
example, from a command prompt, you may be able to enter the command ipconfig/all.
From the FortiGate web-based manager, go to System > Monitor > DHCP Monitor to view the list
of PCs that are using the DHCP server to acquire IP addresses. The PC with the reserved address will
appear with an R next to the address.
If you do not see the PC in the DHCP Monitor or if the “R” icon is not visible, you may need to either
restart the PC, or renew its IP configuration.
SNMP
Manager
IP: 192.168.1.10
SNMP
Int
er n
al N
etw
Traps
? FortiGate
SNMP Agent
SN
ork
Fo
rtiG
ate
Un
it
Solution
Enable SNMP to collect SNMP v1/2c traps for the status of the FortiGate unit.
1 Go to System > Config > SNMP and select Enable to enable the FortiGate SNMP agent.
2 Configure the agent:
Contact admin@company.com
3 Select Apply.
4 Select Create New for SNMP v1/c2c.
5 Enter the Community Name of Example Company.
6 Add the IP address of a Host that can receive SNMP traps by selecting Add under Hosts.
You can also set the IP address/Netmask to 0.0.0.0/0.0.0.0 and the Interface to ANY so that any
SNMP manager at any network connected to the FortiGate unit can use this SNMP community and
receive traps from the FortiGate unit.
8 Select OK.
Results
Configure the SNMP manager at 192.168.1.10 to receive traps from the FortiGate unit. The do
something to trigger a trap, for example, change the IP address of a FortiGate interface. Verify that
the SNMP manager receives the trap.
Solution
When troubleshooting networks, it helps to look inside the header of the packets. This helps to
determine if the packets, route, and destination are all what you expect. Packet sniffing can also be
called a network tap, packet capture, or logic analyzing.
The TCP flag and sequence information appeared because verbosity level 4 was selected. This
information can be useful to ensure that all the traffic for a session is reaching its destination, and
that the session was properly established.
Ensure that ping administrative access is enabled on the internal interface; otherwise, you will not
be able to see the output shown below.
From any computer run a continuous ping to IP address 172.20.120.136 and on the FortiGate CLI
enter the following command:
diag sniffer packet internal 'icmp' 4 5
interfaces=[any]
filters=[icmp]
16.776272 internal in 172.20.120.17 -> 172.20.120.136: icmp: echo request
16.776462 internal out 172.20.120.136 -> 172.20.120.17: icmp: echo reply
17.777280 internal in 172.20.120.17 -> 172.20.120.136: icmp: echo request
17.777360 internal out 172.20.120.136 -> 172.20.120.17: icmp: echo reply
18.778176 internal in 172.20.120.17 -> 172.20.120.136: icmp: echo request
This output captured the 16th, 17th, and 18th ping echo requests that were sent out from
172.20.120.17, and the 16th and 17th replies from the FortiGate unit. You can tell this from the
number at the start of each line — the 16, 17, or 18, which indicates the packet number and
sequence. You can use this number to see if you are dropping packets. The echo or echo reply
indicates which direction the packet is travelling without the IP address. There is no other information
displayed because icmp packets carry very little information.
If you have icmp packets from other sources showing up in your sniffing, you can add a basic filter
to select only packets to or from 172.20.120.17. To do this, the sniffer command would become:
diag sniffer packet any ‘icmp and host 172.20.120.17’ 4 5. Filtering is described
in more detail in “Advanced troubleshooting by sniffing packets (packet capture)” on page 126.
Best Practices
Here are some tips that will improve your troubleshooting when using the sniffer.
• Always log output to a file that you can save, search, sort, and process later. You can also send
the output log to Fortinet support to assist them in solving your issue.
• Visualize the path you expect the packets in question are using. It will help you write your sniffer
command more accurately and reduce your troubleshooting.
• If you are not getting the results you expect, broaden your search parameters. Its possible things
are behaving differently than you expect.
• You need to know the details about the packet type you are sniffing to maximize the benefits.
Otherwise there will be useful information you do not understand in the sniffing results.
• Keep your connection method in mind when sniffing packets. If you are web browsing to the
FortiGate unit, web protocol packets may be affected. If you are using Telnet to connect, those
packets will affect the sniffing results.
• If you are sniffing VLAN packets, any configured filter will stop VLAN tags from being displayed.
Solution
You can perform some basic packet sniffing and network troubleshooting without using packet
sniffing filters. However, with filters, you can fine tune your troubleshooting to the point of being able
to find a specific ping packet on a busy network.
When packet sniffing, the filter field is very flexible. By using the filter option, you can:
• match the source hostname or IP address
• match the type of packet (arp, ip, gre, esp, udp, tcp, icmp)
• match the port number
• logically AND or OR parts of the filter with each other
• specify a certain byte in a packet
The default format of the filter syntax is:
[[src|dst] host <host_name_or_IP1>] [[arp|ip|gre|esp|udp|tcp|icmp] [port_no]] [and | or] [..]
Let’s look at each of the different parts to the filter. Keep in mind that in addition to these formats, you
can also search for individual words using the filter. The following are examples.
In each case, when the sniffer finds packets from that computer, the packets will match the filter and
be displayed. You can enter two or more different computers using this format and join them with
logical ANDs or ORs. For example, you could specify one source and two destinations.
In the following example, a computer on the network is pinging the FortiGate unit. You will only be
looking for ping packets with a source of 172.20.120.136 which is the FortiGate unit.
diag sniffer packet any 'icmp and src host 172.20.120.136'
interfaces=[any]
filters=[icmp and src host 172.20.120.136]
0.319302 172.20.120.136 -> 172.20.120.17: icmp: echo reply
1.348780 172.20.120.136 -> 172.20.120.17: icmp: echo reply
2.355177 172.20.120.136 -> 172.20.120.17: icmp: echo reply
3.356008 172.20.120.136 -> 172.20.120.17: icmp: echo reply
When the sniffing has ended, if you see anything but zero packets dropped, you may have a
problem. Packets dropped indicates the FortiGate unit was not able to sniff and display all the
packets that were coming in. If you were looking for all the packets in a sequence, there may well
be packets missing. For this reason, you should consider possible reasons for those dropped
packets, attempt to fix the problem so all packets are captured, and run the sniffer again. Keep in
mind that the sniffer can take up to 25% of the CPU resources on smaller FortiGate units.
Sniffing a port and specifying multiple hosts using AND and OR operators
When a TCP session is created, the destination port is set to a known port number. For example, port
80 is commonly used for HTTP sessions. But the source port is randomly assigned. The unknown
source port can make troubleshooting difficult. However, the FortiGate packet sniffer can match the
known port if it is the source or destination port. You do not need to know which port.
For example, check HTTP packets going between IP 172.20.120.18 (the FortiGate) and on either
10.10.80.110 (wifi interface called Star) or 10.10.10.100 (internal LAN interface).
diag sniffer packet any "port 80 and host 172.20.120.18 and (host 10.10.80.110 or host
10.10.10.100)" 4
interfaces=[any]
filters=[port 80 and host 172.20.120.18 and (host 10.10.10.100 or host 10.10.80.110)]
5.036340 internal in 10.10.10.100.58753 -> 172.20.120.18.80: syn 4189154
5.036664 internal out 172.20.120.18.80 -> 10.10.10.100.58753: syn 1354149395 ack 4189155
6.464015 Star out 172.20.120.18.80 -> 10.10.80.110.56791: syn 2000204115 ack 571678006
6.471966 Star in 10.10.80.110.56791 -> 172.20.120.18.80: ack 2000204116
6.474720 Star in 10.10.80.110.56791 -> 172.20.120.18.80: psh 571678006 ack 2000204116
5.036837 internal in 10.10.10.100.58753 -> 172.20.120.18.80: ack 1354149396
5.037023 internal in 10.10.10.100.58753 -> 172.20.120.18.80: psh 4189155 ack 1354149396
6.463686 Star in 10.10.80.110.56791 -> 172.20.120.18.80: syn 571678005
Since either the source or destination will be using port 80, all HTML traffic between those two
computers will match the filter and be displayed. SSH and HTTPS traffic uses different ports, so that
traffic will not be displayed. The first number of each line of output will vary between sources and is a
good way to quickly determine which IP addresses are in that session.
If the protocol you want isn’t listed here you can specify it if you know the ethernet protocol number
for it. For example to specify ARP packets on the internal interface with this method: diag packet
sniffer internal “ether proto 0x0806”
This example will sniff some ARP packets from a gateway on the network at IP address 172.20.120.2.
In this example, the interface is not important, and five packets will be enough to see what is
happening.
# diag sniffer packet any 'arp' 1 5
interfaces=[any]
filters=[arp]
1.187291 arp who-has 192.168.100.1 tell 192.168.100.99
2.187125 arp who-has 192.168.100.1 tell 192.168.100.99
2.858334 arp who-has 172.20.120.228 tell 172.20.120.224
2.889542 arp who-has 172.20.120.224 tell 172.20.120.228
4.187019 arp who-has 192.168.100.1 tell 192.168.100.99
From this output, there are ARP requests from a computer with IP address 192.168.100.99 that is
looking for the MAC address of a computer with the IP address 192.168.100.1. In the ARP protocol,
the who-has request is broadcast and includes the link layer address of where to send the reply. The
expected response, when a computer has the 192.168.100.1 IP address, will be in the format arp
reply 192.168.100.1 is at 00:26:b9:00:0f:9c. Since there is no such reply in the sniffed
packets, you can either sniff more packets or assume there is no computer on the network with the IP
address 192.168.100.1. This may be important if a computer is supposed to be using that IP address
and is not. It could imply DHCP problems, or that the computer was physically moved to a different
part of the network.
ARP packets can be the source of problems if there is a network loop. As mentioned above, ARP
tries to match a single MAC address to a single IP address. If the request results in two or more
replies with the same IP address, or different IP addresses have the same MAC address, as may
happen with virtual networking solutions, the loop or asymmetric routing is created. Essentially, all
traffic will go to and from both computers. This will appear as a network slowdown or halt. You can
see this happening if you are sniffing ARP packets and seeing the double replies or double MAC
addresses. To confirm that this is the issue, enter the CLI command config system settings,
set asymroute enable, end. This will turn on asymmetric routing, stop these ARP problems,
and disable stateful inspection. Disabling stateful inspection will compromise security, so in most
cases you should only use this command to confirm a problem. Once the problem is confirmed, use
the sniffer output to find and fix the source and then disable asymmetric routing.
If your FortiGate unit has NP2 interfaces that are offloading traffic, this will change the sniffer trace.
Before performing a trace on any NP2 interfaces, you should disable offloading on those interfaces.
Best practices
Here are some tips that will improve your troubleshooting using the packet sniffer.
• Enabling the sniffer will consume additional CPU resources. This can be as high as an additional
25 percent of CPU usage on low-end models. Therefore, enabling this on a unit that is
experiencing excessively high CPU usage, can only render the situation worse. If you must
perform a sniff, keep the sniffing sessions short and keep the filter specific.
• Try to always include ICMP in the sniffer filter. You may capture an ICMP error message that can
help identify the cause of the problem. For example:
diag sniff packet interface wan1 'tcp port 3389 or icmp' 3
• Use the “any” interface to sniff all FortiGate unit interfaces. You can use the "any" interface if you
want to confirm that a specific packet is sent and received by different FortiGate interfaces. The
any interface is also useful if you are not sure which interface will send or receive the packet. An
example using the “any” interface:
diag sniff packet any 'tcp port 3389' 3
• The FortiGate unit may not display all packets if too much information is requested. When this
occurs, the FortiGate unit will log the following message once the trace is terminated:
12151 packets received by filter
3264 packets dropped by kernel
When this occurs, it is possible that what you were attempting to capture, was not actually
captured. In order to avoid this, try to make the filters more specific, reduce the verbosity level, or
run the sniffer during a lower traffic period.
• The packet timestamps, as displayed by the sniffer, may become skewed or delayed under high
load conditions. This may occur even if no packets were dropped. Therefore, it is not
recommended that you rely on these values in order to troubleshoot or measure performance
issues that require absolute precise timing.
• Short Ethernet frames sent by the FortiGate unit may appear to be under the minimum length of
64 bytes (also known as runts) and will not be displayed by the sniffer. This is because the sniffer
does not display any Ethernet Trailer/Padding information, although it is sent over the network.
• The Ethernet source and/or destination MAC addresses may be incorrect when using the "any"
interface. They may be displayed as all zeros (00:00:00:00:00:00) or 00:00:00:00:00:01.
• Try to always include ICMP in the sniffer filter. You may capture an ICMP error message that can
help identify the cause of the problem. For example, diag sniff packet interface wan1
'tcp port 3389 or icmp' 3
• If you are sniffing VLAN packets, you cannot have any filter configured if you want to see the
VLAN tags. For example diag sniffer packet wan1 “icmp” will not show the tags where
diag sniffer packet wan1 will.
3 2
1
Solution
FortiGate units have built-in diagnose debug commands that can be used to debug the operation
of any FortiGate software system by displaying debug messages on the CLI console as the system
operates. When you find the problem you can correct the configuration and run the diagnose
debug command again to verify that the system now operates correctly.
Before performing any debugging, you should connect to the FortiGate CLI with a terminal program
that supports storing the output to a file for later reference. If you do not save the output to a file,
you will miss valuable debugging information.
Keep in mind that debugging consumes system resources and may affect performance. In most
cases this will not be a problem, but if your FortiGate unit is running at 100 percent resource usage
already, it is likely that running the debug application will cause the FortiGate unit to drop more
packets or sessions, and generally increase its overloaded behavior. The worst is when you are
sniffing packets, which can use 10 percent or more of the system resources.
To use the diagnose debug commands you must check the current debug configuration, enable
debugging, select a software system for which to display debugging information, collect and analyze
the results, and stop displaying debugging information. In general you can follow this command
sequence:
diagnose debug info
diagnose debug <software-system> <debug-level>
diagnose debug enable
diagnose debug disable
The following debug commands are also useful:
• diagnose debug reset to reset the debug configuration to a default state.
• diagnose debug report Fortinet support may ask you to run this command and send them
the output.
This is an exhaustive report that runs many different diagnose commands to gather a large amount
of information. It may take up to 20 minutes to run on a FortiGate unit with a complex configuration
and may temporarily affect system performance.
You can view all the debug options by entering diagnose debug ? or diagnose debug
application ?
5 Log into the SSL VPN portal. The CLI displays debug messages similar to the following.
diagnose debug enable
Debugging authentication
Any time a FortiGate unit authenticates a user, the authd daemon is responsible. This is true if the
user is logging in through SSL VPN, connecting over IPsec VPN from FortiClient, and even if
certificates are involved. You can use the following command to debug authentication:
diagnose debug application authd -1
diagnose debug enable
3
2 1
To find out more information about diagnose command options, enter the command followed by a ?,
for example, diagnose debug application ?
Wireless Networking
FortiOS WiFi networking provides a wide range of capabilities for integrating wireless networks into
your organization’s network architecture. Each WiFi network or SSID is represented by a virtual
network interface to which you apply security policies, UTM features, traffic shaping, and so on, in
the same way as for physical wired networks.
You can create multiple WiFi networks to serve different groups of users. For example, you might
have one network for your employees and another for guests or customers. Also, with the increase in
use of smartphones, tablets and other mobile devices that use WiFi technology, wireless networks
are becoming busier than ever and have to accommodate a broad range of wireless client devices
each with their own strengths and limitations. You may also want to accommodate these devices and
technologies on multiple overlapping wireless networks. These networks could differ greatly in the
access they provide to other networks, as well as the authentication, access control, and UTM
features they apply.
A network that requires only one WiFi access point is easily created with a FortiWiFi unit operating as
a single thick AP. A thick AP such as a FortiWiFi unit contains the WiFi radio facility as well as access
control and authentication functionality.
A thin AP, such as a FortiAP unit contains only the radio facility and a microcontroller that receives
commands and exchanges data with a WiFi controller. If you already have a FortiGate unit, adding a
FortiAP unit as a thin AP managed by the FortiGate unit operating as a WiFi controller is a cost-
effective solution for adding WiFi to your network.
The FortiOS WiFi controller feature is available on both FortiGate and FortiWiFi units. A FortiWiFi
unit’s WiFi controller also controls the unit’s internal (Local WiFi) radio facility, treating it much like a
built-in thin AP. Whenever multiple APs are required, a single FortiGate or FortiWiFi unit controlling
multiple FortiAP units is best. A network of multiple thick APs would be more expensive and more
complex to manage.
This chapter includes the following WiFi networking examples:
• Setting up secure WiFi access on your FortiWiFi unit
• Setting up secure WiFi on your FortiGate unit using FortiAP
• Improving WiFi security with WPA-Enterprise security
• Setting up secure WiFi with RADIUS
• Setting up secure WiFi with a captive portal
• Sharing the same subnet for WiFi and wired clients
• Setting up a WiFi network with an external DHCP server
• Authenticating WiFi users with Windows AD
Wireless
network
Inte
rna
l ne
two
rk
FortiWiFi Unit
Solution
Configure a WiFi network on your FortiWiFi unit. Use DHCP to assign up to 10 IP addresses to office
WiFi users, as most mobile devices are preconfigured to use DHCP. Use WPA2 security. As there is
no authentication in place for the wired network and this is a small team in one place, WPA2-Personal
security is appropriate.
There will be one preshared key that users must know to access the WiFi network. Create security
policies to enable the WiFi network to access both the office network and the Internet.
This solution assumes an area that can be covered by a single FortiWiFi. You can extend the
coverage area by connecting FortiAP units and adding the our_wifi SSID to them.
IP/Netmask 10.10.10.1/255.255.255.0
Netmask 255.255.255.0
SSID our_wifi
4 Select OK.
5 Go to WiFi Controller > Managed Access_Points > Local WiFi Radio and select
Enable WiFi Radio.
6 Select Apply.
Schedule always
Service ALL
Action ACCEPT
Source NAT is not required since the WiFi and internal networks are visible to each other.
4 Select OK and select Create New.
5 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
6 Add a WiFi-to-Internet security policy that allows WiFi users to access the Internet.
Schedule always
Service ALL
Action ACCEPT
Results
On your laptop or mobile device, look for the our_wifi SSID and attempt to connect. Enter the
“justforus” preshared key when prompted. Verify that you can connect to servers on your office
network. Verify that you can connect to the Internet. You can go to WiFi Controller > Monitor >
Client Monitor to view information about the clients that are connected to your WiFi network.
If you want a more secure authentication method, see “Improving WiFi security with WPA-
Enterprise security” on page 147 that requires users to logon instead of using the preshared key.
Wireless
network
l nit
rna Pu
inte tiA
Inte po For
rna rt3
l ne
two
rk
FortiGate
FortiG
Gate Unit
Solution
Set up a WiFi network with WPA-Personal authentication. Using the WiFi Controller feature on your
FortiGate unit, configure a WiFi network. Then connect a FortiAP unit and authorize it to carry your
WiFi network.
On your WiFi network, use DHCP to assign IP addresses to WiFi users, as most mobile devices are
preconfigured to use DHCP. Use WPA2 security. As there is no authentication in place for the wired
network and this is a small team in one place, WPA2-Personal security is appropriate. There will be
one preshared key that users must know to access the WiFi network. Create security policies to
enable the WiFi network to access both the office network and the Internet.
Configure port3, an unused network interface on the FortiGate unit, to connect to the FortiAP unit.
Connect the FortiAP unit to the port3 interface and wait for it to be discovered. Authorize the FortiAP
unit.
IP/Netmask 10.10.10.1/255.255.255.0
Netmask 255.255.255.0
SSID our_wifi
5 Select OK.
3 Add a WiFi-to-Office network policy that allows WiFi users to access to the office network.
Schedule always
Service ALL
Action ACCEPT
Source NAT is not required since the WiFi and internal networks are visible to each other.
4 Select OK and select Create New.
5 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
6 Add a WiFi-to-Internet policy that allows WiFi users to access the Interne.
Schedule always
Service ALL
Action ACCEPT
Configure a FortiGate interface to connect to the FortiAP unit and connect the devices
1 Go to System > Network > Interface and Edit the port3 interface:
IP/Netmask 192.168.8.1/255.255.255.0
2 Use an Ethernet cable to connect port0 (also the ETH port) on the FortiAP unit to port3 on the
FortiGate unit and power up the FortiAP unit.
3 On the FortiGate web-based manager, go to WiFi & Switch Controller > Managed Devices >
Managed FortiAP. Select Refresh every ten seconds or so until the FortiAP unit is listed.
If the FortiAP is not listed under Managed FortiAP after two minutes:
• Check that port0 (ETH) on the FortiAP unit is connected to port3 on the FortiGate unit.
• Power cycle the FortiAP unit.
• On the FortiGate unit, go to System > Monitor > DHCP Monitor to see whether the FortiAP
unit is assigned an IP address lease.
• See also “Using the FortiGate packet sniffer to view the FortiAP discovery process” in the
Results section.
This solution assumes an area that can be covered by a single FortiAP. You can extend the
coverage area by connecting and authorizing additional FortiAP units and adding the our_wifi SSID
to them.
Results
On your laptop or mobile device, look for the our_wifi SSID and attempt to connect. Enter the
“justforus” preshared key when prompted. Verify that you can connect to servers on your office
network. Verify that you can connect to the Internet.
You can go to WiFi Controller > Monitor > Client Monitor to view information about the clients that
are connected to your WiFi network.
Using the FortiGate packet sniffer to view the FortiAP discovery process
The FortiGate unit’s built-in packet sniffer can help you to view the discovery process if you
experience difficulty in getting the FortiGate unit to recognize the FortiAP unit. Use the CLI command
diagnose sniffer packet port3 none 4 to capture packets entering or leaving the FortiGate
port3 interface to which the FortiAP unit is connected. Packet headers will be shown. For more
information about using the sniffer, see “Troubleshooting by sniffing packets (packet capture)” on
page 121.
The FortiAP unit uses several methods to find a WiFi controller. Here are some examples of the
request packets you should see, possibly repeated several times before a response is received and
processed:
Wireless
network
In
te
rn
al
N
et
w
or
k
FortiWiFi Unit
Solution
Create user accounts and a wifi_users user group on the FortiWiFi unit. Modify your SSID to use
WPA/WPA2-Enterprise security and authenticate users who belong to the wifi_users group. There is
no longer a pre-shared key that could fall into the wrong hands or would need to be changed if
someone left the group. Each user has an individual user name and password. Accounts can be
added or removed as needed.
Password my_secure_pwd
3 Select OK.
If your employees already have user accounts on the FortiWiFi or FortiGate unit, you can skip this
step and use the existing accounts.
5 Go to User & Device > User > User Group and select Create New.
6 Create a user group:
Name wifi_users
Type Firewall
7 Select OK.
IP/Netmask 10.10.10.1/255.255.255.0
Netmask 255.255.255.0
SSID our_wifi
Authentication Usergroup
Usergroup wifi_users
5 Select OK.
6 Go to WiFi Controller > Managed Access Points > Local WiFi Radio and select
Enable WiFi Radio.
7 Select Apply.
Schedule always
Service ALL
Action ACCEPT
Source NAT is not required for this policy since the WiFi and internal networks are visible to each
other.
4 Select Create New.
5 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
6 Add a WiFi-to-Internet security policy that allows WiFi users to access the Internet.
Schedule always
Service ALL
Action ACCEPT
Results
On your laptop or mobile device, look for the our_wifi SSID and connect to it. Unlike WPA/WPA2-
Personal you will be prompted to enter your user name and password. Enter wloman as the user
name and my_secure_pwd as the password. Once you have been authenticated, verify that you can
connect to servers and other resources on your office network. Also verify that you can connect to
the Internet.
You can go to WiFi Controller > Monitor > Client Monitor to view information about the clients that
are connected to your WiFi network.
Wireless
network
r
ato
l e ntic
rna h
ut unit
inte rtiA
Inte po Fo
rna rt3
l ne
two
rk
FortiWiFi Unit
Solution
Set up a FortiAuthenticator unit as a RADIUS server and use WPA-Enterprise authentication for your
WiFi network.
On the FortiAuthenticator unit, you need to create a user group with a user account for each
employee. Register the FortiWiFi unit as a Network Access Server (NAS) so that it can request user
authentication.
Username wloman
Password my_secure_pwd
Register the FortiWiFi unit for remote authentication on the FortiAuthenticator unit
1 Go to Authentication > General > Auth Clients and select Create New.
2 Enter the following information about the FortiWiFi unit:
Name FortiAP1
hardtoguess
Secret
(You will also enter this Secret on the FortiWiFi unit.)
Name facRADIUS
hardtoguess
Primary Server Secret (This is the same Secret that you entered on the
FortiAuthenticator unit.)
Name wifi-user-grp
Type Firewall
6 Select OK.
Create the SSID and enable the WiFi radio on the FortiWiFi unit
1 Go to WiFi Controller > WiFi Network > SSID and select Create New.
2 Define your wireless network:
IP/Netmask 10.10.10.1/255.255.255.0
Netmask 255.255.255.0
SSID our_wifi
5 Select OK.
6 Go to WiFi Controller > Managed Access Points > Local WiFi Radio and select
Enable WiFi Radio.
7 Select Apply.
Schedule always
Service ALL
Action ACCEPT
Source NAT is not required for this policy since the WiFi and internal networks are
visible to each other.
4 Select OK and select Create New.
5 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
6 Add a WiFi-to-Internet policy that allows WiFi users to access the Internet.
Schedule always
Service ALL
Action ACCEPT
Results
On your laptop or mobile device, look for the our_wifi SSID and connect to it. You will be asked for
your user name and password. After entering valid credentials, you have access to the office network
and the Internet.
Wireless
network
l nit
rna iAPu
Inte inte po Fort
rna rt3
l ne
two
rk
FortiGate
FortiG
Gate Unit
Solution
Set up a captive portal configuration that intercepts connections to the wireless network and displays
a portal on wireless clients’ devices. User’s must authenticate with the portal to get access to the
wireless network.
To configure the portal you must create a user group with a user account for each employee. Create
a WiFi network with captive portal authentication. A captive portal appears to be an open WiFi
access point, allowing any WiFi device to connect. On the first attempt to connect to a web site, the
captive portal presents a web page that requests the user’s logon credentials which must match
credentials in the user group.
Password my_secure_pwd
If your employees already have user accounts on the FortiWiFi or FortiGate unit, you can skip this
step and use the existing accounts.
4 Go to User & Device > User > User Group and select Create New:
Name wifi_users
Type Firewall
5 Select OK.
IP/Netmask 10.10.10.1/255.255.255.0
Netmask 255.255.255.0
SSID our_wifi
5 Select OK.
6 Go to WiFi Controller > Managed Access Points > Local WiFi Radio and select
Enable WiFi Radio.
7 Select Apply.
Schedule always
Service ALL
Action ACCEPT
Source NAT is not required for this policy since the WiFi and internal networks are visible to each
other.
4 Select OK and select Create New.
5 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
6 Add a WiFi-to-Internet policy that allows WiFi users to access the Internet.
Schedule always
Service ALL
Action ACCEPT
Results
On your laptop or mobile device, look for the our_wifi SSID and connect to it. Your device will
connect quickly because no password is required at this stage.
Some mobile devices display the
Fortinet Terms and Disclaimer
Agreement portal as soon as you
connect to the SSID. Some devices
only display the portal when you
open a web browser and attempt to
connect to an Internet destination.
Select the I accept... check box
below the Agreement text to indicate
that you agree. Enter wloman as
Username and my_secure_pwd as
Password, then select Continue.
Your requested web site should then
be displayed and you can otherwise
use the WiFi network. You can
continue browsing until your
authentication times out. Then, you
will have to accept the disclaimer and
re-enter your logon credentials again.
You can go to WiFi Controller > Monitor > Client Monitor to view information about the clients that
are connected to your WiFi network.
In User & Device > Monitor > Firewall, you can see the authenticated captive portal user:
Software switch
network
10.10.10.0
255.255.255.0
Wireless
network
Software
switch interface
combo_lan
10.10.10.1
t1
or
p
Internal network
FortiWiFi Unit
Solution
Create a software switch interface with the internal LAN interface and WiFi network virtual interfaces
as members.
A software switch interface can only include physical and WiFi interfaces. Before adding an
interface to a software switch interface you must delete all configuration objects that use that
interface. This includes factory default security policies and DHCP server configurations.
There is no need to specify an IP address for the SSID because the IP address of the software
switch interface will be used. Also, you should disable the DHCP server for the SSID since you will
add one later for the software switch interface.
SSID our_wifi
5 Select OK.
6 Go to WiFi Controller > Managed Access_Points > Local WiFi Radio and select
Enable WiFi Radio.
7 Select Apply.
You can extend the coverage area by connecting FortiAP units and adding the our_wifi SSID to
them.
Name combo_lan
wifi
Physical Interface Members
port1
IP/Netmask 10.10.10.1/255.255.255.0
3 Go to System > Network > DHCP Server and select Create New.
4 Add a DHCP server for the devices on the wired and wireless networks connected to the software
switch:
Mode Server
Enable Selected
Type Regular
IP 10.10.10.2-10.10.10.199
5 Select OK.
Schedule always
Service ALL
Action ACCEPT
Results
Configure the devices on the internal network to get their IP addresses using DHCP and renew their
leases if required. They should all have IP addresses on the 10.10.10.0/255.255.255.0 network.
On your laptop or mobile device, look for the our_wifi SSID and connect to it. Enter the “justforus”
preshared key when prompted. Wireless devices will acquire IP addresses in the
10.10.10.0/255.255.255.0 network.
Verify that you can connect to servers on your office network from mobile devices and verify that you
can connect to the Internet.
You can go to WiFi Controller > Monitor > Client Monitor to view information about the clients that
are connected to your WiFi network.
You can also go to System > Monitor > DHCP Monitor to view information about all the address
leases for both wired and wireless clients.
C .
P 1.
se 10
rv 1
er
Wireless
network
In
te
rna
ln
et
w
or
k
FortiWiFi Unit
Solution
When you configure the WiFi network, do not configure a DHCP server. On the WiFi interface, specify
a DHCP relay to the company’s DCHP server. Check your security policies to ensure that DHCP
packets can pass through the FortiGate unit from the WiFi network to the LAN where the DHCP
server resides.
This example shows a FortiWiFi-based network with WPA/WPA2-Personal security. You can also
apply this DHCP configuration to WiFi networks with other security settings and to WiFi networks
based on FortiAP units.
IP/Netmask 10.10.10.1/255.255.255.0
SSID our_wifi
5 Select OK.
6 Go to WiFi Controller > Managed Access_Points > Local WiFi Radio and select
Enable WiFi Radio.
7 Select Apply.
Mode Relay
Type Regular
Schedule always
Service ALL
Action ACCEPT
Source NAT is not required since the WiFi and internal networks are visible to each other.
The default ALL service accepts DHCP sessions. If you make a more restrictive policy, make sure
that DHCP sessions are allowed.
If the DHCP server that you will use is not on the office network, you will also need a policy to allow
DHCP traffic to pass from the DHCP server’s network to the WiFi network.
Schedule always
Service ALL
Action ACCEPT
Results
On your mobile device, look for the our_wifi SSID and connect to it. Enter the “justforus” preshared
key when prompted. Once you are connected, verify that you can connect to servers on your office
network, and to the Internet.
If the Auth column shows Pass, but the IP column shows 0.0.0.0, the DHCP Relay configuration is
not connecting. Verify the following:
• Is the mobile device configured to obtain an IP address automatically using DHCP?
• Does the wifi-to-wan1 policy allow DHCP service to pass? (ALL service includes DHCP.)
• Does the DHCP server have a route to the WiFi network? To check this, add a temporary wan1-
to-wifi policy and ping the WiFi network gateway from the DHCP server.
• Is the DHCP server configured to provide IP addresses for your WiFi network’s subnet?
A complete configuration includes the default route and DNS server addresses.
The normal DHCP sequence as seen in the server’s log messages looks like this:
dhcpd: DHCPDISCOVER from 00:23:4e:52:fd:6f via 10.10.10.1
dhcpd: DHCPOFFER on 10.10.10.10 to 00:23:4e:52:fd:6f (user1-AOA150) via 10.10.10.1
dhcpd: DHCPREQUEST for 10.10.10.10 (192.168.1.101) from 00:23:4e:52:fd:6f (user1-AOA150) via
10.10.10.1
dhcpd: DHCPACK on 10.10.10.10 to 00:23:4e:52:fd:6f (user1-AOA150) via 10.10.10.1
Repeated DHCPDISCOVER and DHCPOFFER messages with no DHCPACK response suggest that
these messages are not reaching the client.
It is also normal to see a DCHCPREQUEST message for an IP address that was not offered in a
prior DHCPOFFER message. Many clients automatically request the IP address that they used
previously. If this IP address is acceptable to the server, it will issue a DHCPACK message
immediately.
do WIn
172 main dows Wireless
.20 con AD
.12 tro network
0.3 ller
2
1
t
or
wifi
p
Inte
rna
l ne
two
rk
1
an
w
FortiWiFi Unit
Solution
Configure a RADIUS server (Network Policy Server) in Windows Active Directory (AD). Configure the
your WiFi network with WPA-Enterprise to authenticate users with this Windows RADIUS (NPS)
server.
11 Select Add, Select Microsoft: Protected EAP (PEAP), and then select OK.
12 Select the PEAP option in EAP Types and then select Edit.
SHVs used in this health policy Select Windows Security Health Validator
SHVs used in this health policy Select Windows Security Health Validator
11 Select Configure Attribute, enter the following information, and then select OK:
13 Select Finish.
Name Win_NPS
Type Query
3 Select OK.
IP/Netmask 10.10.10.1/255.255.255.0
Netmask 255.255.255.0
SSID our_wifi
6 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
7 Add a WiFi-to-Office security policy to enable WiFi users to connect to the office network and to
the Internet.
Schedule always
Service ALL
Action ACCEPT
Schedule always
Service ALL
Action ACCEPT
12 Select OK.
13 Go to WiFi Controller > Managed Access_Points > Local WiFi Radio and select
Enable WiFi Radio.
14 Select Apply.
Results
Verify that WiFi users can authenticate and have access to both the office LAN and the Internet.
Security policies
It is simple to set up a FortiGate unit to allow users on a network to access the Internet while blocking
traffic from the Internet from accessing the protected network. All that is required is a single security
policy that allows traffic from the Internal network to connect to the Internet. As long as you do not
add a security policy to allow traffic from the Internet onto your internal network, your network is
protected.
When a user connects to the Internet, they expect a reply. For example, when you connect to a web
site you expect to see a web page. The same security policy that allows you to connect to the
Internet also allows servers you contact to respond to you. In effect, a single policy allows two-way
traffic, but the incoming traffic is only allowed in response to requests sent by you.
Even though there is no risk of unwanted traffic originating from the Internet getting onto your internal
network, users are connecting to the Internet and downloading data. These downloads can
sometimes include unwanted items, such as viruses. that make their way through to FortiGate unit to
your network. To protect your network from this problem, security policies are also the way to turn on
all FortiGate UTM features. For example, users may download a virus when browsing the web or
retrieving email. You can protect your network from this threat by adding virus scanning to security
polices that allow users to connect to the Internet. All traffic in either direction that is controlled by a
security policy that includes virus scanning will be scanned for viruses. The benefit of this approach
is that you can apply security features directly to allowed traffic. This also means that you can apply
custom security features to each security policy and to each type of traffic allowed through the
FortiGate unit. Security features are applied using UTM objects and profiles. You can create as many
profiles as you need and mix and match them in a security policy as required.
19
2.
In 8.1
16
te .0
r n /2
al 5
N 5.2
et 5
w 5.
o 2
rk 5
Sta
tic
5 .0
inte betw sou
and rn ee rce
the al ne n the NAT
Int two
ern rk
et
1. al
8. rn
99
16 te
2. in
19
sr c p P: t: 8
3
c o 17 0
sr t I or
.1 1
IP rt 2
20 n
d tp
.1 wa
: 1 : [a .2
4
2
s
d
92 ny 0.1
s
.1 ] 20
68
20
.1
2.
.[1
17
-2
55
.1
]
01
3
sr c p P: t: 8
c o 17 0
sr I r
1
IP rt 2
2
d tp
: 1 : [a .2
st o
d
72 ny 0.1
s
.2 ] 20
0.
12
0.
14
.1
01
For example, it might be acceptable to you to apply only web filtering to the security policy that
allows users on the protected internal network to access web sites on the Internet. If you have a
separate security policy that allows users on the internal network to download and send email, you
could apply virus scanning to this traffic to make sure users cannot download email attachments
containing viruses. In addition you could apply data leak protection to the email traffic to prevent
users from sending confidential email to the Internet.
All of these security features can be added to security policies as you create them. Or once you have
security policies that control traffic patterns you can edit them to add or change security features as
you build up your security requirements or as those requirements change.
FortiGate units include a wide range of pre-defined network services that can be added to security
policies. For example, you can add a security policy that intercepts all HTTP traffic just by adding the
HTTP service to a security policy. Pre-defined services include basic network services such as HTTP,
FTP, TCP, SMTP and more specialized services such as H323 (used for VoIP and media), MMS (the
multimedia messaging service used by mobile phones) and so on. You can also easily create custom
services if your network uses network services that are not in the FortiGate pre-defined services list.
You must add at least one service to a security policy. You can also add multiple services to a single
security policy if you want to policy to multiple traffic types. The ALL pre-defined service accepts
traffic using any network service.
Firewall schedules control when security policies are active. The default always schedule does not
restrict when a policy is active. You can limit when a policy is active by adding schedules defining the
time for which the policy is active. You can create recurring schedules that take effect repeatedly at
specified times of specified days of the week; for example, a schedule that is active during office
hours: weekdays between 9am and 5 pm. You can also create one-time schedules that take effect
only once for the period of time (for example, for a week in September 2015).
Firewall objects also include traffic shapers, used to normalize traffic peaks and bursts to prioritize
certain flows over others. A wide variety of traffic shaping options are available, allowing you to
customize traffic shaping according to your networks requirements and apply custom traffic shaping
to any security policy.
The Virtual IP firewall objects are added to security policies to perform various forms of destination
network address translation (DNAT) including destination IP address and destination port translation
and port forwarding.
The final firewall object is load balancing, which is an extension of virtual IPs to load balance traffic
passing through the FortiGate unit to multiple servers. FortiGate load balancing supports various load
balancing schedules, real server health monitoring, persistence, and SSL acceleration.
This chapter includes the following security policy and firewall object examples:
• Limiting employees’ Internet access
• Restricting Internet access per IP address
• Excluding selected users from UTM filtering
• Verifying that traffic is accepted by a security policy
• Arranging security policies in the correct order
• Allowing DNS queries to only one approved DNS server
• Extending AirPlay and AirPrint communication through a FortiWiFi unit
• Ensuring sufficient and consistent bandwidth for VoIP traffic
• Using geographic addresses
• Providing Internet access for your private network users (static source NAT)
• Providing Internet access for a private network with multiple Internet addresses (dynamic source
NAT)
• Dynamic source NAT without changing the source port (one-to-one source NAT)
• Dynamic source NAT using the central NAT table
• Allowing access to a web server on an internal network when you only have one Internet IP
address
• Allowing Internet access to a web server on a protected network when you only have one Internet
IP address, using port translation
• Allowing Internet access to a web server on a protected network when you have an IP address for
the web server
• Configuring port forwarding to open ports on a FortiGate unit
• Dynamic destination NAT for a range of IP addresses
al
rn
te
in
In
te
rn
al
n
et
w
o
rk
1
an
w
YouTube
Facebook
Solution
Create a firewall schedule that allows access to YouTube and Facebook between 12pm and 2pm.
Create a new security policy that includes the schedule. This policy will be independent of the current
Internet browsing policy.
This procedure presumes the following configurations are already complete:
• Users that connect to the FortiGate unit for access to the Internet.
• Security policies to allow traffic to and from the Internet. For simplicity, this example uses a wide
open policy for all other Internet browsing.
These following steps are required to complete this procedure:
• Create firewall address entries for YouTube and Facebook.
• Create a recurring schedule that allows access to these sites.
• Create a security policy that references these sites and the schedule.
• Ensure the security is at the top of the policy list.
Name YouTube
Type FQDN
FQDN www.youtube.com
Interface wan1
2 Select OK.
3 Select Create New and complete the following:
Name Facebook
Type FQDN
FQDN www.facebook.com
Interface wan1
4 Select OK.
Hour 12
Start Time
Minute 00
Hour 14
Stop Time
Minute 00
3 Select OK.
YouTube
Destination Address
Facebook
Service ALL
Action ACCEPT
YouTube
Destination Address
Facebook
Schedule Always
Service ALL
Action DENY
7 Select OK.
The schedule in the security policy enables network traffic to occur for a specific length of time. The
policy is active for a given time frame, and as long as the session is open, traffic can continue to
flow. That means, that if a user opens a session for YouTube two minutes before the schedule ends,
the user can use YouTube until they stop the session. To ensure all sessions terminate at the end of
the desired time, use these CLI commands:
config firewall policy
edit 2 (whichever is the schedule policy)
set schedule-timeout enable
end
Results
With these policies in place, A user trying to access YouTube or Facebook, will not be able to
connect. Once the allotted time occurs, access is allowed. The best way to test this is to try to
connect to YouTube. It won’t connect. Change either the system time on the FortiGate unit or the
schedule time to be within the current time, to see that access to the site is allowed.
.3 ng
50
20 ti
0. ke
0-
.1 ar
10 M
En .20
10
.1
gi .1
ne 00
0
er -1
in 5
g 0
R
es
tri
ct
in
g
tra
ffi
c
Solution
Identify groups of users according to their IP addresses and add firewall addresses for these groups.
Two user groups are identified:
• Engineering users with IP addresses in the range 10.10.20.100 - 10.10.20.150
• Marketing users with IP addresses in the range 10.10.20.30 - 10.10.20.50
The solution shows how to allow marketing access to the Internet during office hours (between 8:00
am and 6:00 pm) but restricting engineering to only being able to access the Internet between 12:00
noon and 2:00 pm.
Name engineering
Type IP Range
Interface internal
Name marketing
Type IP Range
Interface internal
Name engineering-restrict
Name marketing-all
5 Select OK.
Schedule marketing-all
Service ALL
Action ACCEPT
Schedule engineering-restrict
Service ALL
Action ACCEPT
Results
The marketing department should be able to connect to the Internet immediately and the engineering
department should not be able to connect to the Internet until the specified time in the schedule. You
should also see packets in the Count column (Right-click on the column headings and select
Column Settings and add the Count column) in the marketing policy, but nothing in the engineering
policy.
To test that things are correct, try accessing web sites on the Internet using and IP address assigned
to the engineering department. All access should be denied. Try accessing web sites from an IP
address assigned by the marketing department. All access should be allowed.
To test that the engineering department policy is correct, change the time frame in the engineering-
restrict firewall schedule to the current time, and then try accessing web sites from the engineering
department. You should be seeing packets in the Count column in the engineering policy as well as
in the marketing policy.
Change the time range back to the original time in the engineering-restrict firewall schedule, and all
packets should stop and the Count for this policy should not increase.
be
to from
ers d g
Us clude lterin .20
ex TM fi .101 1.21
U 0.31 .10
1 0.31
1
l
rna
In 0.3
inte
te 1
1
r n .1
al 01
n .0
et /2
w 4
o
rk
n1
wa
Solution
Add a general security policy to the FortiGate unit that accepts all connections from the internal
network and applies UTM filtering. Add a specific security policy that does not apply UTM filtering
and only accepts connections from the users to be excluded. To only accept connections from
selected users, add firewall addresses for each user’s computer. Move the specific security policy
above the general policy in the security policy list.
Create the security policy that accepts all sessions from the internal network to the Internet
1 Go to Policy > Policy > Policy and select Create New.
2 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
3 Add the following security policy that allows users on the internal network to access the Internet.
Incoming Interface internal
Schedule always
Service ALL
Action ACCEPT
Create the specific security policy that accepts sessions only from selected users
1 Go to Firewall Objects > Address > Address and select Create NeW.
2 Add an address for the first user to be excluded:
Name excluded-user-20
Type Subnet
Interface internal
Name excluded-user-21
Type Subnet
Interface internal
5 Select OK.
6 Go to Firewall Objects > Address > Group and select Create New.
7 Add an address group that includes the addresses of the users to be excluded:
excluded-user-21
Members
excluded-user-22
8 Select OK.
You could also add an address range for these two users to the Subnet / IP Range field in the
format 10.31.101.20-10.31.101.21. In this case you would not need the address group. However, if
the addresses of the excluded users are not in a continuous range, you would need to add multiple
addresses and add these addresses to a group.
9 Go to Policy > Policy > Policy and right-click on the general security policy added in the previous
procedure.
10 Select Insert Policy > Above.
11 Add a specific security policy that accepts sessions from the selected users on the internal
network above the general security policy.
Schedule always
Service ALL
Action ACCEPT
14 Select OK.
Results
Because the specific security policy is in above the general security policy, traffic from the specified
users is intercepted by the specific security policy. Verify that the specific security policy is accepting
sessions from the users to be excluded from filtering by browsing to the Internet from an excluded
user’s PC. Go to Policy > Monitor > Policy Monitor to verify that the specific policy is accepting
sessions from the excluded user’s IP addresses.
Using diagnose debug flow to show traffic hitting the specific policy
You can use the diagnose debug flow command to show packet flow through the FortiGate unit.
As packets are received you can view debug messages to show how the FortiGate unit processes
them. The following command sequence displays packet flow for packets from IP address
10.31.101.22.
diagnose debug enable
.3 ng
50
20 ti
0. ke
0-
.1 ar
10 M
En .20
10
.1
gi .1
ne 00
0
er -1
in 5
g 0
R
es
tri
ct
in
g
tra
ffi
c
Solution
Use the security policy list Count column and the policy monitors. The Count column and the policy
monitors provide a visual verification that packets are hitting a policy.
This solution uses the security policies created in “Restricting Internet access per IP address” on
page 185.
1 Go to Policy > Policy > Policy and locate the engineering-restrict and marketing-all policies.
2 Right-click on the column headings and select Column Settings and add the Count column.
The Count column in the following example shows that there are currently no packets hitting the
engineering-restrict policy, but packets are hitting the marketing-all policy.
3 Go to Policy > Monitor > Policy Monitor to view the marketing-all policy sessions.
In the list, you should be seeing that the policy ID, in this case ID number 5, is the marketing-all
policy that is accepting these sessions. You can verify this by selecting Refresh to see the byte
and packet count increase.
4 You can drill down to see a graph of the individual sessions accepted by the policy by source or
destination address or destination port.
5 You can drill down one more level to see a detailed list of the sessions currently accepted by the
policy.
6 Go to the engineering-restrict schedule and change the original time to current time so that you
can verify that traffic is hitting that policy.
7 On both the policy list and Policy Monitor, you can verify that traffic is now hitting both policies.
Results
You can use these web-based manager tools to verify that traffic is hitting the expected security
policies. More advanced tools for verifying that traffic is hitting the expected policy are available from
the CLI.
19
2.
16
8.
1.
11
0
Ac nie
ce d
de
ss
In 19 .25
te 2. 5
rn 16 .2
al 8 55
25
ne .1. .0
tw 0
5
or
k
Ac ow
ce ed
al
ss
Solution
More specific security policies should be placed in the security policy list above more general
policies. In this case the specific policy that blocks one source address should be placed above the
general policy that allows access from any source address.
1 Go to Policy > Policy > Policy and select Create New.
2 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
3 Add a security policy to allow all users on the internal network to access the Internet.
Schedule always
Service ALL
Action ACCEPT
Some FortiGate models include this security policy in the default configuration. If you have one of
these models, this step has already been done for you.
6 Go to Firewall Objects > Address > Address and select Create New.
7 Add the specific address to be blocked:
Type Subnet
Interface internal
8 Select OK.
9 Go Policy > Policy > Policy and select Create New.
10 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
11 Add a security policy to deny access for sessions from the source address 192.161.1.110:
Schedule always
Service ALL
Action DENY
12 Select OK.
Results
New security policies are always added to the bottom of the policy list so this specific policy is added
below the general policy that allows access.
1 Test the configuration by attempting to connect to the Internet from a PC with IP address
192.168.1.110.
Access should be allowed. If you go to Policy > Policy > Policy, the Count column should show
that the general policy is accepting packets. Right-click on the column headings and select
Column Settings and add the Count column.
2 To move a security policy, click and hold the Sequence number item and drag the policy to the
correct position.
3 Test this new configuration by attempting to connect to the Internet from a PC with IP address
192.168.1.110.
Access should be denied. If you go to Policy > Policy > Policy the Count column should show
that the deny policy is blocking packets.
Packet flow
The following command sequence displays packet flow for packets from IP address 192.168.1.110
that are blocked by the deny policy.
diagnose debug enable
The following command sequence displays packet flow for packets from IP address 192.168.1.120
that are allowed by policy 1.
diagnose debug enable
.1 r NS
tw
91 ve D
or
8. er ed
k
3
20 S ov
.5
pr
12
Ap
Solution
Block all DNS sessions except for sessions to the approved DNS server.
In this example, the approved DNS server is 208.91.112.53. This DNS server is maintained by
Fortinet and is the Primary DNS server in the default configuration of every FortiGate unit.
To do this, create a firewall address for the approved DNS server and then add it to a security policy
that uses the DNS service and allows access to the Internet. Create another security policy that
blocks all DNS sessions.
Arrange the allow DNS policy above the more general deny DNS policy. Arrange both of these
policies above any general policies that allow access to the Internet.
Make sure the devices on the internal network are configured to use the approved DNS server.
1 Go to Policy > Policy > Policy and select Create New.
2 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
3 Add a security policy to allow all users on the internal network to access the Internet.
Schedule always
Service ALL
Action ACCEPT
Some FortiGate models include this security policy in the default configuration. If you have one of
these models, this step has already been done for you.
6 Go to Firewall Objects > Address > Address and select Create New.
7 Add a firewall address for the approved DNS server:
Type Subnet
Interface wan1
8 Select OK.
9 Go to Policy > Policy > Policy and select Create New.
10 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
11 Add a policy that allows DNS sessions to access the approved DNS server:
Schedule always
Service DNS
Action ACCEPT
14 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
Schedule always
Service DNS
Action DENY
If you completed the steps in order the internal to wan1 policy list should look similar to the
following:
16 To move a security policy, click and hold the Sequence number item and drag the policy to the
correct position.
Results
Use the following steps to test the configuration.
1 Configure a PC on the internal network to use the 208.91.112.53 DNS server.
2 Attempt to browse the web from this PC.
You should be able to browse the web.
3 Go to Policy > Policy > Policy view the Count column for the security policies. Right-click on the
column headings and select Column Settings and add the Count column.
The policy 2 Count column should show that it is processing traffic. Go to Policy > Monitor >
Policy Monitor to view all sessions accepted by policy 2 are DNS sessions with a destination
address of 208.91.112.53.
4 Enter the following command to verify DNS sessions from a PC with IP address 192.168.1.110 to
IP address 208.91.112.53 are accepted by policy 2.
diagnose debug enable
5 Change the PC to use a different but still valid DNS server on the Internet.
6 Attempt to browse the web.
Web browsing will not work because DNS lookups are blocked.
The policy 3 Count column should show that it is denying traffic.
7 Enter the following command to verify that DNS sessions from a PC with IP address
192.168.1.110 to a different DNS server are blocked.
diagnose debug enable
Solution
To configure the FortiWiFi unit to allow printing to an AirPrint-compatible printer, the network
topology determines the solution. For example, if an iPhone and an AirPrint-compatible printer both
use WiFi to connect to the same FortiWiFi wireless access point on the same subnet, no FortiWiFi
configuration changes are required as long as intra-SSID traffic is not blocked. The iPhone and the
printer can communicate directly.
If the iPhone and the AirPrint-compatible printer are on different networks separated by a FortiWiFi
unit you can use the information below to set all AirPrint communication through the FortiWiFi unit.
The following examples also describe how to allow AirPlay communication between AirPlay devices
also separated by a FortiWiFi unit.
Protocol 17
Action ACCEPT
Protocol 17
Action ACCEPT
iOS device
In tw
te or
ne
rn k
al
FortiWiFi1
or l
tw na
k
ne ter
In
AirPrint-capable
printer
FortiWiFi 2
1 On both FortiWiFi units, enable multicast forwarding and create security policies to allow
multicast traffic. See “Enable multicast forwarding” on page 204.
2 Go to Firewall Objects > Service > Custom and select Create New.
Name IPP
Protocol TCP
4 Select OK.
5 On FortiWiFi 1 go to Policy > Policy > Policy and select Create New.
6 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
7 Add a security policy to allow the AirPrint traffic from the wireless network to the internal network.
Schedule always
Service IPP
Action ACCEPT
8 Select OK.
9 On FortiWiFi 2 go to Policy > Policy > Policy and select Create New.
10 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
11 Add a security policy to allow the AirPrint traffic from the internal network to the wireless network.
Schedule always
Service IPP
Action ACCEPT
12 Select OK.
With this configuration in place, anyone using an iOS device on FortiWiFi 1’s wireless network can
use AirPrint to print to the printer.
AirPrint from OS X
To allow an OS X computer to print to an AirPrint enabled printer on a WiFi network, configure the
FortiWiFi unit using these procedures:
or l
tw na
k
ne ter
In
OS X computers
AirPrint-capable
printer
FortiWiFi
Forti
iWiFi unit
1 Enable multicast forwarding and create security policies to allow multicast traffic. See “Enable
multicast forwarding” on page 204.
2 Go to Firewall Objects > Service > Custom and select Create New to create a PDL data
streaming custom service:
Name PDL
Protocol TCP
3 Select OK.
4 Go to Policy > Policy > Policy and select Create New.
5 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
6 Add a policy to allow AirPrint traffic from the internal network to the wireless network:
Schedule always
Service PDL
Action ACCEPT
7 Select OK.
With this configuration in place, anyone using an OS X computer on the network connected to the
internal interface of the FortiWiFi unit can use AirPrint to print to the printer.
iOS device
or l
tw na
k
ne ter
In
FortiWiFi
Apple TV
App
1 Enable multicast forwarding and create security policies to allow multicast traffic. See “Enable
multicast forwarding” on page 204.
2 Go to Firewall Objects > Service > Custom and select Create New.
3 Create a new custom service with these characteristics:
6 Select OK.
7 Go to Policy > Policy > Policy and select Create New.
8 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
9 Create a security policy to allow AirPlay traffic from the wireless network to the internal network.
Schedule always
Action ACCEPT
11 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
12 Create a security policy to allow the AirPlay traffic from the internal network to the wireless
network.
Schedule always
Action ACCEPT
13 Select OK.
With this configuration in place, anyone using an iOS device on the wireless interface of the FortiWiFi
unit can use AirPlay to play media on the Apple TV.
Although AirPlay will function with this configuration, playing You Tube video requires that security
policies allow the iOS device and the Apple TV to access the Internet.
AirPlay from OS X
To allow an OS X computer to play to an Apple TV on a separate network, configure the FortiWiFi unit
using these procedures:
Apple TV
App
In etw
te o
n
rn rk
al
or l 1
2
tw na
k
ne ter
In
OS X computers
FortiWiFi
FortiWiF
Fi unit
1 Enable multicast forwarding and create security policies to allow multicast traffic. See “Enable
multicast forwarding” on page 204.
2 Go to Firewall Objects > Service > Custom and select Create New.
3 Create a new custom service with these characteristics:
Schedule always
Action ACCEPT
11 Create a security policy to allow the AirPlay traffic from the Apple TV network to the OS X
computer network.
Schedule always
Action ACCEPT
12 With this configuration in place, anyone using an iOS device on the wireless interface of the
FortiWiFi unit can use AirPlay to play media on the Apple TV.
Inte rk
rn wo
net al IP al net
wo ph
rk one Intern
Solution
Using traffic shaping, you can configure shared shapers that ensure a consistent amount of
bandwidth is reserved for VoIP/SIP communications and still maintain bandwidth for other Internet
traffic such as email and web browsing. For this solution, 200000 kbits/s is guaranteed to be
available for VoIP and VoIP traffic is given higher priority than other traffic. Other traffic is limited to a
maximum bandwidth of 100000 kbits/s.
In this configuration, the internal IP phone network and internal network both connect to the
FortiGate internal interface.
When creating a traffic shaper, you must include a data value for the Maximum Bandwidth and/or
the Guaranteed Bandwidth as well as selecting the Traffic Priority.
Create traffic shapers for VoIP traffic and for other traffic
1 Go to Firewall Objects > Traffic Shaper > Shared and select Create New.
2 Add a shared shaper for IP phone traffic:
Name VoIP
Name Daily_Traffic
Creating the firewall addresses for the IP phone and internal networks
1 Go to Firewall Objects > Address > Address and select Create New.
2 Add the engineering address range:
Type IP Range
Interface internal
Type IP Range
Interface internal
Schedule always
Service SIP
Action ACCEPT
Schedule always
Service ALL
Action ACCEPT
10 Select Traffic Shaping and select the daily traffic shaper for both directions:
To monitor the data passing through the FortiGate unit for troubleshooting, remember to enable
Log Allowed Traffic in both policies.
Results
Phone usage has a guaranteed bandwidth and a higher priority than other standard Internet usage.
As such, telephony use will not be degraded by other traffic between the internal network and the
Internet.
Go to Firewall Objects > Monitor > Traffic Shaper Monitor and select Current Bandwidth to view
the current bandwidth being used by active traffic shapers. If standard traffic volume is high enough,
it will top out at the maximum bandwidth defined in each shaper,
To ensure that the shaper is in use, go to Log & Report > Traffic Log > Local Traffic. Filter the
Service by SIP to see the telephony traffic.
Viewing the detailed information for a SIP log messages, the shaper name appears in the Sent
Shaper Name field.
il
raz
-B
e 2 22
o ffic 0.1-1
1
nch 8.1
Bra 2.16
19
Br
10 anch
.10 of
.20 fice
.1- 3
25 - E
g ypt
nd
ela
- Ir
e 1 55
o ffic .15-1
nch .144
Bra 2.16
17
H
17 eadq
2.2 ua
6.1 rte
20 rs
.1-
15
5
Solution
Create schedules for each branch office, as well as addresses with the geographic-based address
feature.
The geographic-based addresses allow you to indicate the country, and the traffic originating or
going to this country is logged, blocked or specific filtering is applied. The schedules, in this case, will
block employee access to the servers at specified times.
For this solution, we are using Eastern Time zone (GMT -5:00) as the time zone for the location of the
schedules and addresses.
Name branch_office_1
Type Geography
Country Ireland
Interface wan1
3 Select OK.
4 Create the other two addresses; use the names branch_office_2 for Brazil, and branch_office_3
for Egypt.
5 Go to Firewall Objects > Address > Group and create a group of the three addresses called
remote_offices.
Name branch_office1
Name branch_office2
Name branch_office3
7 Select OK.
8 Go to Firewall Objects > Schedule > Group and group these three schedules called
remote_backup_schedule.
Schedule remote_backup_schedule
Service ALL
Action ACCEPT
4 Select OK.
Results
Employee access to these servers should be blocked during the times specified in the firewall
schedules. You can test this by trying to access a server in Ireland at 11:00 am your time; you should
not be able to access the server.
1
9
2
In 8.1
.1
te .0
6
r n /2
al 5
N 5.2
et 5
w 5
o .2
rk 5
Sta
tic
5
.0
in be s
and terna twee ource
the l ne n the NAT
Inte two
rne rk
1. al t
8. rn
99
16 te
2. in
19
sr c p P: t: 8
c o 17 0
sr I r
.1 1
IP rt 2
3 2
20 n
d tp
.1 wa
: 1 : [a .2
4
st o
d
92 ny 0.1
1
s
.1 ] 20
68
20
.1
2.
.[1
17
-2
55
.1
]
01
sr c p P: t: 8
3
c o 17 0
sr I r
IP rt 2
d tp
: 1 : [a .2
1
st o
2
d
72 ny 0.1
s
.2 ] 20
0.
12
0.
1 4
.1
01
Solution
Static source address translation (or static SNAT) is most often used to allow users on an internal
network to connect to the Internet. Static SNAT translates the source addresses of all outgoing
packets to the IP address of the external interface. To keep track of individual sessions, the FortiGate
unit also translates the source port of all packets. This type of NAT is also called port address
translation (PAT), network address and port translation (NAPT), IP masquerading, NAT overload, and
many-to-one NAT.
1 Go to Policy > Policy > Policy and select Create New.
2 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
3 Add the following security policy that allows users on the private network to access the Internet.
Schedule always
Service ALL
Action ACCEPT
Results
All packets accepted by this security policy have their source IP addresses translated from a private
IP address on the 192.168.1.0 network to the IP address of the wan1 interface (172.20.120.14). As
well, the source port is translated to a random source port. The destination IP address and
destination port are not changed.
Test source NAT by browsing a website on the Internet from a device on the internal network. Use the
following packet sniffer command to see the results.
diagnose sniffer packet any 'port 80' 4 4
interfaces=[any]
filters=[port 80]
7.863458 internal in 192.168.1.110.3444 -> 172.20.120.101.80: syn 2322143869
7.872937 wan1 out 172.20.120.14.36344 -> 172.20.120.101.80: syn 2322143869
7.873146 wan1 in 172.20.120.101.80 -> 172.20.120.14.36344: syn 593799196 ack 2322143870
7.873325 internal out 172.20.120.101.80 -> 192.168.1.110.3444: syn 593799196 ack 2322143870
• The first output line shows a packet was received by the Internal interface with source address
192.168.110.
• The second output line shows that when the packet exits the wan1 interface the source address
is changed to 172.20.120.14.
• The third output line shows that when the response packet is received by the wan1 interface the
destination address is still 172.20.120.14.
• The fourth output line shows that when the response packet exits the internal interface to return
to the source, its destination address has changed to 192.168.1.110.
• Notice also in this example, the source port is translated from 3444 to 36344 and then back to
3444.
• The source IP of all packets from any source IP is always translated to 172.20.120.14.
Go to Policy > Policy > Policy and check the Count column for the security policy you added to
verify that it is processing traffic. Right-click on the column headings and select Column Settings
and add the Count column.
Go to Policy > Monitor > Session Monitor to view the sessions being processed by the FortiGate
unit. You can also see results by going to Policy > Monitor > Policy Monitor to view a graph of
active sessions for each policy. Since there is only one policy, that graph contains only one entry. You
can select the bar graph for the policy to view the top sessions by source address, destination
address, or destination port/service.
The Top Sessions dashboard widget presents another view of sessions that you can also drill down
into to get more info about current sessions. Other dashboard widgets display session history, traffic
history, and per-IP bandwidth usage.
If you can browse the web from the internal network, your configuration is successful. If you cannot,
try the steps described in “Troubleshooting NAT/Route mode installations” on page 20 to find the
problem.
1
9
2
In 8.1
.1
te .0
6
r n /2
al 5
N 5.2
et 5
w 5
o .2
rk 5
5
D b rn e I
.0
yn e a n
am tw l n ter
ic een tw net
in d t
so t or
te h
ur he k
an
ce
N
e
AT
1. al
8. rn
99
16 te
2. in
2. 20 .12 Ps
.1 20 .13
17 2. 20 l I
.1 4
20 .1 0
20 .1
17 2. rna
19
5
17 te
x
4 E
sr c p P: t: 8
3
c o 17 0
.1 1
sr I r
IP rt 2
20 n
1
.1 wa
2
d tp
: 1 : [a .2
st o
d
92 ny 0.1
s
.1 ] 20
68
20
.1
2.
.[1
17
-2
55
.1
]
01
3
sr c p P: t: 8
2 1
c o 17 0
sr t I or
IP rt 2
d tp
: 1 : [a .2
s
d
72 ny 0.1
s
.2 ] 20
0.
12
0.
[1
3-
15
.1
]
01
Solution
Use dynamic source address translation when you have more than one external IP address and you
want outgoing packets to use some or all of these addresses. To get the FortiGate unit to use more
than one IP address for source NAT, you add the addresses to an IP pool. This example uses an IP
pool containing only three IP addresses: 172.20.120.[13-15]. Then you add a security policy and
select Use Dynamic IP Pool.
1 Go to Firewall Objects > Virtual IP > IP Pool and select Create New.
2 Add the following IP pool.
Name Dynamic-Source
Type Overload
Schedule always
Service ALL
Action ACCEPT
6 Select Enable NAT and Use Dynamic IP Pool and select the Dynamic-Source IP Pool.
7 Select OK.
Results
All packets accepted by this security policy have their source IP addresses translated from a private
IP address on the 192.168.1.0 network to one of the IP addresses in the IP pool. (172.20.120.[13-15]).
As well, the source port is translated to a random source port. The destination IP address and
destination port are not changed.
Test dynamic source NAT by browsing a website on the Internet from multiple IP addresses on the
internal network. Use the following packet sniffer command to see the results.
diagnose sniffer packet any 'port 80' 4 8
interfaces=[any]
filters=[port 80]
4.893372 internal in 192.168.1.120.4806 -> 172.20.120.101.80: syn 1222685135
4.893644 wan1 out 172.20.120.14.45642 -> 172.20.120.101.80: syn 1222685135
4.893855 wan1 in 172.20.120.101.80 -> 172.20.120.14.45642: syn 3955257209 ack 1222685136
4.894016 internal out 172.20.120.101.80 -> 192.168.1.120.4806: syn 3955257209 ack 1222685136
4.559945 internal in 192.168.1.110.4834 -> 172.20.120.101.80: syn 2817814036
4.560189 wan1 out 172.20.120.13.49774 -> 172.20.120.101.80: syn 2817814036
4.562207 wan1 in 172.20.120.101.80 -> 172.20.120.13.49774: syn 1591702338 ack 2817814037
4.562383 internal out 172.20.120.101.80 -> 192.168.1.110.4834: syn 1591702338 ack 2817814037
• The first four output lines show a session from IP address 192.168.1.120 where the source IP
address has been translated to 172.20.120.14.
• The next four output lines show a session from IP address 192.168.1.110 where the source IP
address has been translated to 172.20.120.13.
Go to Policy > Policy > Policy and check the Count column for the security policy you added to
verify that it is processing traffic. Right-click on the column headings and select Column Settings
and add the Count column.
Go to Policy > Monitor > Policy Monitor to view a graph of active sessions for each policy. Since
there is only one policy, that graph contains only one entry. You can select the bar graph for the policy
to view the top sessions by source address, destination address, or destination port/service.
The Top Sessions dashboard widget presents another view of sessions that you can also drill down
into to get more info about current sessions. Other dashboard widgets display session history, traffic
history, and per-IP bandwidth usage.
If you can browse the web from the internal network, your configuration is successful. If you cannot,
try the steps described in “Troubleshooting NAT/Route mode installations” on page 20 to find the
problem.
19
2.
In 8.1
16
te .0
r n /2
al 5
N 5.2
et 5
w 5
o .2
rk 5
D b ern e I ot
yn e a n ch
am tw l n ter an
5 .0
ic een tw net ge
in d t rt
so t or
t h n
so
ur he k
an po
ur
ce
ce
N
e
AT
1. al
8. rn
d
99
16 te
2. in
2. 20 .12 s
.1 20 .13
17 2. 20 l IP
19
.1 4
20 .1 0
20 .1
17 2. rna
5
17 te
x
sr c p P: t: 8
E
c o 17 0
.1 1
sr I r
3 2
20 n
IP rt 2
.1 wa
4
d tp
: 1 : 2 .2
st o
1
d
92 41 0.1
s
.1 5 20
20
68
2.
.1
17
.[1
-2
55
.1
]
01
3
sr c p P: t: 8
c o 17 0
sr t I or
IP rt 2
1
2
d tp
: 1 : 2 .2
s
d
72 41 0.1
s
.2 5 20
0.
12
0.
[ 1 3-
15
.1
]
01
Solution
You can select the fixed port option to restrict the FortiGate unit to not translate the source port. This
results in a one-to-one NAT configuration. One-to-one NAT limits the number of simultaneous
sessions that are supported because one variable for tracking sessions (the source port number) is
no longer available. To allow more sessions, one-to-one NAT is normally used with multiple external
IPs added to an IP pool.
In this example, you enable one-to-one NAT by enabling the fixed port option in a security policy and
adding an IP pool containing three IP addresses: 172.20.120.[13-15].
1 Go to Firewall Objects > Virtual IP > IP Pool and select Create New.
Name Dynamic-Source
Type One-to-One
Schedule always
Service ALL
Action ACCEPT
6 Select Enable NAT and Use Dynamic IP Pool and select the Dynamic-Source IP Pool.
Once selected, you will notice that the Fixed Port option is automatically selected.
7 Select OK.
Results
All packets accepted by this security policy have their source IP addresses translated from a private
IP address on the 192.168.1.0 network to one of the IP addresses in the IP pool. (172.20.120.[13-15]).
The source port, destination IP address, and destination port are not changed.
Test dynamic source NAT by browsing to a website on the Internet from multiple IP addresses on the
internal network. Use the following packet sniffer command to see the results.
diagnose sniffer packet any 'port 80' 4 18
interfaces=[any]
filters=[port 80]
17.388234 internal in 192.168.1.110.2415 -> 172.20.120.101.80: syn 1350596827
17.392883 wan1 out 172.20.120.13.2415 -> 172.20.120.101.80: syn 1350596827
17.395249 wan1 in 172.20.120.101.80 -> 172.20.120.13.2415: syn 927139461 ack 1350596828
17.395425 internal out 172.20.120.101.80 -> 192.168.1.110.2415: syn 927139461 ack 1350596828
17.395537 internal in 192.168.1.110.2415 -> 172.20.120.101.80: ack 927139462
17.395626 wan1 out 172.20.120.13.2415 -> 172.20.120.101.80: ack 927139462
17.406820 internal in 192.168.1.110.2416 -> 172.20.120.101.80: syn 1206067881
17.407038 wan1 out 172.20.120.13.2416 -> 172.20.120.101.80: syn 1206067881
17.407246 wan1 in 172.20.120.101.80 -> 172.20.120.13.2416: syn 921167482 ack 1206067882
17.407383 internal out 172.20.120.101.80 -> 192.168.1.110.2416: syn 921167482 ack 1206067882
17.407493 internal in 192.168.1.110.2416 -> 172.20.120.101.80: ack 921167483
17.407582 wan1 out 172.20.120.13.2416 -> 172.20.120.101.80: ack 921167483
2.872214 internal in 192.168.1.120.2483 -> 172.20.120.101.80: syn 543091999
2.872890 wan1 out 172.20.120.14.2483 -> 172.20.120.101.80: syn 543091999
2.873090 wan1 in 172.20.120.101.80 -> 172.20.120.14.2483: syn 868936759 ack 543092000
2.873263 internal out 172.20.120.101.80 -> 192.168.1.120.2483: syn 868936759 ack 543092000
2.873413 internal in 192.168.1.120.2483 -> 172.20.120.101.80: ack 868936760
2.873513 wan1 out 172.20.120.14.2483 -> 172.20.120.101.80: ack 868936760
• The first six output lines show a session from IP address 192.168.1.110 where the source IP
address has been translated to 172.20.120.13. The source port remains unchanged at 2415.
• The next six output lines also show a session from IP address 192.168.1.110 where the source IP
address has been translated to 172.20.120.13. The source port for this session was 2416 and
was also not changed.
• The final six output lines show a session from IP address 192.168.1.120 where the source IP
address has been translated to 172.20.120.14. The source port for this session was 2483 and
was also not changed.
Go to Policy > Policy > Policy and check the Count column for the security policy you added to
verify that it is processing traffic. Right-click on the column headings and select Column Settings
and add the Count column.
Go to Policy > Monitor > Policy Monitor to view a graph of active sessions for each policy. Since
there is only one policy, that graph contains only one entry. You can select the bar graph for the policy
to view the top sessions by source address, destination address, or destination port/service.
The Top Sessions dashboard widget presents another view of sessions that you can also drill down
into to get more info about current sessions. Other dashboard widgets display session history, traffic
history, and per-IP bandwidth usage.
If you can browse the web from the internal network, your configuration is successful. If you cannot,
try the steps described in “Troubleshooting NAT/Route mode installations” on page 20 to find the
problem.
1
9
2
In 8.1
.1
te .0
6
r n /2
al 5
N 5.2
et 5
w 5
o .2
rk 5
5
.0
C ntr tra
en o n
co or
tra in sla
l N g s tio
p
AT ou n
t
ta rce
bl
e
1. al
8. rn
99
16 te
2. in
2. 20 .12 Ps
.1 20 .13
17 2. 20 l I
.1 4
20 .1 0
20 .1
17 2. rna
19
5
17 te
1 Ex
sr c p P: t: 8
3
c o 17 0
sr I r
.1 1
IP rt 2
20 n
2
d tp
: 1 : [3 .2
.1 wa
st o
d
92 38 0.1
s
.1 0 20
68 - .1
20
.1 34 01
2.
.[1 00
17
-2 ]
55
]
3
sr c p P: t: 8
2 1
c o 17 0
sr t I or
IP rt 2
d tp
: 1 : [3 .2
s
d
72 00 0.1
s
.2 00 20
0. - .1
12 3 0
0. 00 1
[1 2
3- 0]
15
]
Solution
The central NAT table provides full control over how source addresses and source ports are
translated and is the only solution when you want to control how source ports are translated. By
using the central NAT table, you can specify an incoming source address range and source port
range and specify how the source address and ports are translated. This can be useful for protocols
that require a fixed source port or that require the source port be translated in a controlled and
predictable way.
In this example:
• Packets with a source IP on the internal network and a source port in the range 3380 to 3400 will
have their source address translated to an address in the range 172.20.120.[13-15] and their
source ports translated to a port number in the range 30000 to 30020.
• Packets with a source IP on the internal network and a source port in the range 1 to 3379 and
3401 to 65,535 will have their source address translated to the IP address of the FortiGate wan1
interface (172.20.120.11). This is the default source NAT behavior.
1 Go to Firewall Objects > Virtual IP > IP Pool and select Create New.
Name Dynamic-Source
Type Overload
IP Range/Subnet 172.20.120.13-172.20.120.15
Type Subnet
Interface internal
5 Select OK.
6 Go to System > Admin > Settings and in Display Options on GUI, make sure the Central NAT
Table option is selected.
7 Select Apply if you made a change.
8 Go to Policy > Policy > Central NAT Table and select Create New.
9 Add a central NAT table entry.
10 Select OK.
12 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
13 Add the following security policy that allows users on the private network to access the Internet.
Schedule always
Service ALL
Action ACCEPT
15 Select OK.
Results
All packets accepted by this security policy from the internal network with source ports in the range
3380 to 3400 have their source IP addresses translated to one of the IP addresses in the IP pool.
(172.20.120.[13-15]) and their source ports translated to a number in the range 30000 to 30020.
Packets with any other source port are handled according to the default source NAT behavior (if you
selected Use Destination Interface Address).
Test the configuration by browsing a website on the Internet from any IP address on the internal
network. Use the following packet sniffer command to see the results.
diagnose sniffer packet any 'port 80' 4 8
interfaces=[any]
filters=[port 80]
5.117683 internal in 192.168.1.110.3364 -> 172.16.100.148.80: syn 3821216192
5.117980 wan1 out 172.20.120.11.40360 -> 172.16.100.148.80: syn 3821216192
5.177848 wan1 in 172.16.100.148.80 -> 172.20.120.11.40360: syn 1388291811 ack 3821216193
5.178020 internal out 172.16.100.148.80 -> 192.168.1.110.3364: syn 1388291811 ack 3821216193
5.178181 internal in 192.168.1.110.3364 -> 172.16.100.148.80: ack 1388291812
5.178297 wan1 out 172.20.120.11.40360 -> 172.16.100.148.80: ack 1388291812
6.950657 wan1 in 172.16.100.148.80 -> 172.20.120.11.40360: fin 1388326799 ack 3821216763
129.595427 internal in 192.168.1.110.3385 -> 172.20.120.101.80: syn 2385736674
129.595715 wan1 out 172.20.120.13.30005 -> 172.20.120.101.80: syn 2385736674
129.598782 wan1 in 172.20.120.101.80 -> 172.20.120.13.30005: syn 2238273308 ack 2385736675
129.598923 internal out 172.20.120.101.80 -> 192.168.1.110.3385: syn 2238273308 ack 2385736675
129.599054 internal in 192.168.1.110.3385 -> 172.20.120.101.80: ack 2238273309
129.599164 wan1 out 172.20.120.13.30005 -> 172.20.120.101.80: ack 2238273309
144.656912 wan1 in 172.20.120.101.80 -> 172.20.120.13.30005: fin 2238273938 ack 2385737098
144.657027 internal out 172.20.120.101.80 -> 192.168.1.110.3385: fin 2238273938 ack 2385737098
145.982513 internal in 192.168.1.110.3385 -> 172.20.120.101.80: fin 2385737098 ack 2238273939
145.982631 wan1 out 172.20.120.13.30005 -> 172.20.120.101.80: fin 2385737098 ack 2238273939
• The first seven output lines show a session from IP address 192.168.1.110 with a source port of
3364. Since this source port is outside the range specified in the central NAT table entry (3380 to
3400) the source port has been translated to any source port (in this case 40360) and the source
address has been translated to 172.20.120.11 (the IP address of the wan1 interface).
• The next ten output lines show sessions from IP address 192.168.1.110 with a source port of
3385. Since this source port is in the range specified in the central NAT table entry the source port
has been translated to 30005, which is in the range specified in the central NAT table entry (30000
to 30020) and the source address has been translated to 172.20.120.13, one of the addresses in
the IP pool.
Go to Policy > Policy > Policy and check the Count column for the security policy you added to
verify that it is processing traffic. Right-click on the column headings and select Column Settings
and add the Count column.
Go to Policy > Monitor > Policy Monitor to view a graph of active sessions for each policy. Since
there is only one policy, that graph contains only one entry. You can select the bar graph for the policy
to view the top sessions by source address, destination address, or destination port/service.
The Top Sessions dashboard widget presents another view of sessions that you can also drill down
into to get more info about current sessions. Other dashboard widgets display session history, traffic
history, and per-IP bandwidth usage.
If you can browse the web from the internal network, your configuration is successful. If you cannot,
try the steps described in “Troubleshooting NAT/Route mode installations” on page 20 to find the
problem.
W iva .16
eb te 8
P 92
r
S Ne .1
1
er t 1
ve wo 0
r rk
o
.1
se t
D ons e w
es f e
ss o t
tin ro b
i h
at m se
io th rv
n e er
N In
AT te
fo rne
r t
1. al
8. rn
99
16 te
2. in
19
sr c p P: t: 8
3
c o 19 0
sr I r
IP rt 2
1 .1 1
20 n
d tp
2
: 1 : [a .1
.1 wa
4
st o
d
72 ny 68
s
.2 ] .1.
0.
20
12
2.
0.
17
12
11
0
3
sr c p P: t: 8
c o 17 0
1
sr t I or
2
IP rt 2
d tp
: 1 : [a .2
s
d
72 ny 0.1
s
.2 ] 20
0.
12
0.
12
.1
4
Solution
In this basic DNAT example, to allow connections to the web server, you must configure the FortiGate
unit to accept HTTP sessions with a destination address of 172.20.120.14 and translate this
destination IP address to the IP address of the web server (192.168.1.110) before forwarding the
session to the internal network.
1 Go to Firewall Objects > Virtual IP > Virtual IP and select Create New.
2 Add a virtual IP that maps the wan1 interface IP address to the web server IP address.
3 Select OK.
4 Go to Policy > Policy > Policy and select Create New.
5 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
6 Add a policy that allows users on the Internet to access the web server.
Schedule always
Service HTTP
Action ACCEPT
7 Select OK.
If you select NAT, the source address is changed to the internal interface address. Normally, you
would not want to perform source NAT since this has the affect of hiding the actual source address
of the sessions.
Results
All HTTP packets accepted by this security policy have their destination IP addresses translated from
172.20.120.14 to 192.168.1.110 before being forwarded to the Internal network where they are
received by the web server. The source IP address and source port are not changed.
As a result of this configuration, you cannot establish an administrative connection to the wan1
interface because all sessions with a destination address of the wan1 interface (172.20.120.14) are
accepted or denied by the security policy. This configuration is not recommended, especially if you
want to remotely administer your FortiGate unit from the wan1 interface. Instead, you should get
another Internet IP address for the web server and change the VIP to forward this address to the
web server.
Test destination NAT by browsing to http://172.20.120.14 from the Internet. The session passes
through the FortiGate unit to the web server which sends a response. Use the following packet sniffer
command to see the results.
diagnose sniffer packet any 'port 80' 4 4
interfaces=[any]
filters=[port 80]
6.150356 wan1 in 172.20.120.12.51439 -> 172.20.120.14.80: syn 15893888
6.150637 internal out 172.20.120.12.51439 -> 192.168.1.110.80: syn 15893888
6.150803 internal in 192.168.1.110.80 -> 172.20.120.12.51439: syn 553485227 ack 15893889
6.150974 wan1 out 172.20.120.14.80 -> 172.20.120.12.51439: syn 553485227 ack 15893889
• The first output line shows a packet from a client device with IP address 172.20.120.12 was
received by the wan1 interface with destination address 172.20.120.14 and destination port 80.
• The second output line shows that when the packet exits the internal interface the destination
address is changed to 192.168.1.110 and the destination port is still 80.
• The third output line shows the response from the web server.
• The fourth output line shows the response from the web server being returned to the client
device. The source address has been changed back to 172.20.120.14.
• In this example, the source port is not changed.
Go to Policy > Policy > Policy and check the Count column for the security policy you added to
verify that it is processing traffic. Right-click on the column headings and select Column Settings
and add the Count column.
Go to Policy > Monitor > Policy Monitor to view a graph of active sessions for each policy. Since
there is only one policy, that graph contains only one entry. You can select the bar graph for the policy
to view the top sessions by source address, destination address, or destination port/service.
The Top Sessions dashboard widget presents another view of sessions that you can also drill down
into to get more info about current sessions. Other dashboard widgets display session history, traffic
history, and per-IP bandwidth usage.
W iva .16
eb te 8
P 92
r
S Ne .1
1
er t 1
ve o 0
r rk
o
w
.1
n
D
ses po estin
si rt ati
to ons f trans on NA
the rom lat T
we th ion with
b s e In for
erv ter
er net
1. al
8. rn
99
16 te
2. in
19
sr c p P: t: 8
3
c o 19 0
sr I r
.1 1
IP rt 2
1
20 n
d tp
2
: 1 : [a .1
.1 wa
4
st o
d
72 ny 68
s
.2 ] .1.
0.
20
12
2.
0.
17
12
11
0
3
sr p P: t: 8
c o 17 0
1
sr t I or
2
IP rt 2 80
c
d tp
: 1 : [a .2
s
d
72 ny 0.1
s
.2 ] 20
0.
12
0.
12
.1
4
Solution
In this DNAT example, to allow connections to the web server you must configure the FortiGate unit
to accept HTTP sessions with a destination address of 172.20.120.14 and translate this destination
IP address to the IP address of the web server (192.168.1.110) before forwarding the session to the
internal network.
In addition, the web server accepts connections on the standard HTTP port (port 80), but you want
sessions from the Internet to the web server to use port 8080. The FortiGate unit must also translate
the destination port from 8080 to 80.
1 Go to Firewall Objects > Virtual IP > Virtual IP and select Create New.
2 Add a virtual IP that maps the wan1 interface IP address to the web server IP address and maps
connections from port 8080 to port 80.
Protocol TCP
Map to Port 80 - 80
4 Select OK.
5 Go to Policy > Policy > Policy and select Create New.
6 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
7 Add a policy that allows users on the Internet to access the web server.
Schedule always
Service HTTP
Action ACCEPT
8 Select OK.
If you select NAT, the source address is changed to the internal interface address. Normally, you
would not want to perform source NAT since this has the affect of hiding the actual source address
of the sessions.
Results
All HTTP packets accepted by this security policy have their destination IP addresses translated from
172.20.120.14 to 192.168.1.110 and their destination port translated from 8080 to 80 before being
forwarded to the Internal network where they are received by the web server. The source IP address
and source port are not changed.
Even though in the security policy, the Service is set to the HTTP predefined service, which would
normally only receive packets on port 80, this configuration still accepts HTTP packets on port
8080.
Test destination NAT by browsing to http://172.20.120.14:8080. Use the following packet sniffer
command to see the results.
diagnose sniffer packet any 'port 80 or port 8080' 4 4
interfaces=[any]
filters=[port 80 or port 8080]
8.823058 wan1 in 172.20.120.12.52568 -> 172.20.120.14.8080: syn 2855697809
8.829146 internal out 172.20.120.12.52568 -> 192.168.1.110.80: syn 2855697809
8.829287 internal in 192.168.1.110.80 -> 172.20.120.12.52568: syn 2151198672 ack 2855697810
8.838931 wan1 out 172.20.120.14.8080 -> 172.20.120.12.52568: syn 2151198672 ack 2855697810
• The first output line shows a packet from a client device with IP address 172.20.120.12 was
received by the wan1 interface with destination address 172.20.120.14 and destination port 8080.
• The second output line shows that when the packet exits the internal interface the destination
address is changed to 192.168.1.110 and the destination port has been changed to 80.
• The third output line shows the response from the web server.
• The fourth output line shows the response from the web server being returned to the client
device. The source address has been changed back to 172.20.120.14 and the source port to
8080.
• The original source port is not changed.
Go to Policy > Policy > Policy and check the Count column for the security policy you added to
verify that it is processing traffic. Right-click on the column headings and select Column Settings
and add the Count column.
Go to Policy > Monitor > Policy Monitor to view a graph of active sessions for each policy. Since
there is only one policy, that graph contains only one entry. You can select the bar graph for the policy
to view the top sessions by source address, destination address, or destination port/service.
The Top Sessions dashboard widget presents another view of sessions that you can also drill down
into to get more information about current sessions. Other dashboard widgets display session
history, traffic history, and per-IP bandwidth usage.
W iva .16
eb te 8
P 92
r
S Ne .1
1
er t 1
ve o 0
r rk
o
w
.1
n
ses De
si sti
to ons f natio
the rom n N
we th AT
b s e In for
erv ter
er net
1. al
8. rn
99
16 te
2. in
In 17
W et 0.1
te 2
eb IP 2
r n .2
19
S ad .1
er d 1
sr c p P: t: 8
v e re
3
c o 19 0
sr t I or
r ss
IP rt 2
.1 1
1
20 n
d tp
2
: 1 : [a .1
0
.1 wa
4
s
d
72 ny 68
s
.2 ] .1.
0.
20
12
2.
0.
17
12
11
0
3
sr c p P: t: 8
c o 17 0
1
sr I r
2
IP rt 2
d tp
: 1 : [a .2
st o
d
72 ny 0.1
s
.2 ] 20
0.
12
0.
12
.1
1
Solution
In this DNAT example, to allow connections to the web server, you must configure the FortiGate unit
to accept HTTP sessions with a destination address 172.20.120.11 and translate this destination IP
address to 192.168.1.110 before forwarding the session to the web server.
1 Go to Firewall Objects > Virtual IP > Virtual IP and select Create New.
2 Add a virtual IP that maps the wan1 interface IP address to the web server IP address.
3 Select OK.
Schedule always
Service HTTP
Action ACCEPT
7 Select OK.
If you select NAT, the source address is changed to the internal interface address. Normally, you
would not want to perform source NAT since this has the affect of hiding the actual source address
of the sessions.
Results
All HTTP packets accepted by this security policy have their destination IP addresses translated from
172.20.120.11 to 192.168.1.110 before being forwarded to the Internal network where they are
received by the web server. The source IP address and source port are not changed.
Test destination NAT by browsing to http://172.20.120.11 from the Internet. The session passes
through the FortiGate unit to the web server which sends a response. Use the following packet sniffer
command to see the results.
diagnose sniffer packet any 'port 80' 4
interfaces=[any]
filters=[port 80]
3.454327 wan1 in 172.20.120.12.51526 -> 172.20.120.11.80: syn 3420016827
3.458908 internal out 172.20.120.12.51526 -> 192.168.1.110.80: syn 3420016827
3.459044 internal in 192.168.1.110.80 -> 172.20.120.12.51526: syn 3323826862 ack 3420016828
3.468915 wan1 out 172.20.120.11.80 -> 172.20.120.12.51526: syn 3323826862 ack 3420016828
3.469133 wan1 in 172.20.120.12.51526 -> 172.20.120.11.80: ack 3323826863
3.469260 internal out 172.20.120.12.51526 -> 192.168.1.110.80: ack 3323826863
3.470322 internal in 192.168.1.110.80 -> 172.20.120.12.51526: psh 3323826863 ack 3420017308
3.470453 wan1 out 172.20.120.11.80 -> 172.20.120.12.51526: psh 3323826863 ack 3420017308
• The first output line shows a packet from a client device with IP address 172.20.120.12 was
received by the wan1 interface with destination address 172.20.120.11 and destination port 80.
• The second output line shows that when the packet exits the internal interface the destination
address is changed to 192.168.1.110 and the destination port is still 80.
• The third output line shows the response from the web server.
• The fourth output line shows the response from the web server being returned to the client
device. The source address has been changed back to 172.20.120.11.
• The source port is not changed.
Go to Policy > Policy > Policy and check the Count column for the security policy you added to
verify that it is processing traffic. Right-click on the column headings and select Column Settings
and add the Count column.
Go to Policy > Monitor > Policy Monitor to view a graph of active session for each policy. Since
there is only one policy, that graph contains only one entry. You can select the bar graph form the
policy to view the top sessions by source address, destination address, or destination port/service.
The Top Sessions dashboard widget presents another view of sessions that you can also drill down
into to get more info about current sessions. Other dashboard widgets display session history, traffic
history, and per-IP bandwidth usage.
P 92
ri .1
P N .1.
va 6
1
C e 11
te 8
o tw 0
n o
rk
Op
en
T
2 CP
Inte for tr 119, ports
rne affic and 788
t to fro 299 2-
the m t 5 7999
ser he ,
1. al
8. rn
ver
99
16 te
2. in
19
3
sr c p P: t: 7 r 2
c o 19 8 9
sr I r o
.1 1
IP rt 2 82 9
20 n
2
d tp
.1 wa
: 1 : [a .1 -7 5
4
st o
d
72 ny 68 99
s
.2 ] .1. 9,
0.
20
12
2.
0.
17
12
11 2
0 11
3
9,
sr c p P: t: 7
c o 17 8
1
sr t I or
2
IP rt 2 82
d tp
: 1 : [a .2 -7
s
d
72 ny 0.1 99
s
.2 ] 20 9,
0.
12
0.
12
.1 2
1 11
9,
or
29
95
Solution
This DNAT example describes how to configure firewall VIPs to map the following sessions to the PC
on the internal network:
• TCP sessions to the wan1 IP address with destination port in the range 7882 to 7999.
• UDP sessions to the wan1 IP address with destination port 2119 or 2995.
The solution involves creating multiple VIPs that map sessions from the wan1 IP address to the PC IP
address and adding the VIPs to a VIP group and adding that VIP group to a wan1 to internal security
policy.
1 Go to Firewall Objects > Virtual IP > Virtual IP and select Create New.
2 Add a virtual IP that maps connections to the wan1 interface on ports 7882 to 7999 to the server.
Protocol TCP
Protocol UDP
8 Add a virtual IP that maps connections to the wan1 interface on UDP port 2995 to the server.
Protocol UDP
10 Select OK.
11 Go to Firewall Objects > Virtual IP > VIP Group and select Create New.
Interface wan1
13 Add Server Port Range, First UDP Port VIP, and Second UDP Port VIP to the Members list.
14 Select OK.
16 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
Schedule always
Service ALL
Action ACCEPT
18 Select OK.
If you select NAT, the source address is changed to the internal interface address. Normally, you
would not want to perform source NAT since this has the affect of hiding the actual source address
of the sessions.
Results
All packets accepted by this security policy have to have a destination port defined in the VIPs. The
VIPs also translate the destination IP address 172.20.120.14 to 192.168.1.110 before being
forwarded to the Internal network where they are received by the server. The destination ports,
source IP address and source port are not changed.
Test the configuration by operating the service and using the packet sniffer to see the results. For
example, you could try the following command:
diagnose sniffer packet any 'port 7882' 4
interfaces=[any]
filters=[port 7882]
4.150689 wan1 in 172.20.120.12.56825 -> 172.20.120.14.7882: syn 2904689044
4.150936 internal out 172.20.120.12.56825 -> 192.168.1.110.7882: syn 2904689044
4.151102 internal in 192.168.1.110.7882 -> 172.20.120.12.56825: syn 1081214414 ack 2904689045
4.151258 wan1 out 172.20.120.14.7882 -> 172.20.120.12.56825: syn 1081214414 ack 2904689045
Other commands could include:
diagnose sniffer packet any 'port 7882 or port 7883' 4
diagnose sniffer packet any 'udp and port 2119 or port 2995' 4
Go to Policy > Policy > Policy and check the Count column for the security policy you added to
verify that it is processing traffic. Right-click on the column headings and select Column Settings
and add the Count column.
Go to Policy > Monitor > Policy Monitor to view a graph of active session for each policy. Since
there is only one policy, that graph contains only one entry. You can select the bar graph form the
policy to view the top sessions by source address, destination address, or destination port/service.
The Top Sessions dashboard widget presents another view of sessions that you can also drill down
into to get more info about current sessions. Other dashboard widgets display session history, traffic
history, and per-IP bandwidth usage.
W va 68
eb te .1
P .1
1
r i
9
S N 12
2
er e 0-
ve w 1
rs or 23
t
o k
.
n
ses De
s st
to ions f inatio
the rom n
we N
b s the I AT fo
erv nte r
ers rne
1. al
8. rn t
99
16 te
2. in
In 72
te .2
W t I 20
1
r n 0.
eb P .1
19
e 1
S dd 0-
er r 1
sr c p P: t: 8
ve es 03
a 0
c o 19 0
sr I r
r se
IP rt 2
.1 1
1
20 n
d tp
2
: 1 : [a .1
.1 wa
4
st o
d
72 ny 68
s
.2 ] .1.
s
0.
20
12
2.
0.
17
12
12
0-
12
3
3
sr c p P: t: 8
c o 17 0
1
sr I r
2
IP rt 2 80
d tp
: 1 : [a .2
st o
d
72 ny 0.1
s
.2 ] 20
0.
12
0.
12
.1
00
-1
3 0
Solution
To allow connections to the web servers, you must configure the FortiGate unit to accept HTTP
sessions with a destination address in the range 172.20.120.100-103 and translate this destination IP
address to 192.168.1.120-123 before forwarding the session to a web server.
In addition, the port used by each web server to accept HTTP connections is the standard HTTP port
80. But you want connections from the Internet to the web servers to use port 8000.
1 Go to Firewall Objects > Virtual IP > Virtual IP and select Create New.
2 Add a virtual IP that maps the internet IP addresses of the web server to its actual internal
network IPs.
Protocol TCP
Map to Port 80 - 80
4 Select OK.
5 Go to Policy > Policy > Policy and select Create New.
6 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
7 Add a policy that allows users on the Internet to access the web server.
Schedule always
Service HTTP
Action ACCEPT
8 Select OK.
If you select NAT, the source address is changed to the internal interface address. Normally, you
would not want to perform source NAT since this has the affect of hiding the actual source address
of the sessions.
Results
HTTP packets accepted by this security policy have their destination IP addresses translated as:
• 172.20.120.100 to 192.168.1.120
• 172.20.120.101 to 192.168.1.121
• 172.20.120.102 to 192.168.1.122
• 172.20.120.103 to 192.168.1.123
In all cases the destination port is translated from 8080 to 80. The source IP address and source port
are not changed.
Test destination NAT by browsing to http://172.20.120.100 - 103:8000 from the Internet. Use the
following packet sniffer command to see the results.
diagnose sniffer packet any 'port 80 or port 8000' 4
interfaces=[any]
filters=[port 80 or port 8000]
10.603074 wan1 in 172.20.120.12.57053 -> 172.20.120.100.8000: syn 3591312927
10.603312 internal out 172.20.120.12.57053 -> 192.168.1.120.80: syn 3591312927
10.603479 internal in 192.168.1.120.80 -> 172.20.120.12.57053: syn 3848795067 ack 3591312928
10.603635 wan1 out 172.20.120.100.8000 -> 172.20.120.12.57053: syn 3848795067 ack 3591312928
16.422671 wan1 in 172.20.120.12.57070 -> 172.20.120.102.8000: syn 1145994219
16.422927 internal out 172.20.120.12.57070 -> 192.168.1.122.80: syn 1145994219
16.423096 internal in 192.168.1.122.80 -> 172.20.120.12.57070: syn 3958945838 ack 1145994220
16.423264 wan1 out 172.20.120.102.8000 -> 172.20.120.12.57070: syn 3958945838 ack 1145994220
• The first output line shows a packet from a client device with IP address 172.20.120.12 was
received by the wan1 interface with destination address 172.20.120.100 and destination port
8000.
• The second output line shows that when the packet exits the internal interface the destination
address is changed to 192.168.1.120 and the destination port has been changed to 80.
• The third output line shows the response from the web server.
• The fourth output line shows the response from the web server being returned to the client
device. The source address has been changed back to 172.20.120.100 and the source port back
to 8000.
• The original source port is not changed.
Go to Policy > Policy > Policy and check the Count column for the security policy you added to
verify that it is processing traffic. Right-click on the column headings and select Column Settings
and add the Count column.
Go to Policy > Monitor > Policy Monitor to view a graph of active sessions for each policy. Since
there is only one policy, that graph contains only one entry. You can select the bar graph for the policy
to view the top sessions by source address, destination address, or destination port/service.
The Top Sessions dashboard widget presents another view of sessions that you can also drill down
into to get more information about current sessions. Other dashboard widgets display session
history, traffic history, and per-IP bandwidth usage.
UTM Profiles
UTM profiles, including antivirus, web filtering, application control, intrusion protection (IPS),
email filtering, and data leak prevention (DLP) apply core UTM security functions to traffic
accepted by security policies. The FortiGate unit comes pre-configured with default UTM profiles for
all of these security features, and you can apply UTM features to traffic accepted by a security policy
by selecting the default profiles for the UTM features that you want to apply.
You can also create UTM profile groups to group together sets of UTM profiles to further simplify
adding UTM features to security policies.
The default profiles are designed to provide basic protection. You can modify the default profiles for
you needs or create new ones. Creating multiple profiles means you can apply different levels of
protection to different traffic types according to the security policies that accept the traffic.
In addition to the basic set of UTM profiles, the FortiGate unit includes specialized profiles for
protecting SIP and SCCP VoIP traffic and offloading additional security functions using ICAP.
Endpoint control profiles are created to ensure that workstation computers (also known as
endpoints) on your network, meet the network’s security requirements; otherwise, they are not
permitted access. Enhanced by Fortinet’s FortiClient Endpoint Security software, FortiGate endpoint
control can block or control access through the FortiGate unit for workstation computers depending
on the security functions enabled on the computers and the applications running on them. After
creating endpoint control profiles, you can add endpoint security profiles to security policies.
The final UTM profile feature, vulnerability scanning is independent of security policies. By using
vulnerability scanning, you can scan computers on your network for multiple vulnerabilities, and take
action to remove those vulnerabilities.
This chapter includes the following UTM examples:
• Protecting your network from viruses
• Protecting your network against grayware
• Protecting your network against legacy viruses
• Changing the maximum file size that the AV scanner examines
• Blocking files that are too large to scan for viruses
• Improving FortiGate performance with flow-based UTM scanning
• Limiting the types of web sites your users can visit
• Overriding FortiGuard web filtering for selected users
• Prevent offensive search results in Google, Bing and Yahoo
• Finding the FortiGuard web filter category of a URL
• Listing the web sites your users have visited
• Using FortiGuard web filtering to block access to web proxies
ANTIVIRUS/
ANTISPYWARE
Internal network
Virus
FortiGate Unit
Malware
Spyware
Solution
Configure your FortiGate unit to scan all Internet traffic for viruses and other malware and if a virus is
found the file containing the virus is removed or blocked.
FortiGate units are shipped with a default antivirus profile, so all you have to do to enable virus
scanning is add UTM antivirus scanning to security policies that accept connections to the Internet’
1 Go to Policy > Policy > Policy and Edit a security policy that allows access to the Internet.
2 In the UTM Security Profiles section, select AntiVirus.
3 Select OK.
All traffic accepted by this security policy will now be scanned for viruses. You can repeat these steps
for all security policies that allow access to the Internet or a high-risk network.
Results
You can test virus scanning by downloading the EICAR Anti-Malware test file from
http://www.eicar.org. If you attempt to download the icar test file using a web browser and if the
session is accepted by a security policy with virus scanning enabled, the file is blocked and a
message similar to the following should appear in your browser:
You can also test virus scanning by attaching a virus test file to an email message that you send
through the FortiGate unit to the Internet.
You can verify the virus scanning results by going to UTM Security Profiles > Monitor > AV Monitor.
The following shows the EICAR test file detected three times. Note that you will need to enable UTM
monitors first by going to System > Admin > Settings and selecting UTM Monitors in the Display
Options on GUI section.
You can drill down to display the FortiGuard Center page for the virus that was detected.
The Log and Archive Statistics dashboard widget also displays information about viruses caught
including details about the date an time on which the virus was detected, the source and destination
address of the session in which the virus was caught, and the service.
Finally, when the file is removed from the email its replaced with a message similar to the following:
Dangerous Attachment has been Removed. The file "eicar.com" has been removed because of a virus.
It was infected with the "EICAR_TEST_FILE" virus. File quarantined as:
""."http://www.fortinet.com/ve?vid=2172"
You can customize this message by going to System > Config > Replacement Message > Mail >
Virus Message. The default message specifies that the file is quarantined. If you have not
configured quarantine, you can remove this part of the message.
Internal network
Grayware
FortiGate Unit
Grayware
Solution
Enable grayware scanning in the CLI. Enter the commands:
config antivirus settings
set grayware enable
end
By enabling grayware detection, all security policies with antivirus protection will also detect
grayware. If you have configured your FortiGate unit to protect your network against viruses, enabling
grayware protection enables your FortiGate unit to scan for grayware threats as well.
Results
With grayware detection enabled, all traffic scanned for viruses is also scanned for grayware.
Grayware scanning works in parallel with antivirus scanning. To protect against grayware, ensure
the security policy allowing the traffic to be protected has an antivirus profile active in which
antivirus scanning is enabled. If traffic is not scanned for viruses, it is not scanned for grayware,
even if grayware detection is enabled.
ANTIVIRUS/
ANTISPYWARE
Internal network
Virus
FortiGate Unit
Malware
Extreme virus
database
Legacy
Virus
Spyware
Solution
Configure your FortiGate unit to use the Extreme Virus Database by entering these CLI commands.
config antivirus settings
set default-db extreme
end
In addition to the signatures of current common viruses, the Extreme Virus Database contains
signatures of all the viruses detected by the FortiGuard Antivirus Service.
If your FortiGate unit does not offer the Extreme Virus Database, select the Extended Virus Database.
The extended database contains the signatures of current common viruses and a large library of
older viruses that are no longer common.
While larger AV databases can detect more viruses, they also require more resources. For regular
virus protection, use the normal virus database. If you choose a more capable database for all AV
scanning, and your FortiGate unit frequently enters conserve mode, you may need to consider
measures to save system memory.
Only some FortiGate units support all the AV databases. Other FortiGate units offer a subset from
which you may choose. All FortiGate units have the Regular Virus Database, which includes all the
currently detected viruses on the Internet.
Results
Manually force a virus database update to ensure the database is current.
1 Go to System > Config > FortiGuard.
2 Expand AntiVirus and IPS Options.
3 Select Update Now.
Confirm that the update has occurred.
1 Go to Log & Report > Event Log > System.
2 Check the recent log entries for one that begins with Fortigate update now. This indicates a
manually triggered update.
If the log entry timestamp matches when you triggered the manual update, the virus database was
updated successfully.
If the update does not occur, ensure that you have an antivirus profile in which antivirus scanning is
enabled and selected in a security policy. If no antivirus scanning is enabled, no antivirus databases
are updated.
ANTIVIRUS/
ANTISPYWARE
Internal network
FortiGate Unit
Solution
Use the uncompsizelimit CLI command to change the maximum uncompressed file size that the
antivirus service will scan.
In this example, the antivirus service is configured to scan uncompressed files up to 15 MB in size.
config antivirus service http
set uncompsizelimit 15
end
The size limit can be set for FTP, HTTP, IM, IMAP, NNTP, POP3, and SMTP traffic. If your FortiGate
unit supports encrypted content inspection, you can also set the size limit for FTPS, HTTPS, IMAPS,
POP3S, and SMTPS traffic.
Archive files, such as ZIP and RAR, are extracted and the contents are scanned for viruses. The
total size of all the contents of an archive must be smaller than the uncompsizelimit for the archive
contents to be scanned for viruses.
The default value is 10 MB. The maximum size varies by FortiGate model. To determine the limit for
your model, enter:
config antivirus service http
set uncompsizelimit ?
The result is a brief description of the command and the acceptable range. For example:
<value> max uncompressed size to scan (1-547MB or use 0 for unlimited)
Results
The FortiGate antivirus scanner will examine any file smaller than the size limit you set. For archives,
the extracted contents must total a size smaller than the limit to be scanned.
If you increase the size limit, you may be more likely to push the FortiGate unit into conserve mode
because each simultaneous download has the potential to make a greater demand on the available
memory.
ANTIVIRUS/
ANTISPYWARE
Internal network
FortiGate Unit
Solution
Configure the protocol options to block files larger than the FortiGate is configured to cache.
This procedure applies only to proxy-based scanning. Flow-based scanning has no maximum file
size limits.
Results
If you leave the Threshold setting at 10 MB and set the Oversized File/Email action to Block, any
attempt to download a file larger than 10 MB is blocked. The FortiGate unit displays a replacement
message explaining why the attempt failed.
INTRUSION
PREVENTION
Internal network
Attacks
FortiGate Unit
Attacks
Solution
Enable flow-based antivirus scanning, web filtering, and DLP.
In addition to faster scanning, flow-based scanning can save considerable resources. Flow-based
scans examine files as they pass through while proxy-based scans require that files are cached as
they come in and examined once complete. Caching files takes more memory and system
resources.
Flow-based scanning is an ideal solution to ease the memory requirements of some UTM scans,
but it can be difficult to achieve. The problem is that if any proxy-based scan is active, files are
cached. For example, if you configure antivirus and DLP to use flow-based scanning, and leave
web filtering as a proxy-based scan, no memory is saved.
Even if your FortiGate unit is configured so that flow-based scanning does not save memory, there
is an advantage to using it. Should your FortiGate unit approach its memory or session limits, it will
enter conserve mode. Conserve mode stops all proxy-based scans on new connections until the
FortiGate unit leaves conserve mode. UTM features using flow-based scans will continue to protect
network traffic without interruption.
Flow-based scanning does not support web content filtering. If you use flow-based web filtering
and enable web content filtering, the FortiGate will use proxy-based scanning for web content
filtering and flow-based scanning for other web filtering.
Flow-based web filtering is used to filter web traffic instead of the default proxy-based scan. Files will
be checked as they flow through the FortiGate unit, rather than being buffered and examined whole.
Advantages of flow-based antivirus scanning include faster scanning, lower memory requirements,
and no file size limitation. Clients also begin receiving download file data immediately. Disadvantages
include support for fewer file archive formats and no support for web content filtering, meaning that
both flow-based and proxy-based scanning operates when web filtering is configured for flow-based
scanning and web content filtering is enabled.
WEB FILTERING
Internal network
FortiGate Unit
Solution
FortiGuard web filtering assigns web sites into nearly 100 categories. The categories are organized
into six major groups. You can configure web filter profiles to allow, block, monitor, warn, or require
authentication for categories and category groups as required by your network.
In this example, configure a web filter to block the Bandwidth Consuming category group.
1 Go to UTM Security Profiles > Web Filter > Profile and enable FortiGuard Categories.
2 Right-click the Bandwidth Consuming category group and select Block.
3 Select Apply.
Results
Users will not be able to visit web sites belonging to the categories within the Bandwidth
Consuming category group. When attempting to visit these web sites, users will be presented with a
replacement message explaining that visiting the site violates the Internet usage policy.
You can customize replacement messages by going to System > Config >
Replacement Message, selecting the feature, the replacement message to be customized, and
selecting Edit.
WEB FILTERING
Internal network
FortiGate Unit
Solution
Configure FortiGuard web filtering to use the Authenticate action rather than Block. Put the users
who need to override the restriction into a user group and specify it in the web filter profile. When a
user attempts to visit a restricted site, they will be asked for their username and password. Those in
the user group will be allowed access after providing their credentials while the others will be
blocked.
This example, allows the users Sally and Roger to override the restriction on the Potentially Liable
category group.
Password abcxyz
Password abc123
5 Select OK.
6 Go to User & Device > User > User Group and select Create New.
7 Enter a Name of Web filter override users.
8 Select Sally and Roger from the Available Users window and select the right arrow icon to move
them to the Members window.
9 Select OK.
Results
Browse to a proxy web site such as proxy.org. Before being allowed access, you are asked for a
username and password. If you provide credentials for a user in the user group applied to the web
filter profile, you are allowed access to the site. Further, once you provide a valid username and
password, you will be able to browse any sites in the category group before having to authenticate
again. If you do not have a valid username and password, you are denied access to any web site in
the category group.
This test involves proxy.org because it is classified as Proxy Avoidance, part of the Potentially
Liable category group. Any site in a classification that is part of the Potentially Liable category
group will function in exactly the same way with this configuration.
Internal network
FortiGate Unit
Solution
Configure the default web filter to block offensive search results.
1 Go to UTM Security Profiles > Web Filter > Profile.
2 Select Enable Safe Search.
3 Select Search Engine Safe Search.
4 Select Apply.
Select the default web filter in the security policy that allows Internet access.
1 Go to Policy > Policy > Policy.
2 Edit the security policy that allows Internet access.
3 In the UTM Security Profiles section, select Web Filter.
If you have multiple security policies that allow Internet access, make these same changes to each of
them.
Results
Google, Yahoo, and Bing search results will no longer contain offensive sites.
Internal network
FortiGate Unit
Solution
The FortiGuard Centre web site offers a web-based URL lookup.
1 Go to http://www.fortiguard.com/tools/url_lookup.html
2 Enter the URL in the first field. enter the displayed code in the second field and select Search.
Results
The page refreshes, listing the details of the web site entered.
The lookup may also show a classification. The classification is not used by FortiOS 5.0 firmware
and is included for those still using older firmware versions in which it is supported.
If a URL hasn’t been categorized, or if you feel the categorization is incorrect, you can submit the
URL to the FortiGuard team and suggest a category using the form on the page.
When a web site contains elements in different categories, web pages on the site are categorized
according to their contents. A web page will be assigned to only one category, but the web pages
at a single URL may not all share the same category.
WEB FILTERING
Internal network
FortiGate Unit
Solution
Use web filtering to log every site that anyone on your network visits.
1 Go to UTM Security Profiles > Web Filter > Profile to configure the default web filter profile.
2 Select FortiGuard Categories to enable.
3 Right-click on a FortiGuard category and select Monitor.
4 Select Apply.
With these changes, all allowed categories are monitored. Access to the categories is allowed, but
the monitor action also logs visits to the sites.
To use this profile, you must select it in the security policies that allow users on your network to visit
web sites.
1 Go to Policy > Policy > Policy and select the security policy that allows your users to visit web
sites.
2 Select Edit.
3 In the UTM Security Profiles section, select Web Filter.
4 Select OK.
If you have multiple security policies that allow users to visit web sites, follow these steps for each of
them.
Results
The web sites your users visit will be recorded in the UTM log. The default settings of the UTM log
page do not display the URLs. Configure the log settings to display URLs.
1 Go to Log & Report > UTM Security Log > Web Filter.
2 Right-click the column heading and select Column Settings and select Hostname.
3 Select OK.
When you view the UTM log, the hostname column will display the domain name of site, and the URL
will display the path of the file accessed on the host.
Internal network
FortiGate Unit
Solution
Use FortiGuard web filtering to block web proxies.
1 Go to UTM Security Profiles > Web Filter > Profile.
2 Select FortiGuard Categories to enable.
3 Expand the Potentially Liable category group and right-click Proxy Avoidance.
4 Select Block and select Apply.
5 Go to Policy > Policy > Policy and in the policies that allow access to the Internet.
6 In the UTM Security Profiles section, select Web Filter.
7 Select OK.
Results
After configuring the web filter to block the Proxy Avoidance category, go to the proxy.org web site. If
the web filter is configured correctly, any attempt to visit proxy.org will be blocked. Although the web
site itself is not a proxy, it maintains a large list of proxies and is, therefore, categorized as a proxy
avoidance cite.
Reporting proxy sites
If you discover a proxy that isn’t correctly categorized, go to
http://www.fortiguard.com/tools/url_lookup.html and use the URL lookup to check the assigned
category. If it is incorrect, or not categorized, submit the URL with a suggested category. The
FortiGuard web filter team will review the site categorization, usually within 24 hours.
WEB FILTERING
Internal network
FortiGate Unit
Solution
Configure FortiGuard web filter to block sites that offer streaming media.
1 Go to UTM Profiles > Web Filter> Profile.
2 Select FortiGuard Categories to enable.
3 Expand the Bandwidth Consuming Category.
4 Right-click the Streaming Media and Download and Internet Radio and TV categories and
select Block for each.
5 Select Apply.
6 Go to Policy > Policy > Policy and in the policies that allow access to the Internet.
7 In the UTM Security Profiles section, select Web Filter.
8 Select OK.
Results
After making these configuration changes, visit http://www.youtube.com. The FortiGate unit prevents
you from visiting the site so you can not view any streaming video.
Internal network
FortiGate Unit
Solution
Create a web filter profile that blocks access to those web sites you specify. In this example, users
will be blocked from visiting fortinet.com.
URL *fortinet.com
Type Wildcard
Action Block
Enable Selected
4 Select OK.
Results
In this example configuration, you can visit web sites normally but all web access to any domain
ending in fortinet.com is blocked. Visit http://fortinet.com after completing the configuration above to
see the result.
Add more list entries to Block List to block access to other web sites as required.
WEB FILTERING
Internal network
FortiGate Unit
Solution
Create a web filter profile that blocks all sites except those you explicitly allow. In this example, users
will be blocked from all sites except fortinet.com. You can do this by making a URL filter that has an
entry that blocks all sites, and entries that allow individual sites. Ensure the entry that blocks all sites
is the last entry in the URL filter list.
1 Go to UTM Security Profiles > Web Filter > URL Filter and select Create New.
2 Name the new URL filter list White List and select OK.
3 Select Create New to create a new list entry that blocks all web access.
URL *
Type Wildcard
Action Block
Enable Checked
4 Select OK.
5 Select Create New to create another new list entry that allows access to any web site with a
domain name ending in fortinet.com.
URL *fortinet.com
Type Wildcard
Action Allow
Enable Checked
6 Select OK.
The list entries are processed from top to bottom. Since the block entry is first, all sites will be
blocked regardless of any following items that allow sites. To fix this problem, move the entries
allowing access above the block entry. The entry blocking all sites should always be last.
7 Select the check box in the first column of the *fortinet.com entry.
8 Select Move To and enter these items:
Move to Before
URL *
9 Select OK.
Results
In this example configuration, you can view fortinet.com and go anywhere on the site, but all other
web sites are blocked.
URL filtering uses a black list approach. That is, all sites are allowed, except those that are blocked.
Adding an entry that blocks all sites reverses this behavior. All sites are blocked except those that
you add to the top of the list and allow access to.
WEB FILTERING
Internal network
FortiGate Unit
Solution
Configure FortiGuard web filtering to check IP addresses as well as domain names. This will prevent
users from bypassing FortiGuard web filtering by using IP addresses to access web sites.
1 Go to UTM Security Profiles > Web Filter > Profile and expand Advanced Filter.
2 Enable Rate URLs by Domain and IP Address
3 Select Apply.
Results
The FortiGate unit submits IP addresses to the FortiGuard service just as it submits domain names
when FortiGuard web filtering is enabled. If a site is part of a blocked category, the users will get the
same result whether they use the site domain name or IP address when they visit.
FortiGuard Web Filter ratings for IP addresses are not updated as quickly as ratings for URLs. This
can sometimes temporarily cause the FortiGate unit to allow access to sites that should be
blocked, or to block sites that should be allowed.
Test the configuration by blocking access to fortinet.com and then attempt to access it using the
site’s IP address.
Configure FortiGuard web filtering to block access to the Information Technology category which is
part of the General Interest - Business category group. Browse to http://www.fortinet.com/ and
confirm that you are not allowed access.
Find the web site IP address by executing this CLI command:
FG600B3908600705 # execute ping fortinet.com
The result reveals the IP address in the first line:
PING fortinet.com (66.171.121.34): 56 data bytes
64 bytes from 66.171.121.34: icmp_seq=0 ttl=45 time=92.8 ms
64 bytes from 66.171.121.34: icmp_seq=1 ttl=45 time=92.7 ms
64 bytes from 66.171.121.34: icmp_seq=2 ttl=45 time=94.7 ms
64 bytes from 66.171.121.34: icmp_seq=3 ttl=45 time=93.3 ms
64 bytes from 66.171.121.34: icmp_seq=4 ttl=45 time=93.4 ms
WEB FILTERING
Internal network
FortiGate Unit
Solution
Configure FortiGuard web filtering to check images themselves as well as domain names.
This will prevent users from bypassing FortiGuard web filtering by loading images directly. Since
images are checked on their own, an image in a blocked category will not be blocked even if part of
an allowed web site.
1 Go to UTM Security Profiles > Web Filter > Profile and expand Advanced Filter.
2 Enable Rate Images by URL (Blocked images will be replaced with blanks)
3 Select Apply.
Results
With this feature active, the FortiGate unit submits image addresses to the FortiGuard service just as
it submits site addresses when FortiGuard web filtering is enabled. If an image is part of a blocked
category, users will not be permitted to view it whether they access it directly, or as part of a site in an
allowed category. If a blocked image is part of an allowed web site, the user is able to visit the web
site, but the image is replaced by a placeholder.
WEB FILTERING
Internal network
FortiGate Unit
Solution
Configure your FortiGate unit to consider the FortiGuard web filter category of the redirect
destination, and act accordingly.
Web sites can use HTTP redirects to seamlessly move users to other web pages or web sites. By
default, the FortiGate unit does not check the FortiGuard web filter rating of the destination.
1 Go to UTM Security Profiles > Web Filter > Profile.
2 Expand Advanced Filter enable Block HTTP Redirects by Rating.
3 Select Apply.
Results
When a user is redirected, the FortiGate unit checks the category of the destination before allowing
access to the web page. If the category is blocked, the user is denied access to the web page and
presented with a replacement message.
Internal network
FortiGate Unit
Solution
Find the security policies that process the most data and add the application control sensor named
default to them. Use the application monitor to view a graph of the 10 applications using the most
bandwidth.
1 Go to Policy > Policy > Policy.
2 Right-click on the column headings and select Column Settings and add the Count column.
3 Check the Count column to find security policies that process large amounts of data.
4 Edit each of these policies, in the UTM Security Profiles section select Application Control.
If the application monitor does not show any information, verify that the security policies are
processing traffic by viewing the Count column in the policy list. If the count is increasing the policy
is processing traffic. You can also view policy usage from Policy > Monitor > Policy Monitor.
Results
Go to System > Admin > Settings, and enable UTM Monitors in the Display Options on GUI
section.
Go to UTM Security Profiles > Monitor > Application Monitor to view a graph that shows the 10
applications that are currently using the most data. The graph displays date and time on which data
collection started. You can reset the graph to restart data collection. Select Refresh to update the
data displayed by the graph.
You can drill down into any bar on the graph to display the source and destination addresses or
names of the hosts that used the application. If the user authenticated you can also display the name
of the user that used the application.
The application monitor shows the results for all traffic being monitored by application control. You
can monitor selected traffic by only adding application control monitoring to selected security
policies. You can monitor all traffic by adding application control monitoring to all security policies.
APPLICATION
CONTROL
Internal network
FortiGate Unit
Solution
Configure application control to block instant messaging:
1 Go to UTM Security Profiles > Application Control > Application Sensor.
2 Select Create New.
3 Clear the Category check box to clear all categories, then select IM.
4 Select the Action as Block, and then select OK.
5 Go to Policy > Policy > Policy and in the policies that allow access to the Internet.
6 In the UTM Security Profiles section, select Application Control.
7 Select OK.
Results
Open any recognized instant messaging client and attempt to log in to the IM service. Your attempt is
blocked. Users can run any instant messaging clients they may have installed, but the FortiGate unit
will not allow them to log in to IM services.
Users already logged in when you make this change may continue their IM session uninterrupted
because only logging in to instant messaging services is blocked.
Internal network
FortiGate Unit
Solution
Configure the default application control sensor to block access to social media web sites.
1 Go to UTM Security Profiles > Application Control > Application Sensor.
2 Select Create New.
3 Clear the Category check box to clear all categories, then select Social.Networking.
4 Select the Action as Block, and then select OK.
5 Go to Policy > Policy > Policy and in the policies that allow access to the Internet.
6 In the UTM Security Profiles section, select Application Control.
7 Select OK.
Results
Users will not be able to access social media web sites. To confirm this, open a web browser and visit
facebook.com. Instead of the Facebook web site, you are presented with a replacement message
explaining that the site is blocked.
There are many subcategories in the web category. Other combinations of selections may better
suit your needs. Choose other subcategories and view the resulting sites in the Applications
window.
APPLICATION
CONTROL
Internal network
FortiGate Unit
Solution
Configure the default application control sensor to block peer-to-peer sharing.
1 Go to UTM Security Profiles > Application Control > Application Sensor and select Create
New.
2 Clear the Category check box to clear all categories, then select P2P.
3 Select the Action as Block, and then select OK.
4 Go to Policy > Policy > Policy and in the policies that allow access to the Internet.
5 In the UTM Security Profiles section, select Application Control.
6 Select OK.
If you have multiple security policies that allow Internet access, make these same changes to each of
them.
Results
Users will not be taking advantage of P2P transfers to share files in traffic controlled by the security
policies incorporating the default application sensor.
You can view which P2P protocols are blocked from the Application List.
1 Go to UTM Security Profiles > Application Control > Application List.
2 Select Filter icon in the Category column.
3 In the Value field, enter the p2p and select Apply.
The application list displays only the items in the P2P category. These are the blocked items. the
Category heading filter is highlighted to indicate an active filter.
As applications are added to the application list by FortiGuard updates, new items in the P2P
category will be automatically included in your sensor.
Internal Network
Po
rt 1
Po
rt 2
Ex
ter
nal
FortiGate IPS
Web Server
Solution
Since web servers must be accessible, protection is not as simple as blocking access. This example
uses IPS to protect a web server by placing the web server on a separate internal network and
creating a security policy that allows web access from the Internet to the server. IPS is added to the
policy to protect the server from attacks. Since the web server is running Apache under Linux, IPS is
configured to detect and block known Apache and Linux attacks.
Severity All
Target server
OS Linux
6 Select OK.
The filter is saved and the IPS sensor page reappears. In the filter list, find the Linux Server filter
and look at the value in the Matched Signatures column. This shows how many signatures match
the current filter settings. You can select filter and select the View Rules icon to see a listing of the
included signatures.
Add the IPS sensor to the security policy that allows access from the Internet to the web server
1 Go to Policy > Policy > Policy and Edit the security policy that allows access from the Internet to
the web server.
2 In the UTM Security Profiles, section, select IPS.
3 Select the web_server IPS sensor.
4 Select OK.
Results
The web_server IPS sensor examines the web server traffic for matches to the signatures it contains.
INTRUSION
PREVENTION
Internal network
Attacks
FortiGate Unit
Attacks
Solution
Disable the IPS fail-open behavior by entering this CLI command:
config ips global
set fail-open disable
end
Results
Under normal circumstances, changing the IPS failover setting will not change how your FortiGate
unit behaves. In the unlikely event that the IPS scanner fails, however, all traffic controlled by security
policies with IPS scanning will be blocked until the IPS scanner is working again.
Traffic controlled by security policies without IPS scanning will continue to flow, regardless of the IPS
fail-over setting and the state of the IPS scanner.
Before making this change, consider whether a period without IPS protection is worse than your
users having no Internet access. Even more important is whether your web server should continue
to be accessible without IPS protection or inaccessible while the problem is fixed.
Internal network
DoS Attacks
FortiGate Unit
DoS Attacks
Solution
Create a DoS sensor, enable it in a DoS policy and adjust the threshold for your network.
Service ALL
tcp_syn_flood
Anomalies Select the Status and Logging check boxes to
enable.
3 Select OK.
The DoS policy scans incoming traffic and takes no action when the number of SYN packets exceed
the threshold, but it will log these occurrences. Run the DoS policy for a period to check the
suitability of the default threshold of 2000 SYN packets per second to your network traffic. If a traffic
peak triggers the DoS policy, increase the threshold. The idea is to set the threshold high enough that
legitimate traffic will not trigger any action, but not so high that attacks are permitted.
When you have found a threshold that fits these criteria for your network, change the tcp_syn_flood
action to Block.
Results
Once you have determined the ideal threshold for your network, normal traffic will not exceed the
threshold and it will be allowed.
When an attack occurs, the attack will be blocked but legitimate traffic is permitted. This is because
a communication session is initiated by a client sending a SYN packet. Legitimate clients send a
second SYN packet when they do not receive the expected ACK acknowledgement and are allowed.
Attackers attempt to open as many sessions as possible and will not ‘retry’ a connection attempt by
sending a second SYN packet. In this way, the FortiGate unit can distinguish between an attack and
legitimate traffic, and act accordingly.
Periodically monitor the UTM log for traffic exceeding the threshold. Over time, your web site traffic
may increase, requiring a higher threshold. Temporary traffic changes may also require a threshold
adjustment, for example, increased traffic for a commerce web site during the holiday season.
EMAIL FILTER
Internal network
FortiGate Unit
Solution
Configure the default email filter profile to detect and filter spam.
1 Go to UTM Security Profiles > Email Filter > Profile.
2 Select Enable Spam Detection and Filtering.
3 Set the Spam Action for SMTP to Tagged.
The SMTP spam action can be set to Discard, but always set the action to Tagged when creating
or editing a spam filter profile. This enables you to see the messages that the FortiGate unit
determines are spam and ensures no important messages are discarded if the profile does not
function as expected.
4 Expand FortiGuard Spam Filtering and enable IP Address Check, E-mail Checksum Check,
and URL Check.
5 Select Apply.
6 Go to Policy > Policy > Policy and in the policies that incoming email from the Internet.
7 In the UTM Security Profiles section, select Email Filter.
8 Select OK.
Results
Incoming email messages are scanned and those that the FortiGate unit determines are spam, are
tagged with the word Spam at beginning of the email messages’ subject.
Users can configure their email client software to move spam messages to their email client’s spam
or junk folder automatically, if required.
DLP
Internal network
FortiGate Unit
Solution
Configure Data Leak Prevention (DLP) to examine HTTP traffic for credit card and other numbers and
write a log message when a number is detected.
1 Go to UTM Security Profiles > Data Leak Prevention > Sensor.
2 Select Create New (plus icon in the upper-right corner of the window ).
3 Enter the sensor name of Personal-ID-HTTP.
4 Select Create New to add a filter to find American Express credit cards.
Filter Messages
5 Select Create New to add a filter to find American Social Security Numbers (SSNs).
Filter Messages
Containing SSN
6 Select Apply.
7 Go to Policy > Policy > Policy and edit the security policy that allows Internet access.
8 In the UTM Security Profiles section, select DLP Sensor.
9 Select the DLP sensor named Personal-ID-in-HTTP.
10 Select OK.
Results
To test, enter a random credit number into a web form. Check the UTM log for DLP log messages
showing that a credit card number was found.
Internal network
FortiGate Unit
Solution
Configure your FortiGate unit to scan your network for vulnerable hosts.
In this example, the local network uses the 172.20.120.0/24 subnet. The FortiGate unit internal
interface is a part on this subnet.
Configure a vulnerability scan to run at midnight on the first day of every month.
Type Range
Range 172.20.120.1-172.20.120.255
2 Select Change on the Schedule row and configure the following settings:
Recurrence Monthly
Day of Month 1
Hour 00
Minutes 00
3 Select Apply.
Vulnerability scans should always be schedule for periods of off-peak traffic. These scans can use
significant network and FortiGate resources and may impact network performance.
Results
When the scan is complete, go to User & Device > Vulnerability Scan > Vulnerability Result.
The results are broken down into four sections:
The scan start and stop time, the current scan status, and number of hosts
Summary
scanned.
Vulnerability by A chart displaying the number of vulnerabilities sorted by high, low, and info
Severity severity.
Vulnerability by A chart displaying the number of vulnerabilities by category.
Category
The table listing all of the scanned hosts. The Asset Definition used to target the
scan is listed as well as the host IP address, the OS Version, the Vulnerability
Results by host
Severity, and the number of vulnerabilities for the host. You may select the host
to view further details, including a list of the vulnerabilities.
SSL VPN
SSL is an easy to use application-level network independent method of ensuring private
communication over the Internet. Commonly used to protect the privacy of online shopping
payments, customer’s web browsers can almost transparently switch to using SSL for secure
communication without customer’s being required to do any SSL-related configuration or have any
extra SSL-related software.
SSL protection can also be applied to secure communication over the Internet between client PCs
and a remote network using SSL VPN. For basic SSL VPN functionality all a user needs to do to
access an SSL VPN is to browse to the IP address of a FortiGate unit configured for SSL VPN. The
users do not require any special SSL VPN software or configuration since SSL in the form of HTTPS
is automatically enabled by most web browsers.
The FortiGate SSL VPN configuration requires an SSL VPN web portal for SSL VPN users to log into,
the addition of a user authentication configuration to allow SSL VPN users to login and then the
creation of SSL VPN security policies that control the source and destination access of SSL VPN
users. SSL VPN security policies can also apply UTM and other security features to all SSL VPN
traffic. FortiASIC processors can accelerate SSL VPN encryption, optimizing SSL VPN performance
for a large user base.
Additional SSL VPN features are available including tunnel mode, virtual desktop for enhanced
endpoint protection, and endpoint security checks. These features are supported for SSL VPN
clients that can be downloaded automatically by SSL VPN users after logging into the SSL VPN
portal. Users can also download Fortinet SSL VPN clients to access these additional SSL VPN
features without logging into and SSL VPN portal. Fortinet supports SSL VPN clients for many PC
and mobile platforms.
This chapter includes the following SSL VPN examples:
• Setting up remote web browsing for internal sites through SSL VPN
• Using SSL VPN to provide protected Internet access for remote users
• SSL VPN split tunneling: Using SSL VPN to provide protected Internet access and access to
office servers for remote users
• Verifying that SSL VPN users have the most recent AV software before they can log into the SSL
VPN
ser
o te U in 3
Re
m og .22
er L 20
Us .20.1
172
6
.13
n1 . 120
wa 72.20
1
Fo
rtiG
ate
Un
it
er
erv 1
a il S 68.1.
Em 92.1
1
Solution
Using SSL VPN you can create a web portal, which, when the remote user connects they can view a
list of links for internal servers and web sites.
Type Subnet
Interface Internal
2 Select OK and select Create new and enter the SSL user address:
Name twhite
Type Subnet
Interface Any
3 Select OK.
Name Internal_company_sites_portal
Applications HTTP/HTTPS
Category Applications
Name Email
Type HTTP/HTTPS
Location https://mail.company.com
5 Select OK.
Password password
3 Select OK.
4 Go to User & Device > User > User Group and select Create New to add twhite to a group that
will connect to the SSL VPN:
Name Sales
Type Firewall
Group(s) Sales
Schedule always
HTTP
Service
HTTPS
6 Select OK.
Results
To verify the setup works:
1 From the Internet, browse to https://172.20.120.136:443/remote/login.
2 Login to the web portal:
Name twhite
Password password
4 From the FortiGate web-based manager go to VPN > Monitor > SSL-VPN Monitor to view the
list of users connected using SSL VPN.
You can also use the diagnose debug application sslvpn -1 command to debug this
configuration as described in “Debugging FortiGate configurations” on page 131.
ser
P NU
V in 0
SL Log .20
o te S User 2.134
m 21
Re 10.
ot
.ro ing
ssl rows
b
n1
wa .136
2 0
.1
.20 Fo
172 rtiG
ate
Un
it
Solution
Using SSL VPN and FortiClient SSL VPN software, you create a means to use the corporate
FortiGate to browse the web safely.
Password password
3 Select OK.
4 Go to User & Device > User > User Group and select Create New.
Name Tunnel
Type Firewall
Device ssl.root
The Destination IP/Mask matches the network address of the remote SSL VPN user.
3 Select OK.
Group(s) Tunnel
Schedule always
Service ALL
SSLVPN Tunnel
Incoming Interface
Interface
Schedule always
Service ALL
Action ACCEPT
Results
Using FortiClient SSLVPN application, log into the VPN using the address
https://172.20.120.136:10443/ and log in as twhite. Once connected, you can browse the Internet.
Go to VPN > Monitor > SSL-VPN Monitor to view the list of users connected using SSL VPN. The
Subsession entry indicates the split tunnel which redirects to the Internet.
From the FortiGate web-based manager, go to Policy > Monitor > Policy Monitor to view the policy
information for the SSL connection. For any web traffic, the source interface becomes ssl.root.
si t
ow o
ng
br l.ro
ss
.1 1
20 an
36
.1 w
N
12 Lo r P
.2 er e L V
20
10 Us U SS
2.
17
e
ot
34 in
s
00
H tiG
.1 g
em
ea a
Fo
.2
R
d te
r
of Un
fic it
e
16 er e
2. rv fic
19 Se Of
1
d
1.
ea
8.
H
Solution
This solution describes how to configure FortiGate SSL VPN split tunnelling using the FortiClient SSL
VPN software, available from the Fortinet Support site.
Using split tunneling, all communication from remote SSL VPN users to the head office internal
network and to the Internet uses an SSL VPN tunnel between the user’s PC and the head office
FortiGate unit. Connections to the Internet are routed back out the head office FortiGate unit to the
Internet. Replies come back into the head office FortiGate unit before being routed back through the
SSL VPN tunnel to the remote user.
Type Subnet
Interface Internal
3 Select OK.
IP Pools SSLVPN_TUNNEL_ADDR1
5 Select OK.
Password password
3 Select OK.
4 Go to User & Device > User > User Group and select Create New.
5 Add twhite to the SSL VPN user group:
Name Tunnel
Type Firewall
Device ssl.root
The Destination IP/Mask matches the network address of the remote SSL VPN user.
3 Select OK.
Group(s) Tunnel
Schedule always
Service ALL
7 Add a security policy that allows remote SSL VPN users to connect to the Internet:
Schedule always
Service ALL
Action ACCEPT
8 Select OK.
Results
Using the FortiClient SSL VPN application on the remote PC, connect to the VPN using the address
https://172.20.120.136:10443/ and log in with the twhite user account. Once connected, you can
connect to the head office server or browse to web sites on the Internet.
From the web-based manager go to VPN > Monitor > SSL-VPN Monitor to view the list of users
connected using SSL VPN. The Subsession entry indicates the split tunnel which redirects SSL VPN
sessions to the Internet.
From the web-based manager, go to Policy > Monitor > Session Monitor to view the session
information for the SSL connection. For any web traffic, the source interface becomes ssl.root.
Verifying that SSL VPN users have the most recent AV software
before they can log into the SSL VPN
Problem
Before a remote SSL VPN user logs into the network, you want to ensure they have approved
antivirus software installed on their computer. Only clients meeting the requirement can log on.
or l
tw na
k
ne ter
Fo
In
rt
iG
at
e
U
ni
t
S
er
ve
r
R VP
em N
ot us
e er
S
S
L
Solution
Use SSL VPN host checking. When the remote client attempts to log in to the network, the FortiGate
unit uses the host check information to verify that the approved antivirus software is installed on the
client computer. Configuration is performed using the CLI:
config vpn ssl web portal
edit tunnel-access
set host-check av-fw
end
Results
When a remote user connects to the SSL VPN tunnel, the FortiGate unit verifies that the approved
antivirus software is installed on the remote user’s device. If it is, the user can log in.
If the approved antivirus software is not installed, the remote user sees the following error message:
From the FortiGate web-based manager go to Log & Report > Event Log > VPN to see the tunnel
message in the Action column.
Select the log entry to view the detailed information, which indicates the user attempting to connect.
The Reason row indicates that the host check failed.
To make sure that SSL logs appear in the event log, go to Log & Report > Log Config > Log
Setting. Enable Event Logging and select VPN activity event.
IPsec VPN
IPsec VPN is a common method for enabling private communication over the Internet. IPsec
supports a similar client server architecture as SSL VPN. However, to support a client server
architecture, IPsec clients must install and configure an IPsec VPN client (such as Fortinet’s
FortiClient Endpoint Security) on their PCs or mobile devices. IPsec client configurations can be
cryptic and complex, usually making SSL VPN more convenient for users with little networking
knowledge.
IPsec VPN, however, supports more configurations than SSL VPN. A common application of IPsec
VPN is for a gateway to gateway configuration that allows users to transparently communicate
between remote networks over the Internet. When a user on one network starts a communication
session with a server on the other network, a security policy configured for IPsec VPN intercepts the
communication session and uses an associated IPsec configuration to both encrypt the session for
privacy but also transparently route the session over the Internet to the remote network. At the
remote network the encrypted communication session is intercepted and decrypted by the IPsec
gateway at the remote network and the unencrypted traffic is forwarded to the server. Responses
from the server than pass back over the encrypted tunnel to the client.
Many variations of the gateway to gateway configuration are available depending on the
requirements. In addition to gateway to gateway IPsec VPNs, FortiGate units also support various
mesh IPsec VPN configurations that can allow transparent communication between networks at
multiple locations around the world.
FortiGate units also support automated IPsec configurations of FortiClient software running on client
PCs.
All communication over IPsec VPNs is controlled by security policies. Security policies allow for full
access control and can be used to apply UTM and other features to IPsec VPN traffic.
Fortinet IPsec VPNs employs industry standard features to ensure the best security and inter-
operability with industry standard VPN solutions provided by other vendors.
This chapter includes the following IPsec VPN examples:
• Protecting communication between offices across the Internet using IPsec VPN
• Using FortiClient VPN for secure remote access to an office network
• IPsec VPN for a secure connection using an iPhone
• IPsec VPN for a secure connection using an Android device
• Using the FortiGate FortiClient VPN Wizard to set up a VPN to a private network
• Redundant OSPF routing over IPsec VPN
Q)
2
l (H 4
12
0.
rna 0/2
2
.1
2. 1
Inte 0.10.
20
17 an
w
1
10.
In
te
rn
al
IP N
se
VP
ch
ran
_B
_to Q
HQ _H
_to
nch
Bra
.2 n1
20 a
00
.1 w
20
2.
17
In
te
rn
al
)
nch
Bra
r n al ( .0/24
Inte.168.1
192
Solution
Create a gateway-to-gateway IPsec VPN between headquarters and the branch office.
This basic gateway-to-gateway IPsec VPN assumes that both office have connections to the Internet
with static IP addresses. This configuration uses a basic policy-based IPsec VPN configuration.
Name HQ_to_Branch_p1
IP Address 172.20.120.200
3 Select OK.
4 Select Create Phase 2 and configure the phase 2 configuration.
Name HQ_to_Branch_p2
Phase 1 HQ_to_Branch_p1
5 Select OK.
6 Go to Firewall Objects > Address > Address and select Create New.
7 Add a firewall address for the HQ network.
Name HQ_net
Type Subnet
Interface internal
Name Branch_net
Type Subnet
Interface wan1
10 Select OK.
12 Select the Policy Type of VPN and leave the Policy Subtype as IPsec.
Schedule always
Service ALL
14 Select OK.
Name Branch_to_HQ_p1
IP Address 172.20.120.122
3 Select OK.
4 Select Create Phase 2.
Name Branch_to_HQ_p2
Phase 1 Branch_to_HQ_p1
6 Select OK.
7 Go to Firewall Objects > Address > Address and select Create New.
8 Add a firewall address for the branch office network.
Name Branch_net
Type Subnet
Interface internal
Name HQ_net
Type Subnet
Interface wan1
11 Select OK.
13 Select the Policy Type of VPN and leave the Policy Subtype as IPsec.
Schedule always
Service ALL
15 Select OK.
Results
A user on either of the office networks should be able to connect to any address on the other office
network transparently. For example, from a PC on the branch office with IP address 192.168.1.100
you should be able to ping a device on the HQ network with the IP address 10.10.10.100.
When the VPN is operating you should be able to go to VPN > Monitor > IPsec Monitor and verify
that its status is up.
l
rna k
Inte twor
ne
l .1
rna 8.1
inte 92.16
1
6
0 .14
n1 .12
Offi wa 72.20
ce 1
For
tiG
ate
I
wit Psec
h X VP
Au N
th
ser
t U ress
i C lien add
ort ic IP
te F am
mo yn
Re ith D
w
Solution
Create an IPsec VPN between FortiClient on the remote user’s PC and the office FortiGate unit that
uses XAuth to authenticate the remote user. The remote user’s IP address changes so you need to
configure a dialup IPsec VPN on the FortiGate unit. As well the remote user must start the VPN
because the office FortiGate unit doesn’t know the user’s IP address.
Password passw0rd
3 Go to User & Device > User > User Group and select Create New.
Name FortiClient_group
Type Firewall
Creating the IPsec VPN phase 1 and phase 2 and a DHCP server for the IPsec VPN
1 Go to VPN > IPsec > Auto Key (IKE) and select Create Phase 1.
2 Configure Phase 1.
FClient_VPN
Name
(the name must be under 16 characters)
3 Select Advanced.
4 Select Enable IPsec Interface Mode and configure the following:
IKE Version 1
DH Group 5
Keylife 28800
Keepalive Frequency 10
5 Select OK.
Go to System > Network > Interface and verify that a tunnel interface named FortiClient_VPN
has been added under the wan1 interface.
Edit the FortiClient_VPN tunnel interface and verify that the IP and Remote IP are both 0.0.0.0.
These IPs must be set to 0.0.0.0 for the DHCP server to supply IP addresses to the remote users.
6 Go to System > Network > DHCP server and select Create New.
7 Add a DHCP server for the IPsec VPN
Mode Server
Enable Select
Type IPsec
IP 10.254.254.1 - 10.254.254.254
8 Select OK.
9 Go to VPN > IPsec > Auto Key (IKE) and select Create Phase 2.
10 Configure the phase 2 for the IPsec VPN.
Name FortiClient_VPN2
Phase 1 FortiClient_VPN
DH Group 5
DHCP-IPsec Enable
If DHCP-IPsec does not appear, there is no valid DHCP server attached to the FortiClient _VPN
tunnel interface. If there are static IP addresses assigned to the FortiClient_VPN tunnel interface IP
and Remote IP, delete the Phase1 entry and start again. The DHCP server will not work if static IPs
are assigned to the FortiClient_VPN tunnel interface.
Creating a static route and security policies for the IPsec VPN configuration
The static route ensures that traffic for the VPN does not leave the FortiGate unit for the default
gateway. When you select the VPN interface as the Device, there is no requirement for a gateway, as
shown by it being greyed out.
1 Go to Router > Static > Static Route and select Create New.
2 For desktop FortiGate units, go to System > Network > Routing and select Create New.
3 Add a static route for the IPsec VPN.
Device FortiClient_VPN
4 Select OK.
5 Go to Policy > Policy > Policy and select Create New.
6 Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
Schedule always
Service ALL
Action ACCEPT
8 Select OK.
Configure FortiClient
These instructions were tested on FortiClient 5.0.
1 On the remote computer, start the FortiClient console.
2 Go to Remote Access.
3 On Mac OS, select the gear icon and select Add a new connection.
On Windows, select Configure VPN.
4 Enter the following.
5 Select OK.
Results
You know your VPN is successful when you select the VPN on FortiClient, select Connection, and
receive a “Connection Successful!” message. In FortiClient, the status next to the VPN connection
will appear as Up, with the number of seconds it has been up, next to it.
iPhone
N
VP
c
se
IP
exa
mp
le.c
om
w an1
inte
rna
l
tw e
k
ne ffic
or
O
Solution
The easiest way to connect to the office from a remote location is by an IPsec VPN connection. It is
secure, and to the user, it appears as if they are on the network at work. The iPhone IPsec client is a
Cisco UNITY client.
In this example, user fsmith is part of the iPhoneVPN usergroup. F. Smith’s iPhone will be assigned an
IP address in the range 172.16.1.1 - 172.16.1.254. The VPN is interface based.
You already have three security policies to allow traffic to flow on your network; Internal to Wan1,
Internal to dmz, and dmz to Internal.
This example uses an Apple iPhone 4 running iOS 5.1. Menu options may vary for different models
and iOS versions.
• Configure iPhone VPN Phase 1 access to the DMZ subnet in the CLI.
• Configure an IPsec security policy between the iPhoneVPNUsers and DMZ_WebServer.
• Configure the iPhone VPN settings.
Password my1pwd
3 Select OK.
4 Go to User & Device > User > User Group and select Create New.
5 Create a user group for iPhone users.
Name iPhoneVPN
Type Firewall
6 Select OK.
Create a firewall addresses for the web server on DMZ and iPhone Users
1 Go to Firewall Objects > Address > Address and select Create New.
2 Enter the following information.
Name DMZ_WebServer
Type Subnet
Interface dmz
Name iPhoneVPNUsers
Type Subnet
Interface Any
5 Select OK.
Name iPhone
Mode Main
IKE Version 1
DH Group 2
4 Select OK.
Name iPhone_P2
Phase1 iPhone
DH Group 2
4 Select OK.
Schedule Always
Service ALL
Action ACCEPT
4 Select OK.
5 Move this policy to the top of the policy list, to ensure it will be matched first.
Description Office_VPN
Account fsmith
Password my1pwd
Secret mykey123
4 Select Save.
Results
To test the configuration, on the iPhone:
1 Ensure the iPhone has access to a data network.
2 Go to Settings > General > Network > VPN.
3 Select the Office_VPN, and set VPN to ON.
When iPhone connects, a VPN icon appears next to the battery power indicator.
On the FortiGate unit you can see the connection attempt and completion by going to Log & Report
> Event Log > VPN.
When your VPN connection is established on your iPhone there will be a small VPN tag at the top of
the screen. However, this is easily missed. If you want a clear message that your VPN connection is
up and working on the iPhone, then enter the following CLI command on the FortiGate unit:
config vpn ipsec phase1-interface
edit iPhone
set banner “YOU ARE NOW CONNECTED”
next
end
This creates a pop-up banner message that is displayed on your iPhone when the VPN connection
is successful.
Android device
N
VP
ec
IPs
exa
mp
le.
wa com
n1
dm
z
ers
serv
ce
Offi
Solution
The easiest way to connect to the office from a remote location is by VPN. It is secure and it appears
as if you are physically on the network at the office. To connect over an IPsec VPN connection with
an Android device, you need to use L2TP.
In this example, user wloman is part of the Android_Users user group. The Android mobile device will
be assigned an IP address in the range 192.168.1.90 - 192.168.1.99. This is a VPN policy; not
interface based.
For this example an LG P999 mobile phone running Android 2.2.2 was used. Menu options may
vary for different models or versions of the Android OS.
Name wloman
Password my1pass
3 Select OK.
4 Go to User & Device > User > User Group select Create New.
5 Create a user group for Android users.
Name Android_users
Type Firewall
6 Select OK.
Name Android_Users
Type IP Range
Interface wan1
Name DMZ_Server
Type Subnet
Interface dmz
5 Select OK.
Name AndroidVPN
Mode Main
1 - Encryption AES256
1 - Authentication MD5
2 - Encryption 3DES
2 - Authentication SHA1
DH Group 2
4 Select OK.
5 Configure IPsec tunnel Phase2 in the CLI.
config vpn ipsec phase2
edit AndroidVPN2
set phase1name AndroidVPN
set proposal aes256-md5 3des-sha1
set replay enable
set pfs disable
set keylifeseconds 3600
set encapsulation transport-mode
end
4 Select OK.
5 Move the policy to the top of your policy list to ensure it is matched first.
Results
To test the configuration:
1 Ensure the Android device has access to a data network.
2 Select the Office_DMZ_servers VPN.
When the VPN connects, you will have access to the office servers as expected.
l
rna k
Inte twor
ne
l .1
rna 8.1
inte 92.16
1
6
0 .14
n1 .12
Offi wa 72.20
ce 1
For
tiG
ate
I
wit Psec
h X VP
Au N
th
ser
t U ress
i C lien add
t
or ic I P
te F am
mo yn
Re ith D
w
Solution
Use the FortiClient VPN Wizard, which provides and easy way to setup a VPN with your FortiClient
software. The wizard and FortiClient connect take care of encryption, authentication and related
options.
In this example, user sgreen is part of the Wizard_Users usergroup. Once the VPN tunnel is up,
sgreen’s FortiClient Connect will be assigned an IP address in the range 192.168.1.90 - 192.168.1.99.
The VPN is a VPN route is interface based.
The FortiClient VPN Wizard configuration here was tested with FortiClient 5.0.
On the FortiGate unit, the VPN is on the wan1 interface, the public facing interface with a domain of
example.com. The office network is on the FortiGate internal interface.
The FortiGate unit’s public facing interface, wan1 here, must have a public IP address, a public
domain name, or a domain name resolved by dynamic DNS. This example uses the domain name
example.com for the FortiGate unit gateway information.
Password my1pwd
3 Select OK.
4 Go to User & Device > User > User Group and select Create New.
5 Create a user group for the remote users.
Name Wizard_users
Type Firewall
6 Select OK.
Name Wizard_Range
Type IP Range
Interface Any
Name Internal_Range
Type IP Range
Interface Any
5 Select OK.
Name Wiz
Name Wiz2
Phase1 Wiz
Schedule always
Service ALL
Action ACCEPT
4 Select OK and move the policy to the proper location in the policy list.
5 Select OK.
Results
To test the configuration, select the Wizard VPN configuration in FortiClient Connect and select
Connect. When connected, the status will appear as UP.
FortiGate 1
rt3
po .1.1 .1.1
20 rt1
10. po 72.16
1
rt1 .1.2
rt2 po 72.16
po .1.1 1 FortiGate 2
168
192. rt2
po .1.2
8
.16
192 rt3
po .1.1
21
10.
Solution
On each FortiGate unit, configure the redundant OSFP network and distance and the redundant
IPsec VPN setup. These steps assume that all FortiGate interfaces have been connected and
configured for their networks.
Name primary_tunnel
IP Address 172.16.1.2
Name P2_primary_tunnel
Phase 1 primary_tunnel
7 Select OK.
8 Select Create Phase 1 to configure the second tunnel:
Name second_tunnel
IP Address 192.168.1.2
Name P2_secondary_tunnel
Phase 1 second_tunnel
13 Select OK.
IP 10.1.1.1
Remote IP 10.1.1.2
4 Select OK.
5 For port2, select the arrow to expand the list.
6 Select second_tunnel and select Edit and complete the following:
IP 10.2.1.1
Remote IP 10.2.1.2
7 Select OK.
Name primary_tunnel
Interface primary_tunnel
Cost 10
Name second_tunnel
Interface second_tunnel
Cost 100
8 Select OK.
Name primary_tunnel
IP Address 172.16.1.1
Name P2_primary_tunnel
Phase 1 primary_tunnel
7 Select OK.
8 Select Create Phase 1 to configure the second tunnel:
Name second_tunnel
IP Address 192.168.1.1
11 Select OK.
12 Select Create Phase 2 and enter the following and select OK:
Name P2_second_tunnel
Phase 1 second_tunnel
13 Select OK.
IP 10.1.1.2
Remote IP 10.1.1.1
5 Select OK.
6 For port2, select the arrow to expand the list.
7 Select second_tunnel and select Edit.
8 Complete the following:
IP4 10.2.1.2
Remote IP 10.2.1.1
9 Select OK.
Name primary_tunnel
Interface primary_tunnel
Cost 10
7 Select OK.
8 Select Create New and complete the following:
Name second_tunnel
Interface second_tunnel
Cost 100
9 Select OK.
Results
The VPN network between the two OSPF networks will use the primary VPN connection. In the event
that the VPN tunnel goes down, the secondary tunnel will be used automatically.
Use the CLI commands to view the status and traffic on the network:
get router info ospf neighbor
get router info routing-table ospf
Authentication
Identifying users and other computers (authentication) is a key part of network security. This chapter
describes some basic elements and concepts of authentication.
Businesses need to authenticate people who have access to company resources. In the physical
world this may be a swipe card to enter the building, or a code to enter a locked door. If a person has
this swipe card or code, they have been authenticated as someone allowed in that building or room.
Authentication is the act of confirming the identity of a person or other entity. In the context of a
private computer network, the identities of users or host computers must be established to ensure
that only authorized parties can access the network. The FortiGate unit enables controlled network
access and applies authentication to users of security policies and VPN clients.
This chapter includes the following authentication examples:
• Creating a security policy to identify users
• Identify users and restrict access to websites by category
• Creating a security policy to identify users, restrict access to certain websites, and control use of
applications
• Configuring FSSO for single sign-on user access in a Windows AD environment
• Stopping the “Connection is untrusted” message
Solution
Enable FortiGate user authentication by creating a user group named Sales and adding a user named
wloman to this group. Then add an identity based policy to a security policy that accepts
connections from the internal network to the Internet. Add the Sales user group to the identity based
policy. Test the configuration by authenticating with the FortiGate unit and viewing the information
displayed in the user monitor.
This solution describes adding a user to the FortiGate local user database. FortiOS user
authentication can also integrate with LDAP, RADIUS, or TACAS+ servers, Windows NTLM, Fortinet
single sign on (FSSO), and PKI solutions.
1 Go to User & Device > User > User Group and select Create New.
2 Add a user group:
Name Sales
Type Firewall
3 Select OK.
4 Go to User & Device > User > User Definition and select Create New.
Name wloman
Password password
6 Select OK.
7 Go to Policy > Policy > Policy and select Create New.
8 Leave the Policy Type as Firewall and select the Policy Subtype as User Identity.
9 Complete the policy:
Group(s) Sales
Schedule always
Service ALL
Action ACCEPT
12 Select OK.
Results
From a web browser on the internal network, attempt to access the Internet. If the session is
accepted by the policy that you added the identity based policy to, you will be prompted for a user
name and password. Enter wloman and password. If authentication is successful you will be able to
browse the Internet.
You can customize the authentication page that users see by going to System > Config >
Replacement Message > Authentication > Login page.
Form the FortiGate web-based manager go to User & Device > Monitor > Firewall to view the list of
authenticated firewall users. An entry similar to the following should appear,
If you select De-authenticate All Users or if you select the De-authenticate user icon for wloman,
you will have to authenticate with the firewall again to continue browsing the Internet.
You can also go to Log & Report > Event Log > User to view log messages recorded when the
users authenticated.
WEB FILTERING
Solution
Block access to shopping and auction websites by adding a web filter profile named Sales_web_filter
that blocks shopping and auction websites. Enable web filtering for the identity based policy created
in “Creating a security policy to identify users” on page 351 and add the Sales_web_filter profile to it.
Test the configuration by authenticating and then attempting to browse to an online shopping web
site.
This example requires the FortiGate unit to have a valid FortiGuard Web Filtering license.
1 Go to UTM Security Profiles > Web Filter > Profile and select Create New (plus icon in the
upper-right corner of the window).
2 Add a new web filter profile group named Sales_web_filter.
3 Select FortiGuard Categories to enable.
4 Locate the General Interest - Personal > Shopping and Auction category.
5 Right-click the category and select Block.
6 Select OK.
7 Go to Policy > Policy > Policy and select Create New.
8 Leave the Policy Type as Firewall and select the Policy Subtype as User Identity.
Group(s) Sales
Schedule always
Service ALL
Action ACCEPT
12 In the UTM Security Profiles section, select Web Filter and select the Sales_web_filter profile.
13 Select OK.
Results
Go to User > Monitor > Firewall and deauthenticate the wloman user. From a web browser on the
internal network, attempt to access the Internet. If the session is accepted by the identity based
policy you will be prompted for a user name and password. Enter wloman and password. If
authentication is successful you can browse the Internet.
Attempt to access an online shopping or auction website. FortiGuard Web Filtering web page
blocked message appears, blocking access to the website.
If you attempt to access an online shopping page before authenticating, the FortiGate unit would
ask you to authenticate. After authenticating the FortiGuard web page blocked message appears.
You can customize the FortiGuard web filtering page that appears by going to System > Config >
Replacement Message > FortiGuard Web Filtering > URL block message.
Go to UTM Profiles > Monitor > Web Monitor to view graphs of FortiGuard Web Filtering activity.
The graphs should show the Shopping and Auction category has been blocked.
To view the web monitor, you need to enable UTM monitors by going to System > Admin >
Settings and enabling UTM Monitors in the Display Options on GUI section.
W ai 86 0
do
In c 4 .13
do o r2 1
m ad .10
w ntr
n
s o
AD l e
10
.1
.1
.1 10
00
10 ort
.1
p
In
t
er
na
ln
et
w
1
or
0.
k
0
.2
2. 9
17 ort
16
p
FortiGate U
Unit
nit
Solution
Configure the FortiGate unit to obtain logon information about Windows AD users from the Windows
AD domain controller. This information includes each user’s Windows AD user group. Create an
identity-based policy to grant access only to users belonging to specific groups.
The FortiGate unit obtains logon information about Windows AD users from the FSSO Collector
Agent.
Name AD-server
Password forti123
3 Select Apply & Refresh to obtain the user group information from the Windows AD server using
the Fortinet Single Sign On (FSSO) agent.
4 Select OK.
Name AD
Type Fortinet Single-Sign-On (FSSO)
Add AD864R2/GROUP1, AD864R2/GROUP2,
Members AD864R2/GROUP3, and AD864R2/GROUP4
from the Available Members list.
3 Select OK.
Group(s) AD
Schedule always
Service ALL
Action ACCEPT
6 Select OK.
Results
Windows AD users in the selected Windows AD user groups who have already logged into the
Windows AD network can access the Internet without being asked by the FortiGate unit to enter their
logon credentials again.
r
to
it ica
un nt
l
na
e
th
r
te
Au
in
rti
po
In
Fo
te
rt3
rn
al
ne
t
w
or
k
FortiGate
FortiG
Gate Unit
Solution
Set up a FortiAuthenticator unit as a RADIUS server that multiple FortiGate units can use for
authentication.
On the FortiAuthenticator unit, you need to create a user account for each employee. Register each
FortiGate unit on the FortiAuthenticator unit as a Network Access Server (NAS) so that it can request
user authentication.
Username wloman
Password my_secure_pwd
Name FortiGate1
hardtoguess
Secret
You will also enter this Secret on the FortiGate unit.
Name facRADIUS
hardtoguess
Primary Server Secret This is the same Secret that you entered on the
FortiAuthenticator unit.
2 Go to User & Device > User > User Group and select Create New.
3 Create a user group with facRADIUS as its only member:
Name fac-user-grp
Type Firewall
5 Select OK.
Group(s) fac-user-grp
Schedule always
Service ALL
Action ACCEPT
6 Select OK.
Results
On your a computer connected to the internal network, attempt to connect to a web site on the
Internet. You will be asked for your user name and password. After entering valid credentials, you will
have access to the Internet.
CERTIFICATE
Solution
When you see a “Connection is untrusted” type message, it means there is a problem with the
certificate for the website you are connecting to.
Anytime you browse a website, you are using either HTTP or HTTPS. The difference between them is
that HTTPS has security. This security is in the form of certificates that identify the source as being
legitimate. Without a valid certificate, the customer does not know if it is really the true website, or if a
hacker hijacked their connection with malicious intent.
With FortiGate units, this message occurs for two reasons — because the default certificate used by
the FortiGate unit is a self-signed certificate, and because the certificate is valid only for the FortiGate
unit. To be trusted, a certificate must be signed by a known certificate authority (CA) that the web
browser can verify. For example if Fred’s certificate is signed by Bob, and Bob’s certificate is signed
by Peter, then anytime someone check’s Fred’s certificate they must be able to trace it back to Peter
and verify that Peter is trustworthy. Any break in that chain, and Fred’s certificate is seen as
untrustworthy.
Contact your ISP or other online services provider to get a trusted intermediate CA certificate for your
FortiGate unit. When you are giving them the information, make sure it is clear where you will be
using this certificate: on an internal network, a public facing website, or across your enterprise.
Ensure it is a CA certificate as this allows you to sign certificates for local users for applications such
as VPN.
Generally online services providers include a form for you to fill out to create your certificate when
you are paying for it on their website. However another common method is to generate a certificate
signing request (CSR) with an application like openssl. This is a request that is sent to the certificate
authority providing you with your certificate. They process the request, usually automatically, and
return a certificate to the email address provided based on the information in the CSR.
The certificate from the CA is a text file that contains the information you included in the CSR as well
as details about the CA who issued the certificate, when it was issued and when it expires, and the
“fingerprints” or encryption associated with it.
To install a CA certificate from your computer to the FortiGate unit you go to System > Certificates >
CA Certificates and select Import. After you browse to the certificate file, which is usually a .cer or
.p12 format text file, and select it will be installed on your FortiGate unit. You can verify this by
refreshing the display to see the new certificate. It will be displayed by name and subject, and you
can select it for more in-depth details if you need to verify it.
Now when you are using HTTPS or other SSL connection, your FortiGate unit will not generate
“untrusted” certificate-based error messages.
I
172ntern
.16 al ne
.12 tw
0.1 ork t
0-1 uni 01
00
i Gate 120.2
t .
For 72.16
1
172 FortiA
.16 nal
.12 yze
0.1 r u
54 nit
Solution
Find out what these log messages mean by understanding each part of the log message.
The parts of the log message contain specific information. You can look at log messages as puzzles
— each piece of the log message is a piece of a puzzle, and when those pieces are put together, they
show the whole picture. Log messages provide valuable insight into how to better protect the
network traffic against attacks, misuse and abuse.
1 Go to Log & Report > UTM Log.
The application control log messages appear on the page. Even though you can view the
individual fields from the log viewer table, not all log fields are visible. You should always
download a log file so that you can clearly see all log fields. A text editor, such as jEdit, can help
to better display the log messages when viewing them from your computer.
4 Since these log messages are the same, pick one and break it into the two groups that make up a
log message: the log header and log body. The first group is what will be looked at first, the log
header.
2011-08-17 13:40:20 log_id=28704 type=app-ctrl subtype=app-ctrl-all pri=information vd=root
The year, month and day of when the event occurred in yyyy-
date=2011-08-17
mm-dd format.
The severity level of the event. In this log message, this means
pri=information
that there is general system information.
Now we know the first part of the what the log message is saying — an application control event
occurred on August 17, 2011 at 1:40 pm and this is just general system information.
Next, understanding the rest of the log message from the log body.
5 The log body contains the following information:
attack_id=15893 src="10.10.20.3" src_port=52315 src_int="internal" dst="67.69.176.57"
dst_port=80 dst_int="wan1" src_name="10.10.20.3" dst_name="67.69.176.57" proto=6
service="http" policyid=1 serial=20596 app_list="default" app_type="web"
app="HTTP.BROWSER" action="pass" count=1 msg="web: HTTP.BROWSER"
From the log body, we now know the traffic that was flowing through wan1 (the external interface
on the FortiGate unit) was scanned by the FortiGate unit using the security policy 1, which had
the default application control profile applied to it. From those rules, the FortiGate unit matched
the traffic. The user (internal=10.10.20.3) was accessing the Internet and was using the
application HTTP.BROWSER.
Knowing the application was HTTP.BROWSER, we can lookup exactly what this application is by
going to the FortiGuard Center.
6 In the web-based manager, go to UTM Profiles > Application Control > Application List.
7 In the search field, enter HTTP.BROWSER; when it appears in the list on the page, select its
name.
You are automatically redirected to the FortiGuard Center page that contains all the information
you need to know about the application, HTTP.BROWSER.
8 The description for this log message on the FortiGuard Center page says this application only has
a medium risk, and indicates that an HTTP client request attempted to contact with a HTTP
server, which usually listens on port 80. This is not an attack or an exploit.
You can use the FortiGate Log Message Reference to understand log messages. It contains an
explanation of each log field for each log message.
om
t fr to
g sen unit r
ein at e rve
s b rtiG g se
Loghe Fo Syslo
t he
t
rver
Se
log
Inte Sys
rna
lN
etw
ork
ate
tiG
e For nit
t h r u
om ze
t fr naly
g sen ortiA
For ein e F
tiA
nal s b o th
yze Log unit t
ru
nit
Solution
Configure the FortiAnayzer and Syslog server first, and then configure the FortiGate unit to send logs
to both log devices.
The FortiAnalyzer unit, a Fortinet logging device, can help you provide another storage location for
storing logs. The FortiAnalyzer unit can log all FortiGate activity that is available for logging, and
generating reports on those logs.
The following steps begin immediately after you have set up the FortiAnalyzer unit on your network.
Before configuring the FortiGate unit, ensure both the FortiGate unit and the FortiAnalyzer unit have
the same firmware version and maintenance release. If both do not have the same firmware version
and maintenance release, issues may arise, such as being unable to send logs to the FortiAnalyzer
unit.
1 Update your third party Syslog server software, and verify that it is up and running properly.
2 On the FortiGate unit, use the CLI command execute ping to ping the FortiAnalyzer unit and
the Syslog server.
If there is 100 percent packet loss, troubleshoot the networking problem before proceeding.
3 On the FortiGate unit, go to Log & Report > Log Config > Log Setting.
8 Test the connection between the FortiGate unit and FortiAnalyzer unit. On the FortiGate unit go to
Log & Report > Log Config > Log Setting, and select Test Connectivity.
By selecting Test Connectivity, you can see if there are any issues with the settings. For example,
if Connection Status in the FortiAnalyzer Connection Summary window shows Logs not
received, there is an issue with sending the logs to the FortiAnalyzer unit. You can troubleshoot
the problem by checking the FortiGate and FortiAnalyzer configurations and verifying that
network connections between the two devices are possible. If the Connection Status has a
green checkmark, you are able to successfully log to the first FortiAnalyzer.
Remember to enable logging options to ensure logs are recorded. By default, the FortiGate unit
enables all SQL logs. You must enable UTM as well if you want to log UTM features.
Results
On the FortiAnalyzer unit, you should now see logs appearing You should also be seeing logs appear
on the Syslog server. If you are not seeing any logs on the FortiAnalyzer unit, verify that the device
has been included in the Devices menu list. Check with the FortiAnalyzer documentation to help
troubleshoot any FortiAnalyzer problems that appear.
There is no command to verify the FortiGate unit’s connection with the Syslog server. If you are
having issues between the Syslog server and FortiGate unit, you should verify that you can ping to
the Syslog server through your FortiGate unit.
You should test that logs can be sent to a FortiAnalyzer unit. By testing the connection, you can
resolve any issues that may occur. To test that the FortiGate unit can send logs to the FortiAnalyzer
unit, use the diag log test to generate logs and view them from the FortiAnalyzer unit to verify
that they were sent.
diag log test
For
tiG
ate
uni r
t use
PN
LV
SS
in
dm
ork a
Netw
Solution
Create an alert email to notify you that an SSL VPN login failure occurred.
The following assumes that you have already set up logging and that event logging has been
enabled. When entering the email addresses for the alert email configuration, you need to enter two
email addresses. The first email address is for the sender of the alert email and the second is for
receiver of the alert email. The sender can be any email address that helps to identify that the email
has been sent from the FortiGate unit. In this solution, we use fortigate@example.com to help identify
that the alert email is sent by the FortiGate unit. The email that you receive is your email address, and
in this solution it is referred to as myemail@example.com
1 Go to Log & Report > Log Config > Log Setting.
2 Under Event Logging, only enable VPN activity event.
3 Select Apply.
4 Go to Log & Report > Log Config > Alert E-mail and configure the following:
Email to myemail@example.com
5 In the Send alert email for the following, select SSL VPN login failure.
6 Select Apply.
7 Go to System > Config > Messaging Servers.
8 Enter the SMTP Server address of mail.example.com.
9 Select Apply.
Results
When an SSL VPN user attempts to authenticate using the SSL VPN tunnel, and they are
unsuccessful, this event is logged by the FortiGate unit and you receive an alert email in your inbox.
The body of the email contains the event log message.
If a user unsuccessfully attempts to log in to the SSL VPN, an alert email message is sent to the
defined mailbox with the subject line “Message meets Alert condition”. The email will be similar to the
following:
I
172ntern
.16 al ne
.12 tw
0.1 ork t
0-1 uni 01
00
i Gate 120.2
t .
For 72.16
1
172 FortiA
.16 nal
.12 yze
0.1 r u
54 nit
Solution
Test the configuration by using Test Connectivity, as well as the diag log test command. Testing
connections between a FortiGate unit and a WebTrends server or Syslog server are not available.
Testing between the FortiGuard Analysis server and the FortiGate unit is also supported.
The test involves using both the CLI and web-based manager.
Go to Log & Report > Log Config > Log Setting and select Test Connectivity.
The FortiAnalyzer Connection Summary window appears. You should have all green check marks for
the Privileges and Connection Status. If there is a caution icon with the words Logs not received
in Connection Status, you will need to troubleshoot the issue. You may have to troubleshoot both
the FortiGate unit and the FortiAnalyzer unit.
To test the connection other than using the web-based manager, in the CLI use diag log test
command. The following output appears:
generating a system event message with level – warning
generating an infected virus message with level – warning
generating a blocked virus message with level – warning
generating a URL block message with level – warning
generating a DLP message with level – warning
generating an attack detection message with level – warning
generating an application control IM message with level – information
generating an antispam message with level – notification
generating an allowed traffic message with level – notice
generating a wanopt traffic log message with level – notification
generating a HA event message with level – warning
generating netscan log messages with level – notice
generating a VOIP event message with level – information
generating authentication event messages
To verify the number of logs sent, failed, dropped or buffered to the FortiAnalyzer unit, use the diag
fortianalyzer-log mgstats show command.
Index
A bandwidth consuming
web filtering, 265
access point, 138 Bing
Active Directory, 170, 357 safe search, 269
admin bridge table, 28
idle timeout, 112
trusted location, 111 C
admin profile
custom, 106 CA Authority, 170
super_admin, 36 caching
administrative port web, 84
port captive portal
administrative, 112 WiFi, 157
administrator capture
creating, 36, 106 packet, 121
administrator profile central NAT table, 232
custom, 106 certification, 10
alert email, 373 Cisco UNITY client, 327
alert notification email for SSL VPN login failures, 373 cloak HTTP headers, 113
antivirus cluster, 86
changing the maximum file size, 260 connecting an HA cluster, 88
flow-based, 264 configuration
software, 313 backup, 30, 92
application control, 283 connecting a FortiGate HA cluster, 88
adding a sensor to a policy, 283 count, 192
blocking access to social media, 286 policy, 192
blocking instant messaging, 285 security policy, 283
blocking peer to peer file sharing, 287 customer service, 10
troubleshooting, 283
application monitor, 283, 284 D
drill down, 284
applications Data Leak Prevention, 295
debug
bandwidth use, 265, 283, 286, 287, 316, 321, 327, 333, application, 135
338, 363, 366, 371
debugging, 135 authentication, 133
diagnose command, 131
visualizing, 283 flow, 135, 191, 195
ARP
packet sniffer, 128 info, 136
IPsec VPN, 134
assigning IP addresses, 116 packet flow, 134
authenticate
web filtering, 268 SSL VPN, 132
URL filtering, 134
authentication debugging FortiGate configurations, 131
debugging, 133
authoritative dns, 114 default route failover, 46, 53
demilitarized zone
network, 57
B denial of service
backup protection, 292
configuration, 30, 92 deny policy
backup Internet connection, 41, 49 count column, 199
backup log solution, 371 verifying, 196
bandwidth destination NAT, 236, 239, 242, 245, 249
application use, 265, 283, 286, 287, 316, 321, 327, 333, DHCP, 16
338, 363, 366, 371 IP reservation, 116
whitelist wireless
web filter, 277 WPA/WPA2 enterprise security, 147
WiFi WPA2 security, 139
captive portal, 157 WPA/WPA2 enterprise security
DHCP relay, 166 wireless security, 147
RADIUS, 152 WPA2
software switch, 162 wireless security, 139
WiFi access, 139, 142, 147, 166 WPA2-Personal, 142, 166
WiFi access point, 138 WPA-Enterprise, 170
WiFi Controller, 141
WiFi controller feature, 138 Y
Windows AD, 170, 357
Windows Security Health Validator, 173 Yahoo
Windows Server 2008, 170, 357 safe search, 269
youtube, 181