Forum Discussion
hung_105573
Nimbostratus
Jul 02, 2013irule for base on source ip
hi all
i have a irule base on source ip address, that is server mail :
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 10.0.x.y] } {
snatpool NAT_MAILServer
} ...
The_Bhattman
Nimbostratus
Sep 02, 2013Hi Hung, You can add nodes to the F5 with the ping monitor. For example each ISP has customer edge router/device that maybe pingable by your F5. You would add the customer edge router as a node and put a ICMP ping as the default monitor for the node. Then you modify the irule to check for the UP/DOWN Status of the node
For Example
when CLIENT_ACCEPTED {
if {[IP::addr [IP::client_addr] eq 10.0.x.y]}{
if { [LB::status node IP_ADDRESS_OF_ISP-A_node ] eq "up" } {
snatpool NAT_MAILServer member 255.255.x.y
} elseif { [LB::status node IP_ADDRESS_OF_ISP-B_node ] eq "up" } {
snatpool NAT_MAILServer member 183.91.x.y
} elseif { [LB::status node IP_ADDRESS_OF_ISP-C_node ] eq "up" } {
snatpool NAT_MAILServer member 118.69.x.y
}
else
if { [LB::status node [LB::status node IP_ADDRESS_OF_ISP-A_node ] eq "up" } {
snatpool NAT_MAILServer member 255.255.x.z
} elseif { [LB::status node IP_ADDRESS_OF_ISP-B_node ] eq "up" } {
snatpool NAT_MAILServer member 183.91.x.z
} elseif { [LB::status node IP_ADDRESS_OF_ISP-C_node ] eq "up" } {
snatpool NAT_MAILServer member 118.69.x.z
}
} }
I hope this helps
-=Bhattman=-Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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