Forum Discussion
Irule help
Hello Mates,
Can somebody help me to create an irule with below condition?
if the subnet 10.91.150.0/24 matches, go to the url http://myurl.com/test/hello.world?wdsl
if the subnet 10.85.55.0/25 matches, go to http://myurl.com/production/hello.world?wdsl
and if the subnet 10.0.0.0/8 matched allow everything except above two urls.
any idea??
-Jinshu
4 Replies
- R_Marc
Nimbostratus
There are very good examples here on how to do that fort of thing. Assuming I understand your requirement, the following would redirect the two specified networks to the URLs you specified and let everything else flow down to the pool members of the Virtual. There are much more sophisticated ways to do this, but this would do, I think, what you want.
when HTTP_REQUEST { if { [IP::addr [IP::client_addr] equals 10.91.150.0/24] } { HTTP::respond 301 Location "https://myurl.com/test/hello.world?wdsl } elseif { [IP::addr [IP::client_addr] equals 10.85.55.0/25] } { HTTP::respond 301 Location "http://myurl.com/production/hello.world?wdsl" } } - Jinshu
Cirrus
After appying this irule it says that The web page at
has resulted in too many redirects.https://myurl.com/test/hello.world?wdslhow to solve this???
- Jinshu
Cirrus
Sorry, Unfortunately, it is not working...
- nathe
Cirrocumulus
What about this:
when HTTP_REQUEST { if { ([HTTP::uri] eq "/test/hello.world?wdsl") && (![IP::addr [IP::client_addr] equals 10.91.150.0/24]) } { reject } if { ([HTTP::uri] eq "/production/hello.world?wdsl") && (![IP::addr [IP::client_addr] equals 10.85.55.0/25]) } { reject } }Hope this helps,
N
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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