F5 BIGIP 11.x LTM HTTP/HTTPS Virtual Server Template

Basic HTTPS virtual with HTTP to HTTPS redirection virtual.

cstubbs
March 26, 2015
Object name

Useful description, e.g. DNS hostname

IPv4 address

IPv6 address

Pool name

ltm profile tcp /Common/CLIENT-TCP-%{VS_NAME}% {
    defaults-from /Common/tcp-wan-optimized
}
ltm profile tcp /Common/SERVER-TCP-%{VS_NAME}% {
    defaults-from /Common/tcp-lan-optimized
}
ltm profile client-ssl /Common/CLIENT-SSL-%{VS_NAME}% {
    defaults-from /Common/clientssl
}
ltm profile server-ssl /Common/SERVER-SSL-%{VS_NAME}% {
    defaults-from /Common/serverssl
}
ltm profile http /Common/HTTP-%{VS_NAME}% {
    defaults-from /Common/http
}
ltm virtual /Common/VS-IPv4-%{VS_NAME}%-HTTPS {
    description "IPv4 Virtual, %{DESCRIPTION}%"
    destination /Common/%{IPv4_ADDRESS}%:443
    ip-protocol tcp
    mask 255.255.255.255
    pool %{POOL_NAME}%
    profiles {
        /Common/CLIENT-TCP-%{VS_NAME}% {
            context clientside
        }
        /Common/SERVER-TCP-%{VS_NAME}% {
            context serverside
        }
        /Common/CLIENT-SSL-%{VS_NAME}% {
            context clientside
        }
        /Common/SERVER-SSL-%{VS_NAME}% {
            context serverside
        }
        /Common/HTTP-%{VS_NAME}% { }
    }
    source-address-translation {
        type automap
    }
}
ltm virtual /Common/VS-IPv6-%{VS_NAME}%-HTTPS {
    description "IPv6 Virtual, %{DESCRIPTION}%"
    destination /Common/%{IPv6_ADDRESS}%.443
    ip-protocol tcp
    pool %{POOL_NAME}%
    profiles {
        /Common/CLIENT-TCP-%{VS_NAME}% {
            context clientside
        }
        /Common/SERVER-TCP-%{VS_NAME}% {
            context serverside
        }
        /Common/CLIENT-SSL-%{VS_NAME}% {
            context clientside
        }
        /Common/SERVER-SSL-%{VS_NAME}% {
            context serverside
        }
        /Common/HTTP-%{VS_NAME}% { }
    }
    source-address-translation {
        type automap
    }
}
ltm virtual /Common/VS-IPv4-%{VS_NAME}%-HTTP {
    description "IPv4 Virtual, %{DESCRIPTION}%, HTTP to HTTPS Redirection"
    destination /Common/%{IPv4_ADDRESS}%:80
    ip-protocol tcp
    mask 255.255.255.255
    profiles {
        /Common/http { }
        /Common/tcp { }
    }
    rules {
        /Common/_sys_https_redirect
    }
}
ltm virtual /Common/VS-IPv6-%{VS_NAME}%-HTTP {
    description "IPv6 Virtual, %{DESCRIPTION}%, HTTP to HTTPS Redirection"
    destination /Common/%{IPv6_ADDRESS}%.80
    ip-protocol tcp
    profiles {
        /Common/http { }
        /Common/tcp { }
    }
    rules {
        /Common/_sys_https_redirect
    }
}