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

jampa's avatar
jampa
Icon for Nimbostratus rankNimbostratus
Oct 10, 2019

Radware-F5 migration

Hello to all

I need an iRule for F5. I'm doing a migration from the Radware load balancer to F5, in this farm there's this writing:

 

/ c / slb / layer7 / httpmod Proxy_mstr_cnhind_com

                ena

/ c / slb / layer7 / httpmod Proxy_mstr_cnhind_com / rule 4 header

                ena

                action replace "FROMHEADERNAME = Host" "FROMVALUE = mstr.cnhind.com" "TOHEADERNAME = Host" "TOVALUE = mstr.cnhind.com"

/ c / slb / layer7 / httpmod Proxy_mstr_cnhind_com / rule 8 header

                ena

                action insert "HEADERNAME = X-Forwarded-Host" "VALUE = mstr.cnhind.com"

/ c / slb / layer7 / httpmod Proxy_mstr_cnhind_com / rule 9 header

                ena

                action insert "HEADERNAME = X-Forwarded-Server" "VALUE = mstr.cnhind.com"

 

 

can you help me to convert it into an F5 iRule

thank you so much

2 Replies

  • Hi

    This reads to me like you are just inserting the X-Forwarded-Host and X-Forwarded-Server headers. If so then this would work

    when HTTP_REQUEST {
    	HTTP::header insert "X-Forwarded-Host" "mstr.cnhind.com"
    	HTTP::header insert "X-Forwarded-Server" "mstr.cnhind.com"
    }

    You could refine this to check the Host header first.

    when HTTP_REQUEST {
    	if {[HTTP::header host value] eq "mstr.cnhind.com"} {
    	HTTP::header insert X-Forwarded-Host "mstr.cnhind.com"
    	HTTP::header insert X-Forwarded-Server "mstr.cnhind.com"
    }
    }

    The line to replace the Host header looks redundant to me as it's not changing the value of the header.