For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

jtostado_47719's avatar
jtostado_47719
Icon for Nimbostratus rankNimbostratus
Oct 21, 2009

BIGIP 4.5 to 9.3.1 iRule Conversion

I need help converting this rule:

 

 

if (http_uri ends_with one of portal_redirect_class) {

 

redirect to "https://psp-portal.com/portal/server.pt"}

 

else {

 

use pool SHAREPOINT

 

}

27 Replies

  • 01070151:3: Rule [DOL_Test] error:

     

    line 1: [undefined procedure: class] [class eligibility {

     

    type string

     

     

    "/web/onetime/Inquiry"

     

    "/web/onetime/Details"

     

    "/web/onetime/DaveInquiry"

     

     

    } ]

     

  • If i remove class eligibility then i am getting.....

     

     

    01070151:3: Rule [DOL_Test] error:

     

    line 1: [undefined procedure: class] [class images {

     

    ".jpg"

     

    ".gif"

     

    } ]

     

  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    The classes need to be defined separately from the iRule. You can do this in the GUI under Local Traffic >> iRules >> Datagroup List tab >> Create >> Type: string. After you create the classes, you can then create the iRule which references them.

     

     

    Aaron
  • Hello Aron,

     

     

    Thanks Alot it worked.

     

    One more help...i am facing issue with converting one more iRule.Please help me in converting this as well...

     

     

     

    if (client_addr == 10.1.8.2 netmask 255.255.255.255) {

     

    if (http_uri contains one of MemberEligibility) {

     

    use pool POOL_239_2

     

    }

     

    else {

     

    use pool POOL_239_1

     

    }

     

    }

     

    else if (client_addr == 10.1.6.2 netmask 255.255.255.255) {

     

    if (http_uri contains one of MemberEligibility) {

     

    use pool POOL_239_2

     

    }

     

    else {

     

    use pool POOL_239_1

     

    }

     

    }

     

    else if (client_addr == 10.2.8.2 netmask 255.255.255.255) {

     

    if (http_uri contains one of MemberEligibility) {

     

    use pool POOL_239_2

     

    }

     

    else {

     

    use pool POOL_239_1

     

    }

     

    }

     

    else if (client_addr == 10.2.6.2 netmask 255.255.255.255) {

     

    if (http_uri contains one of MemberEligibility) {

     

    use pool POOL_239_2

     

    }

     

    else {

     

    use pool POOL_239_1

     

    }

     

    }

     

    else if (client_addr == 10.2.8.5 netmask 255.255.255.255) {

     

    if (http_uri contains one of MemberEligibility) {

     

    use pool POOL_239_2

     

    }

     

    else {

     

    use pool POOL_239_1

     

    }

     

    }

     

    else if (client_addr == 10.2.8.4 netmask 255.255.255.255) {

     

    use pool POOL_239_ALL

     

    }

     

    else if (client_addr == 10.2.6.5 netmask 255.255.255.255) {

     

    use pool POOL_239_ALL

     

    }

     

    else if (client_addr == 10.2.3.5 netmask 255.255.255.255) {

     

    use pool POOL_239_3

     

    log "IVR request made."

     

    }

     

    else {

     

    log "Using generic rule (IT2). Unexpected IP: ${client_addr}"

     

    if (http_method == "GET") {

     

    log "GET method used."

     

    }

     

    else if (http_method == "POST") {

     

    log "POST method used."

     

    }

     

    else {

     

    log "Unexpected method used."

     

    }

     

    if (http_uri contains one of MemberEligibility) {

     

    use pool POOL_239_2

     

    log "Eligibility request made."

     

    }

     

    else if (http_uri ends_with one of images) {

     

    use pool POOL_239_ALL

     

    log "Image request made."

     

    }

     

    else {

     

    use pool POOL_239_1

     

    log "Generic request made."

     

    }

     

    }

     

  • Hello Battman, Please help me with the above mentioned irule also

     

    Thanks
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Hi Sumod,

     

     

    You can use matchclass to check whether a client IP is part of an address type datagroup. And you can also use matchclass to see if the requested URI is part of a string datagroup. [IP::client_addr] replaces ${client_addr}. You don't need to use "use pool" in 9/10.x; just "pool POOL_239_2" works. Also, you can combine client IP addresses that you want to send to the same pool in an address datagroup to reduce the number of IP checks you do. If you do want to check a single IP address or network, you can use the IP::addr command.

     

     

    Here are a few links:

     

     

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

     

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

     

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

     

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

     

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

     

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

     

     

    Aaron