Forum Discussion
5 Replies
Sort By
- Chris_PhillipsNimbostratuswell source IP or usernames are just arbitrary fields, It is very trivial to change the data source you are using. It could depend where you are getting the username from, as that could take all sorts of forms and you've not said if this is an HTTP header, cookie value etc.
- hooleylistCirrostratusDo you want to do a mapping for all clients to specific pools, or just a subset of users?
- opers13_3280NimbostratusJust a subset of users to specific pools and HTTP is the authentication method.
- hooleylistCirrostratusIf you're using basic HTTP auth, you can parse the username with HTTP::username:
when CLIENT_ACCEPTED { Save the VS default pool name set default_pool [LB::server pool] } when HTTP_REQUEST { Check if the basic auth username is present if {[HTTP::username] ne ""}{ Check if the default set pool_name [class match -value [HTTP::username] equals user_to_pool_dg] if {$pool_name ne ""}{ Select the pool and exit the iRule event pool $pool_name return } } If we are still in the iRule, a pool was not selected so pick the default pool pool $default_pool }
- opers13_3280NimbostratusThank you - I will try that