Forum Discussion

Nomar-13's avatar
Nomar-13
Icon for Nimbostratus rankNimbostratus
Feb 16, 2024

irule to Redirect client from specific Public IP to a specific node

Hello, I have a virtual server that is accessible by users on the internet with one pool.  This pool has 2 nodes.   I have a scenario where I need users coming from a specific PUBLIC IP to go to a ...
  • JRahm's avatar
    Feb 17, 2024

    Hi Nomar-13

    If the public IP is just a single IP and not a range, you do not want IP::addr as that is used for comparisons. Try something like this instead:

    when CLIENT_ACCEPTED {
      if { [IP::client_addr] == '192.168.1.100' } {
        set matched_ip 1
      } else { set matched_ip 0 }
    }
    when HTTP_REQUEST {
      if { $matched_ip } {
        node 10.10.1.1 80
      } else { node 10.10.1.2 80 }
    }