Forum Discussion

panom_109529's avatar
panom_109529
Icon for Nimbostratus rankNimbostratus
Sep 18, 2007

How to forward traffic to virtual server in irule?

I want F5 forwards traffic that receive through Virtual server to another virtual server in the same F5 by using irules.How i create irule for that requirement?

 

 

First i try below irule but it dose not pass and return error.

 

 

irules are following :

 

 

when CLIENT_ACCEPTED {

 

set server_ip [ IP::local_addr ]

 

set client_ip [ IP::client_addr ]

 

if {$client_ip =="0.0.0.0"} {

 

discard

 

return

 

}

 

 

if { [ matchclass $server_ip equals $::host_for_transparent_proxy ] } {

 

log local0.info " (TPROXY ROUTE)'$client_ip' ---> Divert to MSP '$server_ip'"

 

use node 10.217.164.212 8080

 

return

 

} elseif { [ matchclass $client_ip equals $::net_for_mobile_ip_test0045_apn ] } {

 

log local0.info " (WA-Proxy ROUTE)'$client_ip' ---> Divert to WA '$server_ip'"

 

persist source_addr

 

use pool WA_8080_pool

 

return

 

} else {

 

log local0.info " (TPROXY ROUTE)'$client_ip' ---> Forward to '$server_ip'"

 

virtual ANY-Forward

 

}

 

}

 

ANY-Forward is virtual server on that F5

 

 

error are following :

 

01070151:3: Rule [test] error:

 

line 20: [invalid keyword "ANY-FORWARD" must be: name] [ANY-FORWARD]

 

 

1 Reply

  • spark_86682's avatar
    spark_86682
    Historic F5 Account
    It looks like you're not running a recent enough version of the BIG-IP software. That ability is only in v9.4.0 and later releases.

     

     

    In the example you've given, the syntax you're using is correct, but it's expecting "virtual name" (which will return the name of the current virtual server). See http://devcentral.f5.com/wiki/default.aspx/iRules/virtual.html for details.