Forum Discussion
Emad
Cirrostratus
May 18, 2016FQDN Node with Route Domains
How can we add route domain in FQDN based nodes. In Address based node it can be added with %1 but how this will be done in FQDN based nodes.
Marlon_Goncalve
Employee
Jul 21, 2025adding v2 as we had some issues with persistence so we needed to add source pool member persistent to make it work
when RULE_INIT { # Debug level (set to 1 for logging, or 0 to disable logging) set static::sftpdebug_pool 1 # Pool name set static::sftpfqdn_pool sftp_snf_uat_22_pool } when CLIENT_ACCEPTED { # Reject the traffic if the ROUTE::domain is not 1549 if { [ROUTE::domain] != 1549 } { reject return } # Only apply this logic to TCP port 22 (SFTP) if { [TCP::local_port] == 22 } { # Check if the client IP address is in the Data Group (sftp_snf_parallel_dg) if { [class match [IP::client_addr] equals sftp_snf_parallel_dg] } { # Check if a node is already assigned for this source IP set nodemember [table lookup -subtable sftpsource:[IP::client_addr] "" ] if { $static::sftpdebug_pool > 0 } { log local0. "Selected previous member for [IP::client_addr]: $nodemember" } if { $nodemember == "" } { # Get the list of active pool members set members [active_members -list $static::sftpfqdn_pool] set member_count [llength $members] if { $member_count > 0 } { # Implement round-robin selection based on a dynamic index if {[info exists static::poolndx]} { # Increment index and loop back if necessary set static::poolndx [expr {($static::poolndx + 1) % $member_count}] } else { # Initialize the pool index on first use set static::poolndx 0 } # Select a member based on the index set membaddr [lindex [lindex $members $static::poolndx] 0] # Log selected member (for debugging) if { $static::sftpdebug_pool > 0 } { log local0. "Selected pool member: $membaddr%1549 port 22 (round-robin)" } # Store the selected node in the session table set nodemember "$membaddr%1549:22" table set -subtable sftpsource:[IP::client_addr] $nodemember "" 180 # Send traffic to the selected node node $nodemember } else { # No active members in the pool log local0. "No active members in pool $static::sftpfqdn_pool" reject return } } # If a previous assignment exists, route traffic to the assigned node if { $static::sftpdebug_pool > 0 } { log local0. "Routing to previously assigned pool member: $nodemember" } node $nodemember } else { # Fallback to the default pool if { $static::sftpdebug_pool > 1 } { log local0. "Client IP [IP::client_addr] not in data group. Using fallback pool." } pool sftp.f5.com_22_pool } } }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects