# source routing

**URL:** <https://community.f5.com/t/source-routing/3579>\
**Category:** Technical Forums\
**Tags:** irules, dev, devops, application-delivery\
**Created:** [December 26, 2011, 3:11pm UTC](https://community.f5.com/t/source-routing/3579 "2011-12-26T15:11:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Comex\_17260](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@Comex\_17260](https://community.f5.com/u/Comex_17260)\
**Post date:** [December 26, 2011, 3:11pm UTC](https://community.f5.com/t/source-routing/3579/1 "2011-12-26T15:11:35Z")

</div>

Hello folks,

I have several clients and servers and a LB in the middle with several Virtual Servers.

Requests from clients are load balanced to servers well, but when servers starts a request such as sending an e-mail i have a problem.

LB is the gateway of the servers.

One of my VS IP is 20.20.20.118, and another 30.30.30.15. My mail server’s IP address is 20.20.20.116. When a node of a pool of the server 30.30.30.15 sends an e-mail, it goes out from 20.20.20.118, rather than 30.30.30.15 even if the node belongs to the pool which is bind to 30.30.30.15 VS.

I can solve this with SNAT pool and other parameters in the user interface, though this is not enough for me, because I have several servers with several VS and several applications that are trying to go out trough LB.

So I belive I need LB to route the outbound traffic according to source.

if the source is this node/pool

go out from this IP

if the source is that node/pool

go out from that IP

…

can i do such a thing with iRule?

Thanks in advance.

-Comex

---

<div class="post-metadata">

**Author:** ![nitass](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nitass/32/2270_2.png) [@nitass](https://community.f5.com/u/nitass)\
**Post date:** [December 26, 2011, 3:35pm UTC](https://community.f5.com/t/source-routing/3579/2 "2011-12-26T15:35:36Z")

</div>

i think configuring snat might be simpler.

e.g.

```tcl
[root@ve1023:Active] config b virtual bar list
virtual bar {
   snat automap
   pool foo
   destination 172.28.19.79:80
   ip protocol 6
}
[root@ve1023:Active] config b pool foo list
pool foo {
   members {
      200.200.200.101:80 {}
      200.200.200.102:80 {}
   }
}
[root@ve1023:Active] config b snat snat_bar list
snat snat_bar {
   translation 172.28.19.79
   origins {
      200.200.200.101
      200.200.200.102
   }
}

```
