Forum Discussion
jnowlin_44976
Nimbostratus
Nov 09, 2011redirect to specific pool member based on subnet
i am looking for a way to redirect clients based on their subnet to specific pool members. and then if they do not match a subnet speficified they are load balanced between the pool members. i have...
nitass
Employee
Nov 09, 2011this is on 10.2.3 but i think it could be applicable for 9.4.x. please feel free to revise.
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.65.152:http
ip protocol tcp
rules myrule
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when CLIENT_ACCEPTED {
if {[IP::addr [IP::client_addr] equals 192.168.206.0/24]} {
pool foo member 200.200.200.101 80
} else {
pool foo member 200.200.200.102 80
}
}
when SERVER_CONNECTED {
log local0. "[IP::client_addr]:[TCP::client_port] -> [IP::remote_addr]:[TCP::remote_port]"
}
}
[root@ve1023:Active] config b pool foo list
pool foo {
members {
200.200.200.101:http {}
200.200.200.102:http {}
}
}
[root@ve1023:Active] config curl -I http://172.28.65.152/
HTTP/1.1 200 OK
Date: Wed, 09 Nov 2011 16:46:10 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Tue, 08 Nov 2011 12:26:29 GMT
ETag: "4183f1-30-47e02740"
Accept-Ranges: bytes
Content-Length: 48
Connection: close
Content-Type: text/html; charset=UTF-8
[root@ve1023:Active] config tail -f /var/log/ltm
Nov 9 08:45:59 local/tmm info tmm[4766]: Rule myrule : 172.28.65.150:54072 -> 200.200.200.102:80
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