Forum Discussion
monica_74227
Nimbostratus
May 26, 2009Help-inteligent sant iRule
Hey guys,
I write an iRule as the following:
when CLIENT_ACCEPTED {
if {[IP::addr [IP::local_addr] equals 10.96.44.4] and [serverside [UDP::remote_port] equals 53]}{
snat 211.138.30.66
}
elseif {[IP::addr [IP::local_addr] equals 10.96.44.5] and [serverside [UDP::remote_port] equals 53]}{
snat 211.138.30.66
}
elseif {[IP::addr [IP::local_addr] equals 10.96.44.4] and [serverside [UDP::remote_port] ne 53]}{
snat 211.138.30.67
}
elseif {[IP::addr [IP::local_addr] equals 10.96.44.5] and [serverside [UDP::remote_port] ne 53]}{
snat 211.138.30.68
}
}
well, I don't know if the above iRule is right, however when I write it in to the BIG-IP LTM(v9) that generate error message.
Thank you for your help!
- hoolio
Cirrostratus
Hi,when CLIENT_ACCEPTED { if {([IP::addr [IP::local_addr] equals 10.96.44.4] or [IP::addr [IP::local_addr] equals 10.96.44.5]) and [serverside {UDP::remote_port}] == 53}{ snat 211.138.30.66 } elseif {[IP::addr [IP::local_addr] equals 10.96.44.4] and !([serverside {UDP::remote_port}] == 53)}{ snat 211.138.30.67 } elseif {[IP::addr [IP::local_addr] equals 10.96.44.5] and !([serverside {UDP::remote_port}] == 53)}{ snat 211.138.30.68 } }
- hoolio
Cirrostratus
Actually, it would be cleaner to check UDP::local_port versus trying to use serverside {UDP::remote_port} to see which port the UDP packet was sent to by the client. This assumes you're not using port translation on the VIP. - monica_74227
Nimbostratus
Thank you very much, I have successfully load your iRule.
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