Fortigate Cookbook 504 PDF
Fortigate Cookbook 504 PDF
4
Essential Recipes for Success with your FortiGate
14 August 2013
Revision 1
Copyright© 2013 Fortinet, Inc. All rights reserved. Fortinet®, FortiGate®, and FortiGuard®, 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:
Please report errors or omissions in this or any Fortinet technical document to techdoc@fortinet.com.
Contents
Introduction................................................................................................................... 1
Setup............................................................................................................................. 3
Security Features........................................................................................................ 79
Providing remote users access to the corporate network and Internet.......................... 132
Authentication........................................................................................................... 139
Contents iii
Introduction
The FortiGate Cookbook provides examples, or recipes, of basic and advanced
FortiGate configurations to administrators who are unfamiliar with the unit. All
examples require access to the graphical user interface (GUI), also known as the
web-based manager.
Each example begins with a description of the desired configuration, followed by
step-by-step instructions. Some topics include extra help sections, containing tips
for dealing with some common challenges of using a FortiGate unit.
Using the FortiGate Cookbook, you can go from idea to execution in simple steps,
configuring a secure network for better productivity with reduced risk.
This version of the FortiGate Cookbook was written using FortiOS 5.0.4.
1
Setup
The FortiGate unit provides protection for a variety of different network functions
and configurations. This section contains information about the basic setup for
common network functions as well as different roles that a FortiGate unit can have
within your network.
This section contains the following examples:
3
Setting up FortiGuard services
If you have purchased FortiGuard services and registered your FortiGate unit, the
FortiGate should automatically connect to a FortiGuard Distribution Network (FDN)
and display license information about your FortiGuard services. In this example, you
will verify whether the FortiGate unit is communicating with the FDN by checking
the License Information dashboard widget.
Internet
FortiGuard
FortiGate
Internal Network
Also, determine if the default port used for FortiGuard traffic, port 53, is being blocked, either
by a device on your network or by your ISP. If you cannot unblock the port, change it by
going to System > Config > FortiGuard and selecting the service(s) where communication
errors are occurring. Under Port Selection, select Use Alternate Port.
In effort to avoid port blocking, You can configure your FortiGate unit to use higher-
numbered ports, such as 2048-20000, using the following CLI command:
config system global
set ip-src-port-range 2048-20000
end
Trial and error may be required to select the best source port range. You can also contact
your ISP to determine the best range to use.
Security events
yes only Security no
Logging Log all
Session begins traffic? event in
enabled?
session?
no yes yes
No record Record
session data
Results
View traffic logs by going to Log & Report
> Traffic Log > Forward Traffic. The logs
display a variety of information about your
traffic, including date/time, source, device,
and destination.
If logging is enabled in both places, check that the policy in which logging is enabled is the
policy being used for your traffic. Also make sure that the policy is getting traffic by going to
the policy list and adding the Sessions column to the list.
The FortiGate unit’s performance level has decreased since enabl ing disk
logging.
If enabling disk logging has impacted overall performance, change the log settings to either
send logs to a FortiAnalyzer unit, a FortiManager unit, or to FortiCloud.
Log All Sessions is enabled on all security policies and cannot be changed.
This can occur if Client Reputation is enabled.
You must register your FortiGate unit before you can activate FortiCloud.
1. Activating FortiCloud
2. Sending logs to FortiCloud
3. Enabling logging in your security policies
4. Results
FortiCloud
FortiGate
Internal Network
12 The FortiGate Cookbook 5.0.4
Activating FortiCloud
Go to System > Dashboard > Status.
Internet
Internal Network
FortiGate
SNMP Manager
Enabling SNMP on a
FortiGate interface
Go to System > Network > Interfaces.
Results
This example uses the SolarWinds SNMP
trap viewer.
Internet
Port 3
Results
Configure web browsers on the private
network to connect using a proxy server.
The IP address of the HTTP proxy server is
10.10.1.99 (the IP address of the FortiGate
internal interface) and the port is 8080
(the default explicit web proxy port). Web
browsers configured to use the proxy server
are able to connect to the Internet.
Original Packet
Internet
FortiGate
Internal Network
Duplicate Packet
Packet Capture
Results
Open the pcap file with a pcap file viewer,
such as tcpdump or Wireshark.
Internet
WAN 1
172.20.120.22 DMZ Network
DMZ
FortiGate
LAN
Web Server
10.10.10.22
Internal Network
Internet
Protected web server
192.168.1.200
Router
WAN 1
Internal
FortiGate
Results
Connect to the web server from the internal
network and surf the Internet from the server
itself.
Internet
WAN 1 WAN 2
ISP 1 ISP 2
FortiGate
LAN
Internal
Network
Configuring failover
detection and spillover load
balancing
Go to Router > Static > Settings.
Results
Go to Log & Report > Traffic Log >
Forward Traffic to see network traffic from
different source IP addresses flowing through
both wan1 and wan2.
Internet
Internet
Switch
Dual HA
WAN 1 WAN 1 Links WAN 2
HA 1 HA 1
FortiGate FortiGate FortiGate
(Primary) (Primary) HA 2 (Backup)
HA 2
Internal Internal Internal
Switch
Internal Network
Internal Network
49
Ordering security policies to allow different
access levels
This example illustrates how to order multiple security policies in the policy table,
in order for the appropriate policy to be applied to different network traffic. In the
example, three policies will be used: one that allows a specific PC access to all
services, one that allows only Internet access to other network devices, and the
default deny policy.
Network PC
All Services
LAN WAN 1
FortiGate
Results
Browse the Internet using the PC and
another network device, then refresh the
policy list. You can now see Sessions
occuring for both policies.
In this example, a FortiWiFi unit is used. A similar method can be used to control BYOD access using a FortiAP and a
FortiGate..
Internet
FortiWiFi
Wireless Mobile
Devices
Internal
network
Results
Go to Log & Report > Traffic Log >
Forward Traffic. When a mobile user
connects during the lunch break, they can
surf the Internet, as shown in the logs.
Internet
Server
iPad
Internal Network
(OS x)
FortiAP FortiGate
Apple
TV
Results
Use Airplay from the iPad to stream video to
the Apple TV.
FortiAP FortiGate
AirPrint
79
Monitoring your network using client reputation
Client reputation allows you to monitor traffic from internal sources to identify any
users who may be engaging in risky or dangerous behavior. This example enables
client reputation on web filtering, in order to monitor user traffic to the Internet.
Internet
Internal Network
Action applied
yes
Application
yes targeted?
Application Application
Session begins specific control
traffic enabled?
no Traffic not
affected
Creating an application
sensor to block applications
Go to Security Profiles > Application
Control > Application Sensors and create
a new sensor list for blocking application
traffic.
Attacks
Internet
FortiGate
Web Server
Internet
Data Leak
FortiGate
Internal Network
Results
Attempt to upload a file that matches the
file filter criteria using FTP protocol. The file
should be blocked and a message from the
server should appear.
Internet
FortiGate
Internal Network
Results
Attempt to download a file larger than 10
MB. The download will fail and a replacement
message from the FortiGate unit will appear.
Website
Block
FortiGate
Internal Network
If web filtering is enabled in a policy, go to System > Config > FortiGuard and click the
blue arrow beside Web Filtering. Under Port Selection, select Use Alternate Port (8888).
Select Apply to save the changes. Check whether the license is shown as active. If it is still
inactive/expired, switch back to the default port and check again.
This example requires an active license for FortiGuard Web Filtering Services.
Website
Block
HTTPS Traffic
FortiGate
Internal Network
106 The FortiGate Cookbook 5.0.4
Verifying FortiGuard
Services are enabled
Go to System > Dashboard > Status.
This example requires an active license for FortiGuard Web Filtering Services.
Method 1 Method 2
1. Creating a rating override 1. Creating a user group and
two users
2. Adding FortiGuard blocking
to the default web filter profile 2. Creating a web filter profile
3. Adding the web filter profile to 3. Adding the web filter profile to
a security policy a security policy
4. Results 4. Results
Internet
FortiGuard
Override
FortiGate
Internal Network
Method 2
Creating a user group and
two users
Go to User & Device > User > User
Group. Select Create New and create the
group override_group.
Results
In a web browser, go to www.fortinet.com.
119
Setting up a temporary guest WiFi user
In this example, a temporary user account will be created and distributed to a guest
user, allowing the guest to have wireless access to the Internet.
Internet
Internal Network
FortiGate
FortiAP
Internet
FortiGate
FortiAP
Wireless Network
Internal Network
Results
Users connected to the new SSID will be
able to access the Internet. The wireless
devices will be in the same subnet as the
internal wired network.
FortiAP
Remote User
Internet
Internal Network
FortiGate
Providing remote users access to the corporate network and Internet 133
Creating an SSID and a
firewall addresses
Go to WiFi Controller > WiFi Network >
SSID. Select Create New.
Providing remote users access to the corporate network and Internet 135
Create a second policy for remote wireless
users to access the corporate network.
Again, set the Incoming Interface to the
SSID but now the Outgoing Interface is an
internal interface.
Connecting to the
corporate FortiGate
remotely
At the remote location, connect the FortiAP
to the Internet using an Ethernet cable. Next,
connect the FortiAP to power.
Providing remote users access to the corporate network and Internet 137
Results
Go to WiFi Controller > Monitor > Client
Monitor to see remote wireless users
connected to the FortiAP unit.
139
Providing single sign-on for a Windows AD
network with a FortiGate
This example uses the Fortinet Single Sign-On (FSSO) Collector Agent to integrate a
FortiGate unit into the Windows AD domain.
Internet
FortiGate
Windows AD
Internal Network
Adding a security
profile that includes an
authentication rule
Go to Policy > Policy > Policy.
Internet
FortiGate
Windows AD
Internal Network
Creating an identity-based
security policy
Create an identity-based security policy that
uses the FSSO user group that you created.
Results
The Windows AD user, having authenticated
at logon, does not have to authenticate again
to connect to the Internet.
Internet
LDAP Server
192.168.1. 117
WAN 1
Windows AD
Domain Controller
192.168.1.114
Results
The Windows AD user, having authenticated
at logon, does not have to authenticate again
to connect to the Internet.
Website Certificate
Certificate
SSL proxy
FortiGate
Internal Network
Importing the CA
certificate into the web
browser
For Internet Explorer:
Go to Tools > Internet Options. On the
Content tab, select Certificates and
find the Trusted Root Certification
Authorities.
Results
Even if you bypass the error message by
selecting “Continue to this website”, the
browser may still show an error in the toolbar.
159
Using IPsec VPN to provide communication
between offices
This example provides secure, transparent communication between two FortiGates
located at different offices using route-based IPsec VPN. In this example, one office
will be referred to as HQ and the other will be referred to as Branch.
WAN 1 WAN 1
172.20.120.123 172.20.120.22
IPsec Internet
FortiGate
FortiGate
Port 1 LAN
192.168.1.99/24 10.10.1.99/24
Internal Internal
Network (HQ) Network (Branch)
Creating an HQ security
policy and static route.
Go to Policy > Policy > Policy.
Creating an HQ security
policy and static route.
Go to Policy > Policy > Policy.
Results
Go to VPN > Monitor > IPSec Monitor to
verify the status of the VPN tunnel. It should
be up.
Internet
Remote SSL VPN user
WAN 1
SSL Root 172.20.120.123
Browsing
FortiGate
Port 1
192.168.1.99/24
Results
Log into the portal using the credentials you
created in step two.
WAN 1
172.20.120.123
Internet IPsec
FortiGate
Port 1
192.168.1.99/24
Remote User
(iPad)
Internal Network
Results
On the FortiGate unit, go to VPN >
Monitor > IPsec Monitor and view the
status of the tunnel.
OSPF
WAN 1 WAN 1
172.20.120.24 172.20.120.123
IPsec
Internet
FortiGate 1 FortiGate 2
IPsec
Internal WAN 2 WAN 2 Internal
10.20.1.1/24 172.20.120.23 172.20.120.127 10.21.1.1/24
OSPF
Internal Internal
Network Network
(HQ) (Branch)
Configuring firewall
addresses on FortiGate 1
Go to Firewall Objects > Address >
Addresses.
Configuring firewall
addresses on FortiGate 2
Go to Firewall Objects > Address >
Addresses.