Forum Discussion

AJ_6093's avatar
AJ_6093
Icon for Nimbostratus rankNimbostratus
Jan 16, 2009

Modifying the source address in Load balancer (URGENT)

Hi

 

I want to change the source IP address of the packets inside the load balancer when the request is coming from a particular server segment (192.168.100.0 /24).

 

 

example: A packet coming from 192.168.100.10 to virtual server 172.10.10.100. In load balancer when the virtual server will direct the request to any of the member servers it should also change the source IP to 172.10.10.100 so that the return part should be via the load balancer. To avoid the internal path between the source and the server directly and we want the request to be load balanced.

 

 

will this work in this scenario:

 

class Hosts {

 

 

network 192.168.100.0/24

 

}

 

 

when SERVER_CONNECTED { {

 

 

if { [matchclass [IP::client_addr] equals $::Hosts]} {

 

 

snat 172.10.10.100

 

} else {

 

forward

 

}

 

}

 

}

2 Replies

  • Hi Arijit,

     

     

    The SERVER_CONNECTED event is triggered after the LTM to server connection has been established, so I'm not sure what the effect of using the snat command would be. Can you change your iRule to use CLIENT_ACCEPTED?

     

     

    You can check the events wiki page for more info (Click here).

     

     

    Aaron
  • Steve_Scott_873's avatar
    Steve_Scott_873
    Historic F5 Account
    Or if you can alter routing or DNS in some way to push them to a seperate vip, this is preferably from a performance and maintainability prospective...