Forum Discussion

Kraig_52305's avatar
Kraig_52305
Icon for Nimbostratus rankNimbostratus
Apr 28, 2017

Dynamic Pool Member Select by Source and Destination Subnet Match

Rather than building a huge topology in the GTM I would like to do a dynamic pool member select based on the client's IP. The client should get the IP of the server that in its same /23 network as the client. The pool will only have one IP from each /23 subnet so first IP to match the client subnet will work. Server will have all different IP's so just trying to match octets will not work.

 

For example...

 

Client 1 - 1.1.0.1 - Subnet 1.1.0.0/23 Client 2 - 1.1.5.199 - Subnet 1.1.4.0/23

 

Server IP 1.1.1.27 - Subnet 1.1.0.0/23 Server IP 1.1.3.73 - Subnet 1.1.2.0/23 Server IP 1.1.4.54 - Subnet 1.1.4.0/23

 

Client 1 with an IP of 1.1.0.1 should get the response of the local server 1.1.1.27. Client 2 does the same request from an IP of 1.1.5.199 they would get 1.1.4.54.

 

Thanks!

 

  • We can select a node instead of selecting a pool member.

    when CLIENT_ACCEPTED {
       if { [IP::addr [IP::client_addr] equals 1.1.0.0/23] } {
          node 1.1.1.27
       }
       elseif { [IP::addr [IP::client_addr] equals 1.1.4.0/23] } {
          node  1.1.4.54
       }
    }