Forum Discussion
Roark_Fisher_29
Nimbostratus
May 01, 2006Outbound routing based upon source IP
I hope the intellects here may be able to help me with a confusing setup. I worked for 3 days with F5 tech support on this and they finally sent me here.
I have about a dozen T1 lines tha...
Liu_Li_18953
Nimbostratus
May 07, 2008Posted By rodrigo.ev on 10/19/2006 2:17 PM
I'd like to propose another scenario we got in a customer:
Suppose we have the Wildcard Virtual Server (0.0.0.0:0) pointed to a Default Gateway Pool with my two ISP routers (200.1.0.1 and 200.2.0.1).
I want the outbound connection for specific internal servers to use another IP other than SelfIP/SNAT Automap (let's say Static SNAT Addresses 200.1.0.10 and 200.2.0.10).
With the iRule described above I can get this result, but the destination router will be selected by the SNAT, not leveraging the router/link status in a Link Controller Box.
The best would be to let the pool select the better router based on its metrics and then execute the iRule to SNAT to the proper static address.
class class_static_snat_servers {
host 10.0.0.10
host 10.0.0.11
}
class class_static_snat_gateways {
"200.1.0.1 200.1.0.10"
"200.2.0.1 200.2.0.10"
}
when CLIENT_ACCEPTED {
set static_snat_server [IP::client_addr]
}
when LB_SELECTED {
if {$::static_snat_server eq $::class_static_snat_servers]} {
set selected_gateway [findclass [LB::server addr] $::class_static_snat_gateways " "]
if { $selected_gateway ne "" } {
snat $selected_gateway
}
}
}
Or, in a short way:
when LB_SELECTED {
if {[matchclass [IP::client_addr] eq $::class_static_snat_servers]} {
set my_gw [findclass [LB::server addr] $::class_static_snat_gateways " "]
if { $my_gw ne "" } {
snat $my_gw
}
}
}
if i have many internal servers , i want use the networks instead of host IPs, every networks use a different snat ip ,can i build the class like this???
class class_static_snat_servers {
network 10.0.0.0 mask 255.255.255.0
network 10.0.1.0 mask 255.255.255.0
or
class class_static_snat_servers {
"10.0.0.0/24 200.1.0.10"
"10.0.1.0/24 200.1.0.11"
}
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