Forum Discussion
Forward UDP traffic to different Pool using iRule
Hi Subrun,
Can you investigate ltm logs?
tail -f /var/log/ltm | grep ASAtestlog
simplified iRule:
when CLIENT_ACCEPTED {
switch [IP::client_addr] {
"10.7.10.10" -
"10.7.11.10" -
"10.7.12.10" -
"10.7.13.10" {
if { [LB::status pool ASA_Pool member 10.8.11.23 1514] eq "up" or [LB::status pool ASA_Pool member 10.8.11.24 1514] eq "up" } {
log local0. "ASAtestlog-1 | CIP: [IP::client_addr] | 10.8.11.23 is [LB::status pool ASA_Pool member 10.8.11.23 1514] | 10.8.11.24 is [LB::status pool ASA_Pool member 10.8.11.24 1514]"
pool ASA_Pool
}
else {
log local0. "ASAtestlog-2 | CIP: [IP::client_addr] | 10.8.11.23 is [LB::status pool ASA_Pool member 10.8.11.23 1514] | 10.8.11.24 is [LB::status pool ASA_Pool member 10.8.11.24 1514]"
pool Default_Pool
}
}
default {
log local0. "ASAtestlog-3 | CIP: [IP::client_addr] | 10.8.11.23 is [LB::status pool ASA_Pool member 10.8.11.23 1514] | 10.8.11.24 is [LB::status pool ASA_Pool member 10.8.11.24 1514]"
pool Default_Pool
}
}
}
I may be wrong but do we need an else loop because technically at ELSE you are assigning Default Pool. Or it may be for Programming Logic once an if there should be an ELSE ?
Also just note that my default pool is listening on 8514. I may not have clearly mentioned that.
I did this below still traffic is moving to DEFAULT Pool
when CLIENT_ACCEPTED {
switch [IP::client_addr] {
"10.7.10.10" -
"10.7.11.10" -
"10.7.12.10" -
"10.7.13.10" {
if { [LB::status pool ASA_Pool member 10.8.11.23 1514] eq "up" or [LB::status pool ASA_Pool member 10.8.11.24 1514] eq "up" } {
log local0. "ASAtestlog-1 | CIP: [IP::client_addr] | 10.8.11.23 is [LB::status pool ASA_Pool member 10.8.11.23 1514] | 10.8.11.24 is [LB::status pool ASA_Pool member 10.8.11.24 1514]"
pool ASA_Pool
}
else {
log local0. "ASAtestlog-2 | CIP: [IP::client_addr] | 10.8.11.23 is [LB::status pool Default_Pool member 10.8.11.23 8514] | 10.8.11.24 is [LB::status pool Default_Pool member 10.8.11.24 8514]"
pool Default_Pool
}
}
default {
log local0. "ASAtestlog-3 | CIP: [IP::client_addr] | 10.8.11.23 is [LB::status pool Default_Pool member 10.8.11.23 8514] | 10.8.11.24 is [LB::status pool Default_Pool member 10.8.11.24 8514]"
pool Default_Pool
}
}
}
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