Forum Discussion

Anush's avatar
Anush
Icon for Nimbostratus rankNimbostratus
Jun 18, 2019

prevent users to access URL using IP

Hi Experts, how do I prevent users to access the URL using IP? If uses access using IP, would like to drop those connections.

 

Thanks

3 Replies

  • You could also use a traffic policy in LTM to only allow traffic if the host header has the correct name.

     

    Cheers,

     

    Kees

  • Try this ->

    when HTTP_REQUEST {
    	if { [HTTP::host] matches_regex "\d+\.\d+\.\d+\.\d+" } {
    		drop
    	}
    }

    KR,

    Dario.

  • An easy way would be to leverage the black list feature in AFM (which is including in Better and Best licensing bundles). If you don't have AFM then you can leverage an iRule that looks for IPs inside a data group. You could base the code off this example but instead of setting reqBlock to 1 just reset the connection right then - no need for the ASM_REQUEST_DONE event.