Forum Discussion
Andrew_Chernysh
Nimbostratus
Apr 07, 2014redirect based on Source IP
Good day all. Looking to write efficient iRule (many intranet clients, processing is important) Logic as follows: if client coming from private network(10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) serve content over http else (client coming from Internet) redirect to SSL offloaded content from same pool.
any recommendations?
Thanks in advance.
2 Replies
- JRahm
Admin
first, create a datagroup with the rfc1918 space
ltm data-group internal rfc1918 { records { 10.0.0.0/8 { } 172.16.0.0/12 { } 192.168.0.0/16 { } } type ip }then you can use this iRule
when HTTP_REQUEST { if { ! [class match [IP::client_addr] equals "rfc1918" ] } { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } } - Andrew_Chernysh
Nimbostratus
appriciate, worked as advertized!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects