Forum Discussion
Outbound routing based upon source IP
I have about a dozen T1 lines that come into a switch and the switch connects to my "external" VLAN port.
On the "internal" side my systems use SNAT to start an outbound connection.
The problem is that the outbound connections always use the default route. But I need them to route through the T1 that matches their SNAT address.
As an example. I have a system with an address of 10.10.10.10. It starts an outbound connection and gets a SNAT address of 62.2.2.10. I need to create an iRule that will look at this the SNAT address and route the traffic down the 62.x.x.x T1 and not through the default address.
Again, I am not trying to route based upon the destination address. Rather, I need to choose the correct router based upon the source address. Otherwise, if the wrong router is chosen, the packets get dropped.
If any of you F5 guru's know how to create an iRule to do this, I would greatly appreciate the help.
Thanks.
-Roark Fisher
15 Replies
- grei_zhang_3397
Nimbostratus
Thanks for this post, I got trick from your thoughts. - Liu_Li_18953
Nimbostratus
Posted By rodrigo.ev on 10/19/2006 2:17 PM
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 } } }
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 } } }
- Manuel_Gabaldon
Nimbostratus
Hi, - Liu_Li_18953
Nimbostratus
Thank you for your help,I don't wanna use too many "if" or "elesif" in ruels , can i use the "classe". - oninicus_162976
Nimbostratus
Hi Guys,
I am also new on F5. I would to get some advice from the F5 Gurus. Below is the situation I am in.
I have an LTM which is connected to a Switch (TRUNK), I have allowed already the 2 VLANs for my 2 VIPs (VLAN A - VIP1 and VLAN B - VIP2). the GWs for the respective VLANs are also configured on the switch. I have created the self-IPs for each VLANs as well.
When a user access 1 VIP (VIP1) traffic will SNATed to VIP1.9 and should forward to VIP1.1(GW) and same goes for VIP2 (will be SNATed to VIP2.9 and should forward traffic to VIP2.1(GW).
Please help me on this as I can't any solution on the internet for this. many thanks in advance!
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