Forum Discussion

zeng_weiliang_2's avatar
zeng_weiliang_2
Icon for Nimbostratus rankNimbostratus
Jun 04, 2007

two clients use the same source address persistence table

The traffic is shown as the attachment.

 

First time, client access one VS on BIGIP, the request is sent to one node, after client receive the response date of server, will access the auth server, after auth, the auth server will connect to the second VS on BIGIP, but we need the traffic must be sent to the node that client connects to on the first time, how can I set the iRule to slove it? BTW, we can insert the client ip into the request that auth server sent to BIGIP.
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    If you can set the client IP to be inserted into a header in the auth server's request, then this should be possible and even pretty straight-forward. That also leads me to believe that we're going to be dealing with HTTP requests here. If that's an incorrect assumption, let me know and I'll re-work my suggestions below.

    Well it sounds like what you really need is an iRule and a little bit of configuration on your end, as well as on the BIG-IP.

    First, set up the auth server to have the client's IP in a header, as stated above.

    Once that's done, you'll want to configure normal source address persistence on the first Virtual Server, the one that the client is going to be making requests to. This will serve to make sure the client always accesses the same node as well as adding an entry to the persist table, which is how we're going to send the auth server to the same node. This can be done in a profile or via a simple iRule, such as:

    
    when CLIENT_ACCEPTED { 
      persist uie [IP::client_addr]
    }

    Next, you'll need an iRule applied to the second Virtual Server. What it's going to do is perform a lookup on the peristence table. Since we know the IP of the client, we can look up the entry the client created when making their initial request, and glean from that the node and pool info we need to send the auth server to the same place.

    Assuming you used the above iRule to set the persistence, it should end up looking something like this:

    
    when HTTP_REQUEST {
      persist uie [HTTP::header CLIENT_IP_HEADER]
      node [persist lookup uie [HTTP::header CLIENT_IP_HEADER] node]
    }

    I haven't tested the scenario, but hopefully that'll get you pointed in the right direction.

    Colin