FQDN nodes in non-default route domains

Problem this snippet solves:

Currently there is no support for FQDN nodes in non-default route domains as per Article. With recent increase in cloud deployment, most of the time there is a requirement from F5 to load balance to servers or ELB in the cloud which has FQDN names as those are having dyanamic IP addresses. If you are using route domains in your BIGIP environment then this becomes a challenge.

 

Below iRule script can be used in those scenerios to use F5 to send traffic to FQDN nodes in non-default route domains.

How to use this snippet:

  • If FQDN needs to be resolved by your internal DNS, create performance layer 4 VIP (dns_53) load balancing your DNS servers.
  • DNS server can be used directly in the iRule itself, but it would be better to use a VIP to have redundancy.
  • Create iRule and apply to the VIP

Code :

when CLIENT_ACCEPTED { 
set host [RESOLV::lookup @dns_53 "server.example.com"]
set ip [getfield $host " " 1]
node [lindex $ip 0]%<Rd> 443 
}

Tested this on version:

14.1

Updated Jun 28, 2024
Version 2.0
  • wlopez's avatar
    wlopez
    Icon for Cirrocumulus rankCirrocumulus

    Has anybody gotten this to work?

    I can't see how this would work as is, since you would need to specify the port to complete the IP:port pool member combination.

    Even if it worked, I wonder how you reliable it would be as you would have no health monitors, stats or log events to troubleshoot any situations.

    I guess this code would be a piece of the puzzle.

  • Thanks for this. i am not an irule expert, but i am trying to understand the code. 

    set host [RESOLV::lookup @dns_53 "server.example.com"] -> So you are resolving the FQDN
    set ip [getfield $host " " 1] -> Extracting the hostname
    node [lindex $ip 0]%  -> I couldn get this one though!!, what it does. 

     

    • spalande's avatar
      spalande
      Icon for Nacreous rankNacreous

      There was a typo. Please check the correction above. It basically send the connection to node adding required route domain and port