Basic iRule
Sirs and Ma'ams:
I'm new to F5 (even newer to iRules) and I'm stuck on comprehending the operators/commands. What I'm trying to do is handle traffic from Linux machines and send to one pool while Windows machines go to a separate pool. The work requirement is done by TCP port. The iRule documentation is overwhelming at this point since I have no prior coding experience. The F5 returns an error "01070151:3: Rule [/Common/iRule-redirect-Test] error: /Common/iRule-redirect-Test:2: error: [missing a script after "if"][ ] /Common/iRule-redirect-Test:3: error: [parse error: PARSE missingBracket 84 {missing close-bracket}][{ [TCP::local_port == 80 }] /Common/iRule-redirect-Test:7: error: [missing a script after "if"][ ]"
Here is what I have:
when CLIENT_ACCEPTED { if { [IP::addr [IP::remote_addr] equals x.x.x.x/24] } if { [TCP::local_port == 80 } { pool HTTP-Pool } if { [IP::addr [IP::remote_addr] equals x.x.x.x/24] } if { [TCP::local_port] == 22} { pool SSH-Pool } }