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
e.g.
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.19.79:80
ip protocol 6
rules myrule
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when CLIENT_ACCEPTED {
set vs "[IP::local_addr]:[TCP::local_port]"
if {[IP::addr [IP::client_addr] equals 172.28.19.0/24]}{
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 pool foo1 list
pool foo1 {
members 200.200.200.101:80 {}
}
[root@ve1023:Active] config b pool foo2 list
pool foo2 {
members 200.200.200.102:80 {}
}
[root@ve1023:Active] config cat /var/log/ltm
Feb 3 08:39:57 local/tmm info tmm[4369]: Rule myrule SERVER_CONNECTED: 172.28.19.80:50344 -> 172.28.19.79:80 -> 200.200.200.101:80
Feb 3 08:40:11 local/tmm info tmm[4369]: Rule myrule SERVER_CONNECTED: 192.168.204.8:53455 -> 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