Is it possible to implement an iRule that will restrict access when browsing directly to the virtual server’s IP address? For example, when a user browses to http://1.1.1.1 the traffic is dropped; however, browsing to the domain name is acceptable (ie http://mywebsite.com).
It’s not foolproof, but you can check the host: header. A browser will by default put in there whatever was type din the URL for the host. So if they type http://1.1.1.1/ the host header will have host: 1.1.1.1
if { [HTTP::host] ne "mysite.domain.com" } {
drop
}
Or do whatever you like (e.g. redirect somewhere else
Absolutely supportable in iRules, but there is more functionality with redirects moving into policy actions in the GUI (or via tmsh) For Hamish’s solution, it would look like this:
Yes, more lines, and doesn’t look pretty on the CLI, but multiple redirect rules can be added per policy and managed completely in the system versus requiring coding skills for shops that are leery about coding at the network layer.