Forum Discussion

Salvador_del_Re's avatar
Salvador_del_Re
Historic F5 Account
Feb 01, 2010

select server without a pool

I want redirect the trafic to a specific server but the server not´s belong to any pool.

 

I create a Virtual server without a pool and want pass the traffic to a server whith a iRule

 

My iRule have a global variables for get the ip server address and the port to redirect the traffic for this specific server

 

 

my rule that don´t run

 

 

when CLIENT_ACCEPTED {

 

log "origin IP address ===== $::ip_origen ===== port originao ==== $::puerto_origen ===="

 

LB::reselect $::ip_origen:$::puerto_origen

 

}

 

 

I try with reselect and another commands like translate but don´t run

 

 

My version it´s 10.1

 

 

Any ideas?

 

 

Thanks

3 Replies

  • Instead of using the LB::reselect command, you can use the node command to specify an arbitrary destination IP:port for the request.

     

     

    node

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/node

     

     

    Aaron
  • Salvador_del_Re's avatar
    Salvador_del_Re
    Historic F5 Account
    The final rule

     

     

    rule acepta_conexiones {

     

    when CLIENT_ACCEPTED {

     

    log "la ip de origen es ===== $::ip_origen ===== y el puerto es ==== $::

     

    puerto_origen ==== [IP::client_addr]"

     

    set ip_destino $::ip_origen

     

    set puerto_destino $::puerto_origen

     

    log "puerto destino $puerto_destino ip_destino $ip_destino"

     

    node $ip_destino $puerto_destino

     

    }

     

     

     

    The variables gets for the another rule applied to another VS

     

     

    when CLIENT_ACCEPTED {

     

    set ::ip_origen [IP::client_addr]

     

    set ::puerto_origen [TCP::local_port]

     

    snat 10.10.1.100

     

    }

     

     

  • I would be careful with setting a global variable based on the client IP address and VIP port on one virtual server and then using that on a separate virtual server to set the destination IP:port. If the first VIP hadn't been hit before the second VIP is, you'll get a TCL runtime error trying to use an undefined IP:port for the node command.

     

     

    If you want help setting this up, can you elaborate on what you're trying to configure and why?

     

     

    Thanks,

     

    Aaron