FortiADC Deployment Guide Microsoft IIS
FortiADC Deployment Guide Microsoft IIS
FORTINET BLOG
https://blog.fortinet.com
FORTIGATE COOKBOOK
http://cookbook.fortinet.com
FORTIGUARD CENTER
http://www.fortiguard.com
FEEDBACK
Email: [email protected]
Revision 1
TABLE OF CONTENTS
Change Log 4
Introduction 5
Solution benefits 5
The FortiADC difference 6
Deployment topologies 7
Router Mode 7
One-Arm Mode 8
Hardware and software used in this example 9
Microsoft IIS Configuration 9
Step 1: Install Microsoft IIS 9
Step 2: Configure IIS logging 10
FortiADC Configuration 12
Basic Configuration 12
Step 1: Configure network interfaces and a static route 12
Step 2: Configure health checks 14
Step 3: Configure the Real Server Pool 15
Step 4: Configuring the virtual servers 18
Advanced Features Configuration 21
Persistence 21
Scripts 22
Advanced profile options 24
SSL offloading 25
Caching 28
Compression 30
Binding profiles to the virtual server 32
Advanced virtual server configuration summary 33
Verification 35
Troubleshooting 36
Appendix A: FortiADC Configuration 37
Basic server load balancing 37
Advanced features 38
Change Log
Change Log
Introduction
Internet Information Services (IIS) is a web server produced by Microsoft. IIS has been included with Windows
Server since Windows 2000 Server as a Windows Component and since Windows NT as an option.
IIS 7.0 (most common used) is available with Windows Server 2008 and Windows Vista. Over the years, IIS has
gone through a major overhaul and has been completely redesigned to be the most flexible and secure platform
for web and application hosting. IIS contains several components that perform important functions for the
application and Web server roles. Each component has responsibilities, such as listening for requests made to
the server, managing processes, and reading configuration files.
The FortiADC deployment enables load balancing for server availability, quality of experience (QoE)
improvement for fast response-time, and best ROI with cost reduction (CAPEX and OPEX).
Solution benefits
l Delivers 99.999% application uptime with intelligent server load balancing and global server load balancing
l Optimizes applications and improves user QoE (Quality of Experience)
l Reduces CAPEX and OPEX by doing server offoad with SSL acceleration and TCP multiplexing.
l Secures IIS with web application firewall and distributed denial-of-server (DDoS) prevention.
There are a number of hardware load balancing products available on the market with a wide range of features
and capabilities. FortiADC differentiates itself by providing superior value, high performance, reliability, advanced
acceleration features, and security from a market leader.
FortiADC not only load balances Internet service requests across multiple servers, but also accelerates
application performance and provides application-aware features that monitor server load and improve server
response times – by as much as 25%. In addition to basic load balancing, FortiADC provides:
Deployment topologies
This section shows the most common deployment topologies for load balancing Microsoft IIS. It includes the
following information:
l Router Mode
l One-Arm Mode
The example configurations in this deployment guide are for a Router Mode deployment.
Router Mode
The following tables show the source/destination addresses received and sent from the FortiADC.
One-Arm Mode
The following hardware and software were used in testing this example:
l FortiADC VM
l FortiADC OS Version 4.3.1
l IIS Web Server Version 7.0
l Custom client/server hardware running VMware ESX 4 (Windows Server 2008)
Important: This guide is written only for the FortiADC D-series platform. The instructions included within are not
designed to be used with the FortiADC E-series platform application delivery controllers.
This section provides configuration pointers for Microsoft IIS. It includes the following topics:
If it is not already installed, install Microsoft IIS. You can find instructions here:
http://www.iis.net/learn/install/installing-iis-7/installing-iis-7-and-above-on-windows-server-2008-or-windows-
server-2008-r2
Verify installation was successful by opening http://localhost in the server host computer browser. Figure 3 shows
the message that is displayed when the installation is successful.
If FortiADC performs source NAT (due to a one-arm deployment or other requirements), you can configure
FortiADC to write the original source IP address to the X-Forwarded-For header. Figure 4 shows the profile
configuration page where you set this behavior.
On IIS, you must install the IIS Advanced Logging 64-bit or IIS Advanced Logging 32-bit add-on for IIS 7. You
can find instructions for installing the add-on and enabling logging of headers such as X-Forwarded-For here:
http://www.iis.net/learn/extensions/advanced-logging-module/advanced-logging-for-iis-custom-logging
If you use advanced FortiADC load balancing features like SSL offloading and
compression offloading, you would disable those Microsoft IIS settings.
FortiADC Configuration
This section provides configuration guidelines for load balancing Microsoft IIS when FortiADC is deployed in
Router Mode. It includes the following topics:
Basic Configuration
Advanced Features Configuration
Basic Configuration
This section provides the basic procedures for getting started with Layer 4 load balancing. It includes the
following steps:
To create a static route, go to Networking > Routing. Figure 6 shows the static route configuration page.
To configure a health check, go to System > Shared Resources > Health Check. Table 1 summarizes the health
check configuration for this example. Figure 7 shows the HTTP health check configuration page.
Name HC-HTTP-IIS80
Type HTTP
Method GET
To configure real server pools, go to Server Load Balance > Real Server. Table 2 summarizes the real server pool
configuration for this example. Figure 8 through Figure 10 show the configuration pages.
Name Web-Group
Health Check
Health Check Rela- OR Server is deemed available if any of the specified health
tionship checks is successful. In this case, we have only one
health check, so there is no distinction between the two
possible settings.
Health Check Con- HC-HTTP-IIS80 The health check configured in the previous step.
figuration Objects
Member
IP Address 192.168.100
192.168.101
192.168.102
Port 80
In the virtual server configuration, you select from predefined and user defined configuration objects. You created
the required user-defined configuration objects in the previous steps.
To configure virtual servers, go to Server Load Balance > Virtual Server. Table 3 summarizes the virtual server
configuration for this example. Figure 11 shows the configuration summary page.
Name Web_VIP
Type Layer 4
IP address 10.10.10.10
Port 80
Real Server Pool Web_Group The pool configured in the previous step.
Some advanced features are bound directly to the virtual server and some are bound to the profile selected for
the virtual server.
l Persistence
l Scripts
l Advanced profile options
Persistence
You bind persistence rules to the virtual server configuration. Persistence rules determine traffic that is not load
balanced but rather is dispatched to the same server as an existing connection. Typically, you configure
persistence rules to support server transactions that depend on an established client-server session.
This example uses persistence based on cookies. The backend server sends a cookie. If subsequent packets
received by FortiADC match the cookie, they are forwarded to the original backend server and load balancing
rules are not applicable.
To configure persistence rules, go to Server Load Balancing > Virtual Server > Persistence. Figure 12 shows the
configuration for this example. Figure 13 shows where to select the configuration object in the virtual server
configuration page.
Scripts
You bind scripts to the virtual server configuration. Scripts enable you to use predefined Lua script commands and
variables to manipulate the HTTP request/response or select a content route.
For example, you could use a script to redirect HTTP requests to the HTTPS location for the web site:
when HTTP_REQUEST {
Host = HTTP:header_get_value("host")
Path = HTTP:path_get()
To configure scripts, go to System > Shared Resources > Scripting. Figure 14 shows the configuration for this
example. Figure 15 shows where to select the script in the virtual server configuration page.
This section includes example configurations for the following advanced profile options:
l SSL offloading
l Caching
l Compression
SSL offloading
Clients can use SSL or TLS to connect to HTTPS virtual servers.
When you use FortiADC as a proxy for SSL operations normally performed on the backend real servers, you must
import the X.509 v3 server certificates and private keys the backend servers would ordinarily use, as well as any
certificate authority (CA) or intermediate CA certificates that are used to complete the chain of trust between your
clients and your servers.
The FortiADC system supports all of the TLS/SSL administration methods commonly used by HTTPS servers,
including:
l Server name indication (SNI) - You can require clients to use the TLS extension to include the server hostname in
the TLS client hello message. Then, the FortiADC system can select the appropriate local server certificate to
present to the client.
l Local certificate store - A certificate store for the X.509 v3 server certificates and private keys the backend servers
would ordinarily use.
l Certificate Authorities (CAs) store - A store for the CA certificates that the backend servers would ordinarily use to
verify the CA signature in the client certificate.
l Intermediate CAs store - A store for Intermediate CAs that the backend servers would ordinarily use to complete the
chain between the client certificate and the server certificate. HTTPS transactions use intermediate CAs when the
server certificate is signed by an intermediate certificate authority (CA) rather than a root CA.
l OCSP - Use Online Certificate Status Protocol (OCSP) to obtain the revocation status of certificates.
l CRL - Use a certificate revocation list (CRL) to obtain the revocation status of certificates.
l Certificate validation policy - You can configure certificate validation policies that use OCSP or CRL. These policies
can be associated with load balancing profiles.
Basic Steps
1. Import the certificates and keys. If necessary, generate a CSR and submit it to a CA. When you receive your
certificate from the CA, you can import it.
Go to System > Certificate > Manage Certificates > Local Certificate. Figure 16 shows the Import Local
Certificate page. Figure 17 shows the Generate CSR page.
2. Create a certificate group.
Go to System > Certificate > Manage Certificates > Local Certificate Group. Figure 18 shows the Certificate
Group configuration page.
3. Create an HTTPS profile and bind the certificate group to it.
Go to Server Load Balance > Profile. Figure 19 shows where to select the configuration object in the profile
configuration page.
Caching
FortiADC can store HTTP content. The system can serve subsequent HTTP requests for that content without
forwarding the requests to the backend servers, thereby reducing the load on the backend servers.
In general, the RAM cache conforms to the cache requirements described in RFC 2616.
If caching is enabled for the profile that is applied to traffic processing, the system evaluates HTTP responses to
determine whether or not to cache the content. HTTP responses with status codes 200, 203, 300, 301, 400 can
be cached.
Figure 20 shows the configuration for this example. Figure 21 shows where to select the configuration object in
the profile configuration page.
Compression
Compression offers the greatest performance improvements for Microsoft IIS when applied to URLs whose
media types include repetitive text such as tagged HTML and JavaScript. Files that already contain efficient
compression such as GIF images usually should not be compressed, as the CPU usage and time spent
compressing them will result in an increased delay rather than network throughput improvement.
Figure 22 shows the configuration for this example. Figure 23 shows where to select the configuration object in
the profile configuration page.
Name Web_VIP
Type Layer 7
IP address 10.10.10.10
Real Server Pool Web_Group The pool configured in the previous step.
Verification
You can use the FortiADC monitoring graphs and logs to verify that traffic is indeed cached and packet flow is
working as expected.
To display the dashboard for real server pool statistics, go to Dashboard > Virtual Server > Real Server.
To display logs for Layer 4 virtual servers, go to Log & Report > Traffic Log > SLB Layer 4.
Troubleshooting
The FortiADC web user interface includes a tcpdump packet capture utility that can be helpful troubleshooting
expected behavior.
To configure packet capture settings and filters, go to Networking > Packet Capture.This page also has controls
to start/stop and download the packet captures.
end
config load-balance persistence
end
config load-balance content-rewriting
end
config load-balance content-routing
end
config user local
end
config user user-group
end
config load-balance auth-policy
end
config load-balance virtual-server
edit "Web_VIP"
set interface port2
set ip 10.10.10.10
set load-balance-profile LB_PROF_TCP
set load-balance-method LB_METHOD_ROUND_ROBIN
set load-balance-pool Web_Group
set traffic-log enable
set id 1
next
end
Advanced features
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI1MVDWOX4NCsCAggA
MBQGCCqGSIb3DQMHBAjLJVfgVPxzCASCBMi+OEweUbBScuSI3wOeLiJzihJ5gEQ1
NpKPfdlmdizM8zmlB9CDpj6qvh6/1Jr2fR/n3y/7mgxm6HmYwaejTP/zq3ahNxoV
geO83oYo4hmXw0HWd9gESZ2JsDcZYFnKGQOBh/8+hU0Dk54kk15We/pQax0yndog
iF9TI+YU52jWiHuGFSz7SgwxD7hnWIT0/TYJoYmRYCWEw/we2fK2E1cUiBbUhdoG
DR7+Wx5ZMqtEIFlFZfGEbDL0Ajvn9Ch0V9nxELKtrik5f4oV4MMWMIN+DLe/hhLP
wpnVUEvtxxPNmYQtz0pDSINutACqS6HRDvgt751JUueYMobkuP/dE2KZ8dAFNRji
4aFwELJKfWL9lEcUwTw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hrkvh5ocuAwD4TqptyGQsRDtuTMIU0Hq6qVp/tcG6OA87/rOg2
BmfA1dMplCiAViNHe+9fj2mAV0QlyzB8hM/Enxlfi680bX1RPW9KA9LmPFOkSpLC
Vm+Cq8YuEJ9Tuu+sFTG20mHwmmwitg9EjuGCOAHAKqcVw+c2cSCwtEf/5WW7E8eP
9X02teScIMBP3KCmSeMo2Frk
-----END CERTIFICATE REQUEST-----
"
next
end
config system certificate ca_group
end
config system certificate intermediate_ca
end
config system certificate intermediate_ca_group
end
config system certificate local_cert_group
edit "Cert_Group"
config group_member
edit 1
set local-cert Factory
next
end
next
end
config system scripting
edit "https_redirection"
next
end
config system health-check
edit "HC-HTTP-IIS80"
set type http
set port 80
set method-type http_get
next
end
config load-balance compression
edit "Compression-Policy"
config uri_list
end
config content_types
end
next
end
config load-balance caching
edit "Caching-Policy"
config uri_exclude_list
end
next
end
config load-balance profile
edit "HTTPS-Profile"
set type https
set local-cert-group Cert_Group
set compression Compression-Policy
set caching Caching-Policy
next
end
config load-balance pool
edit "Web_Group"
set health-check-ctrl enable
set health-check-list HC-HTTP-IIS80
config pool_member
edit 1
set ip 192.168.1.100
next
edit 2
set ip 192.168.1.101
next
edit 3
set ip 192.168.1.102
next
end
next
end
config load-balance method
end
config load-balance persistence
edit "Cookie_Presistency"
set type persistent-cookie
next
end
config load-balance virtual-server
edit "Web_VIP"
set type l7-load-balance
set interface port1
set ip 10.10.10.10
set load-balance-profile LB_PROF_HTTP
set load-balance-method LB_METHOD_ROUND_ROBIN
set load-balance-pool Web_Group
set traffic-log enable
set id 1
set scripting https_redirection
next
edit "HTTPS_VIP"
set type l7-load-balance
set interface port1
set ip 10.10.10.10
set port 443
set load-balance-profile HTTPS-Profile
set load-balance-persistence Cookie_Presistency
set load-balance-method LB_METHOD_ROUND_ROBIN
set load-balance-pool Web_Group
set traffic-log enable
set id 2
next
end