-
Supporting two services on same VIP and Host Port
Hello, I have a server running two web based services, both on port 443. I'm using host headers to differentiate between the two. We have a need to add a second server for redundancy purposes. I'm curious which of the following (or some other I'm not thinking of?) method would be better: A) Have both URLs go to one A10 VIP…
-
Inserting the client certificate in a header
When you need the client certificate on the real server: when CLIENTSSL_CLIENTCERT { set cert [SSL::cert 0] session add ssl [SSL::sessionid] $cert}when HTTP_REQUEST { set cert [session lookup ssl [SSL::sessionid]] regsub -all {([\\-]+(BEGIN|END) CERTIFICATE[\\-]+)|\n} [X509::whole $cert] {} chdr HTTP::header insert…
-
Certificate Selection with Class-List (Alternative to SNI)
Server Name Indication is a feature in 2.7 that allows you to simplify your config by defining only one HTTPS VIP, but serving multiple certificates for different domains from this same VIP address. SNI is not supported on older browsers however. An alternative to using SNI is to use multi-domain certificates, which have…
-
Sorry page based on number of users
In 2.7.0-P1 a new command has been introduced to aFleX persist size uie [global] If global is specified, the number of persistent entries in the entire partition is returned. This means you can for example generate a sorry page based on the max number of active users you want to allow. For example: when HTTP_REQUEST { set…
-
Generating an empty gif
When you have a need for an empty gif to be generated. Unfortunately I am not able to post the actual code, but you can find it here: http://high5.nl/paste/view/93274853
-
Block DNS queries with class-list
When you want to reject or drop queries to a certain domain. The class-list: class-list cl-dns string str .example.tld dropstr .example2.tld drop! The aFleX: when DNS_REQUEST {if {!([DNS::question name] equals ".")} { set fqdn .[DNS::question name]}if { [CLASS::match $fqdn ends_with cl-dns] } { drop log local0.INFO…
-
Form Authentication with class-lists
If you want to use aFleX for Authentication and have an external store for users. class-list passwords string str user1 d154c51df37bd33b29cec5aa51efd29f5a6a6f1e! when RULE_INIT { set ::AUTHENTICATED "no" set ::FORM_CONTENT "AuthenticationPlease AuthenticateUsername:Password: "}when HTTP_REQUEST { set client_ip…
-
Drop certain DNS queries (ANY and RD)
When you don't want to allow certain DNS queries to be send to the DNS server. when RULE_INIT { set ::DEBUG 0}when DNS_REQUEST { if { $::DEBUG == 1 } { log "Question: name: [DNS::question name] - type: [DNS::question type] - Query ID: [DNS::header id] - RD: [DNS::header rd]" } if { [DNS::question type] eq "ANY" } { if {…
-
Basic HTTP Authentication w/ class-list
################################################# # # aFleX script to provide Basic HTTP Authentication # without the need for an external database. # # The class-list for authentication is called # "cl-passwords" (default) of type "string" and has # to contain the following data: # str # # For example: # str user1…
-
Port translation for multiple hosts behind single VIP
################################################### aFleX script to provide API port translation.## Requires real servers en ports to be configured# and to be member of a service-group.# On the VIP it needs a VPORT 0 TCP##################################################when RULE_INIT { set ::DEBUG 0 set ::REALPORT…
-
Traffic Steering on Radius Attributes
################################################### aFleX script to provide Header Enrichment for# the purpose of policy based Traffic Steering. # # This comes in 2 parts.# 1) Script that is bound to a RADIUS VPORT.# 2) Script that is bound to a HTTP VPORT.#################################################### VPORT:…
-
Smart LB to Caches v2
################################################### aFleX script for host based cache selection.## Contents of the array ::CACHEURLS needs to be in# the form:# "" ""## For example:# "youtube.com" "cache_group2"##################################################when RULE_INIT { set ::DEBUG 0 array set ::CACHEURLS {…
-
Log HTTP Status Codes (for Example 404)
A little irule which is helping me spotting errors while migrating configs to a10. when HTTP_REQUEST { set object "[HTTP::host][HTTP::path]" } when HTTP_RESPONSE { if { [HTTP::status] eq "404" } { log local0. "404: ${object}" #Just to be sure.... unset object } }
-
LB decisions based on SSL CA and Common Name
################################################### aFleX script to make decisions based on the CA# and Common Name of a Client Certificate.##################################################when RULE_INIT { set ::DEBUG 0}when CLIENTSSL_CLIENTCERT { set CCcert [SSL::cert 0] set CCsubject [X509::subject $CCcert] if {…
-
TCP port redirect
Aloha, I was wondering how to implement a TCP::remote_port redirect, as we are not using Layer 7 on the A10s. Example-> client connection -> VIP :80 -> aFlex -> service_group :443 I see some examples of TCP redirects, but wasnt sure on the correct usage/syntax, as it seems more complicated than a simple HTTP_REQUEST…
-
Drop or Reject the HTTP TRACE method
Recent Customer asked for a way to drop or reject the HTTP TRACE method for PCI compliance. Thanks to JonD here is a quick aFleX to do that. when HTTP_REQUEST { if { [HTTP::method] eq "TRACE"} { reject } }
-
Search and replace
I need a way to see if a uri contains || and then replace all places it does with !!. Example: http://foo.bar.com/u?e=83||l||0||email@gmail.com||http://foo.bar.com needs to redirect to http://foo.bar.com/u?e=83!!l!!0!!email@gmail.com!!http://foo.bar.com.
-
Forwarding Client IP in SMTP Header
Hey guys! I had a weird request regarding forwarding client IP's. We have our junkmail server's which currently are terminated directly to our old Cisco ACE load-balancer, and use the ACE as their default-gateway. We set them up this way because the junkmail server's need to see the IP addresses of the clients that are…
-
Conditional SNAT + aFleX rule
How to create an aFleX rule, where a connection started from a server_1 to the VIP can use the SNAT_1 IP address, and another connection started from another server_2 to the same VIP can use another SNAT_2 IP address??.. Is that possible. Thank you very much
-
IP Based Authentication with pbslb
When you want to allow certain IPs to specific content. The PBSLB List: ! BWList10.0.0.1/32 110.10.10.10/32 1172.16.0.0/16 1 The aFleX: when HTTP_REQUEST { if { ([HTTP::uri] starts_with "/certain_url") } { switch [POLICY::bwlist id[IP::remote_addr] BWList] { "1" { pool sg-http } default { log "Rejected ip address"…
-
dnsbl rule
Does anyone know if it is possible to apply an aflex rule to MX VIP and query a dns server and look for a specific response prior to allowing the traffic? F5 has a function that does this in irules. Bill
-
AX Box Sending Email
Dears, Is there a way at which we can make the AX device sending email notifications upon failure of servers in the service group or upon negative health monitor results of the servers (server being marked down) ?? Is it doable by aFLEX, or there is another way of doing it? Can we applt aFLEX to L4 virtual ports? In case…
-
Remove Accept-Encoding header
When you are not using compression in an HTTP template but you still want to get rid of the Accept-Encoding header. Or any other header. ;) when HTTP_REQUEST { if { [HTTP::header exists "Accept-Encoding"] } { HTTP::header remove "Accept-Encoding" }} Little more fancy: when RULE_INIT { set ::REMOVEHEADER…
-
Host based redirects with class-lists
In URI based redirect with class-lists I referred to new features in 2.7.0. The same can be done with Hostnames. The class-list: class-list cl-redirects string str a10networks.com https://a10networks.com str w3.a10networks.com https://a10networks.com str w3.customer1.tld http://shared.sample.tld/customer1 str…
-
URI based redirect with class-lists
With the release of 2.7.0 it's possible to reference class-lists in aFleX and it's possible to store strings in a class-list. This combination simplifies the required aFleX needed as the lists of redirects is kept in the class-list. The class-list: class-list cl-redirects string str /exchange…
-
Form Authentication with aFleX
Quick and dirty way of form based authenticating users for specific URLs on a VIP. ### START ###when RULE_INIT { # List of users (with passwords) that are allowed to authenticate array set ::DOTPASSWD { "randomuser1" "thiswillbeacleartextpassword" "randomuser2" "thiswillbeacleartextpassword" } set ::FORM_CONTENT…
-
Basic Authentication with aFleX
Quick and dirty way of authenticating users for specific URLs on a VIP. ### START ### when RULE_INIT { # Set the REALM set ::REALM "Password Required" # List of URLs you need to authenticate for array set ::LISTURL { "/exchange" "1" "/exchange/" "1" "/sharepoint" "1" "/sharepoint/" "1" } # List of users (with passwords)…
-
aFlex and server-for-server backups
Posted by kberton I have 3 primary app servers and 3 backup servers in a SLB Service Group. Let's call them A1/B1/C1 and A2/B2/C2. In normal operations, all traffic will be LB'd to A1/B1/C1 and A2/B2/C2 are backup servers that will only receive live traffic when there is a failure on any of the 3 primary servers. Service…
-
Wordpress SSL Issue
Good morning! I had a question regarding an issue our web developer team was having at our university. Apparently, they are having trouble with SSL when they require users to connect to their Wordpress Server. Their server is behind our load-balancer doing SSL offloading, and as such they've now requested that our AX-3030…
-
append to URI
I'd like to add ?A10 to a specific URI. The intent may appear below but of course I am posting here as it clearly does not do what I want :) When I get a request how do I change the request (uri) before sending to the server side? It is Sunday and I have been on an 11 hour conf call and my brain will not function - I hope…