Forum Discussion

Drew666's avatar
Drew666
Icon for Nimbostratus rankNimbostratus
Sep 27, 2019

iRule Creation Query

Hi, Have created a very simple iRule to extract the incoming Client destination TCP ports using the switch cmd to redirect to specific nodes:   when HTTP_REQUEST  {     switch { TCP::local_port...
  • Enes_Afsin_Al's avatar
    Sep 27, 2019

    Hi Drew,

    Can you try this iRule?

    when HTTP_REQUEST {
        set port [TCP::client_port]
        # log local0. "Port: $port"
        
        if { ($port > 8000) and ($port < 8151) } {
        	set newlastoctet [expr $port - 7900]
        	# log local0. "NewLastOctet: $newlastoctet"
        	node "10.100.10.$newlastoctet:6660"
        }
    }