Forum Discussion

usengar-oracle_'s avatar
usengar-oracle_
Icon for Nimbostratus rankNimbostratus
Apr 13, 2017

2 rules in same VIP

Hi

I want to apply 2 different iRules in a VIP, one iRule is already applied on the VIP and need to apply 1 more for HSTS.

please let me know, do i need to merge the new one to existing one or i can apply both independently one after the other.

And need to apply the below one also on the same VIP

ltm rule hsts_insert_rule {
when HTTP_RESPONSE

{ HTTP::header insert Strict-Transport-Security "max-age=31536000" } }

2 Replies

  • zeiss_63263's avatar
    zeiss_63263
    Historic F5 Account

    You can apply multiple iRules to a Virtual Server. They are evaluated in order.

     create ltm virtual myvirtual destination 1.1.1.1:80 rules { myrule_two myrule_one }
    
     list ltm virtual myvirtual
    ltm virtual myvirtual {
        destination 1.1.1.1:http
        mask 255.255.255.255
        profiles {
            fastL4 { }
        }
        rules {
            myrule_two
            myrule_one
        }
        source 0.0.0.0/0
        translate-address enabled
        translate-port enabled
        vs-index 3
    }
    

    You may create or modify either via tmsh, REST or the web UI.

    • usengar-oracle_'s avatar
      usengar-oracle_
      Icon for Nimbostratus rankNimbostratus

      Do we need to set some priority too on these iRules..?

       

      however they are for different Events..

       

      first one checked white-listing of source IP, if source IP exist in the list then allowed to access the VIP and the other one is for HSTS..

       

      first one is already applied so we need to modify the VIP config, is below config correct..?

       

      modify ltm virtual /Public/vs_htsvhypdev1_em3_xxx_com_443_new rules { saas_sdi_vpn_whitelist_rule hsts_insert_rule }