Forum Discussion

Ken_Leclercq_50's avatar
Ken_Leclercq_50
Icon for Nimbostratus rankNimbostratus
Jun 19, 2013

Block IE6

Let me start by saying this..... I am by no means an expert with my F5 LTM. I'm quite new to the administration of it.

 

Does anyone know of a way to detect users using IE6, and stop them from accessing my site. I'd like to redirect those users to an hmtl page telling them to upgrade their browser in order to access my site.

 

4 Replies

  • can we just block it based on user-agent?

     

     

    e.g.

     

    Blocking Specific User-Agent

     

    https://devcentral.f5.com/community/group/aft/2161687/asg/50
  • Hi Ken,

     

     

    You should be able to use the iRule below...

     

     

    when HTTP_REQUEST {

     

     

    if { [HTTP::header "User-Agent"] contains "MSIE 6"} {

     

    log local0. "[IP::client_addr]:[TCP::client_port]: Using IE 6"

     

    HTTP::redirect "http://www.example.com/newlocation.html"

     

    }

     

    }

     

     

    Thanks,

     

    Seth

     

  • Thanks for your input. That did the trick. However, we now want to make a tweek to the rule. We want to exclude certain IPs from being affected by the rule. I'm thinking that the use of a Data Group would do the trick. I tried modifying the rule as follows:

    when HTTP_REQUEST {

    if { [HTTP::header "User-Agent"] contains "MSIE 6" and [IP::client_addr] not equals $::DataGroupName} {
       log local0. "[IP::client_addr]:[TCP::client_port]: Using IE 6"
       HTTP::redirect "http://www.example.com/newlocation.html"
    }
    

    }

    It doesn't like my syntax. Am I on the right track to accomplish this? Is there a better way? Maybe using a Stream profile in the iRule to replace the user-agent info from the IP's in the datagroup before we block IE6?

  • this sounds like the way i would go,

     

    cant give you an exact answer without big-ip around, but you can't match with "not equals" on a data group, you need to use matchclass or such to examine every entry in the datagroup:

     

    https://devcentral.f5.com/articles/irules-101-08-classes

     

    do some googling how to work with data groups, there is enough out there that should explain the basic.