Forum Discussion
Aforester_2020
Feb 03, 2012Nimbostratus
redirect to pool member based on Subnet
I am very new to iRule creation. I have a group of subnets that need to be directed to a specific pool member when any traffic from them comes into the VIP. Any help is appreciated! ...
nitass
Feb 03, 2012Employee
vs variable and SERVER_CONNECTED event are used for logging. please feel free to remove it.
this is data group version.
[root@ve1023:Active] config b rule myrule list
rule myrule {
when CLIENT_ACCEPTED {
set vs "[IP::local_addr]:[TCP::local_port]"
if {[class match -- [IP::client_addr] equals subnet_list]}{
pool foo1
} else {
pool foo2
}
}
when SERVER_CONNECTED {
log local0. "[IP::client_addr]:[TCP::client_port] -> $vs -> [IP::server_addr]:[TCP::server_port]"
}
}
[root@ve1023:Active] config b class subnet_list list
class subnet_list {
network 172.28.19.0/24
}
[root@ve1023:Active] config cat /var/log/ltm
Feb 3 08:51:04 local/tmm info tmm[4369]: Rule myrule SERVER_CONNECTED: 172.28.19.80:59652 -> 172.28.19.79:80 -> 200.200.200.101:80
Feb 3 08:51:07 local/tmm info tmm[4369]: Rule myrule SERVER_CONNECTED: 192.168.204.8:53813 -> 172.28.19.79:80 -> 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