VDOM    Labs
Chapter 11 - Customizing Application Delivery with                                                      11-1
                                                                                                         3-7
Lab 11.1 – HTTP to HTTPS Redirect via iRule
Objectives:
           Use an F5-supplied iRule, _sys_https_redirect, to redirect traffic from an HTTP virtual server to
            an HTTPS virtual server.
           Estimated time for completion: 15 minutes
Lab Requirements:
           Two virtual servers – one HTTP (port 80) and one HTTPS (port 443), both configured at the
            same IP address. (e.g. 10.10.X.100:80 and 10.10.X.100:443)
           F5-supplied iRule_sys_https_redirect
Confirm traffic behavior before iRule
    1. Remove any persistence profiles that are on vs_http and vs_https before continuing.
    2. Reset the statistics for vs_http, vs_https, http_pool, and https_pool on your BIG-IP system.
    3. Open a browser session to http://10.10.X.100, hard-refresh the screen several times, and ensure
       that you are not being redirected. You should consistently see the white application pages, not
       green.
    4. Verify through Local Traffic statistics that traffic is being directed solely to vs_http and
       http_pool.
    5. Reset the statistics for vs_http, vs_https, http_pool, and https_pool on your BIG-IP system.
View _sys_https_redirect iRule
    6. View the F5-supplied iRule called _sys_https_redirect that can be used to redirect traffic
       destined for an HTTP virtual server to an HTTPS virtual server. Navigate to Local Traffic »
       iRules : iRules List, and select member _sys_https_redirect. (Hint: Use the Search function to
       find this iRule or notice that there is more than one page of iRules available.)
                a. What event triggers this iRule?
                b. Are there any conditional statements in this iRule?
                c. What action will be taken?
                   The definition-signature section that follows the iRule code is used to
                   confirm that the iRule was written by F5 and has not been modified.
                   When writing iRules, you can include your own checksum or digital
                   signature.
        1    VDOM Labs                         www.vdomlabs.com
                                                                                                         3-7
VDOM
11-2 Labs                              Chapter 11 - Customizing Application Delivery with         3-7
   7. Assign _sys_https_redirect to vs_http (10.10.X.100:80), addressing any configuration error
      messages that may result.
              Configuration Utility
              Local Traffic » Virtual Servers : Virtual Server List, then select vs_http
              Resources tab iRules section, click Manage
                                                    Move _sys_https_redirect from the Available
                 iRule
                                                    column to the Enabled column
              When complete, click       Finished
Verify redirect behavior
   8. On your browser session to http://10.10.X.100, hard-refresh the screen. Did you get redirected to
      https://10.10.X.100? If so, you should see the green application page, not the white.
   9. View statistics to confirm that traffic was redirected from vs_http to vs_https.
               If you would like, continue with other labs via iRule.
       2   VDOM Labs                      www.vdomlabs.com
11-2                                                                       Administering BIG-IP v11
                                                                                                  3-7