贴几个F5公司2005 iRule大赛的获奖iRule

这几天学习iRule,参考了F5网站上不少例子,顺便也把2005年iRule大赛的部分获奖iRule贴一下,一是备忘,二是供有需要的兄弟参考。

Tcl/Tk 代码
  1. F5网站上iRule大赛的获奖iRule   
  2.   
  3. rule web_request {   
  4.    when HTTP_REQUEST {   
  5.         set ramcache_enable 0   
  6.         if { [matchclass [IP::remote_addr] equals $::banned_ips] } {   
  7.             reject   
  8.         }   
  9.         if { [matchclass [HTTP::header Host] equals $::spec_hosts] } {   
  10.             if { [HTTP::header Host] starts_with "stat" } {   
  11.                 set ramcache_enable 1   
  12.                 use pool web_stat   
  13.             }   
  14.             elseif { [HTTP::header Host] starts_with "userpic" } {   
  15.                 use pool web_proxy   
  16.             }   
  17.             elseif { [HTTP::header Host] starts_with "files" } {   
  18.                 use pool web_proxy   
  19.             }   
  20.             elseif { [HTTP::header Host] starts_with "mrtg" } {   
  21.                 use pool web_mrtg   
  22.             }   
  23.         }   
  24.         elseif { [HTTP::uri] starts_with "/userpic/" } {   
  25.             if { [HTTP::header If-Modified-Since] contains ":" } {   
  26.                 HTTP::respond 304   
  27.             } else {   
  28.                 use pool web_proxy   
  29.             }   
  30.         }   
  31.         elseif { [HTTP::uri] starts_with "/directory.bml" } {   
  32.             use pool web_directory   
  33.         }   
  34.         elseif { [matchclass [HTTP::uri] starts_with $::static_dirs] } {   
  35.             set ramcache_enable 1   
  36.             use pool web_static   
  37.         }   
  38.         elseif { [HTTP::uri] starts_with "/interface/atom" } {   
  39.             use pool nokia_lifeblog   
  40.         } else {   
  41.             use pool web_proxy   
  42.         }   
  43.     }   
  44.     when CACHE_REQUEST {   
  45.         if { $ramcache_enable == 0 } {   
  46.             CACHE::disable   
  47.         }   
  48.     }   
  49. }   
  50.   
  51.   
  52. =======================================   
  53. when RULE_INIT {   
  54.   
  55.   set ::maxconnect 200   
  56.   set ::freezetime 600   
  57.   array set ::users { }   
  58.   array set ::spammers { }   
  59.   
  60. }   
  61. when CLIENT_ACCEPTED {   
  62.   
  63.   set clientip [IP::remote_addr]   
  64.   set now [clock second]   
  65.   
  66.   if { [ info exists ::spammers($clientip) ] } {   
  67.   
  68.     set timeelapsed [expr $now - $::spammers($clientip)]   
  69.     if { $::freezetime > $timeelapsed } {   
  70.       incr ::users(nb,$clientip)   
  71.       reject   
  72.       return  
  73.     }   
  74.     else {   
  75.       if { [ $::users(nb,$clientip) ] > $::maxconnect } {   
  76.         # this guy is still trying to spam, even when blacklisted   
  77.         # we keep him blacklisted, but we reset the counters   
  78.         set ::spammers($clientip) $now   
  79.         set ::users(nb,$clientip) 1   
  80.         set ::users(time,$clientip) $now   
  81.         log "client $clientip remains in spammerslist $::users(nb,$clientip    
  82.       connections rejected in the last $::freezetime seconds"   
  83.         reject   
  84.         return  
  85.       }   
  86.       else {   
  87.         unset ::spammers($clientip)   
  88.         log "client $clientip removed from spammerslist $::users(nb,$clientip)       connections rejected in the last $::freezetime seconds"   
  89.       }   
  90.     }   
  91.   }   
  92.   if { [ info exists ::users(nb,$clientip)] } {   
  93.     log "autre passage $clientip $now $::users(nb,$clientip)"   
  94.     incr ::users(nb,$clientip)   
  95.     if { $::users(nb,$clientip) > $::maxconnect } {   
  96.       set ::spammers($clientip) $now   
  97.       set ::users(nb,$clientip) 1   
  98.       set ::users(time,$clientip) $now   
  99.       log "client $clientip added to spammerslist $::users(nb,$clientip      connections accepted in the last $::freezetime seconds"   
  100.       reject   
  101.       return  
  102.     }   
  103.   } else {   
  104.     # First Time we see this clientip   
  105.     set ::users(nb,$clientip) 1   
  106.     set ::users(time,$clientip) $now   
  107.     log "PREMIER CLIENT $clientip $now"   
  108.   
  109.   }   
  110.   pool mail-smtp   
  111. }   
  112.   
  113.   
  114. ============================================   
  115. when RULE_INIT {   
  116.    # F5 iRule for performing rewriting of   
  117.    #    
  118.    # - HTTP-request URI:s    
  119.    #   
  120.    #   and   
  121.    #     
  122.    # - HTTP-response 'Location' headers   
  123.    #   (redirect rewrite's)   
  124.    #      
  125.    # Define URI rewrite rules here    
  126.    set ::request_rewrite  [list "/a /b" "/foo /bar"];   
  127.   
  128.    # Define Redirect Rewrite rules here   
  129.    set ::redirect_rewrite [list "http://10.1.2.3/a /b"]    
  130. }   
  131.   
  132. when HTTP_REQUEST {   
  133.   set uri [HTTP::uri];   
  134.   log LOCAL0.debug "URI=$uri";   
  135.   
  136.   # check all 'request_rewrite' rules..   
  137.   # break when first match is found..   
  138.   
  139.   foreach x $::request_rewrite {   
  140.       set a [getfield $x " " 1];   
  141.       log LOCAL0.debug "? uri start_with '$a' ...";   
  142.       if { $uri starts_with $a } {   
  143.           set b [getfield $x " " 2];   
  144.           log LOCAL0.debug "...yes, replace '$a' with '$b'";   
  145.           set len [string length $a];   
  146.           set tmp [substr $uri $len];     
  147.           set uri "${b}${tmp}";   
  148.           log LOCAL0.debug "URI=$uri";   
  149.           HTTP::uri $uri;   
  150.           break;   
  151.       }   
  152.   }   
  153. }   
  154.   
  155. when HTTP_RESPONSE {   
  156.   # check if redirect (HTTP status 3xx)   
  157.   # and 'Location:' header exists...   
  158.   #   
  159.   # return immediately if    
  160.   # there is nothing to rewrite   
  161.      
  162.   if { [HTTP::status] starts_with "3" } {   
  163.       set location [HTTP::header "Location"];   
  164.       if { $location == "" } {   
  165.           return;   
  166.       }   
  167.   } else {   
  168.       return;   
  169.   }   
  170.   
  171.   # check all 'ProxyPassReverse' entries..   
  172.   # and 'break' when first match is found...   
  173.   
  174.   log LOCAL0.debug "Location: $location (check for rewrites)";   
  175.     
  176.   foreach x $::redirect_rewrite {   
  177.       set a [getfield $x " " 1];   
  178.       log LOCAL0.debug " ? starts_with '$a' ... ";   
  179.       if { $location starts_with $a } {   
  180.           set b [getfield $x " " 2];   
  181.           log LOCAL0.debug "...yes, replace '$a' with '$b'";   
  182.           set len [string length $a];   
  183.           set tmp [substr $location $len];     
  184.           set location "${b}${tmp}";   
  185.           log LOCAL0.debug "Location: $location";   
  186.           HTTP::header replace "Location" $location;   
  187.           break;   
  188.       }   
  189.   }   
  190. }   
  191.   
  192. ==========================================   
  193. rule my-iRule {   
  194.    when CLIENT_ACCEPTED {   
  195.    if { [active_members my-pool] == 0 } {   
  196.       discard   
  197.       } else {   
  198.           use pool my-pool   
  199.            if { ([IP::client_addr] eq "1.1.1.8") || ([IP::client_addr] eq "1.2.1.8") } {   
  200.               persist none   
  201.            } else {   
  202.                persist source_addr 1800   
  203.            }   
  204.       }   
  205. }   
  206. }   
  207.   
  208.   
  209. ======================================   
  210. when HTTP_REQUEST {   
  211.     set DEBUG 1   
  212.   
  213.     if { $FINISHED } {   
  214.         return  
  215.     }   
  216.        
  217.     # REDIRECTS for So. Cal users   
  218.     set refer_host [URI::host [HTTP::header "Referer"]]   
  219.     log local0. "Referer: ${refer_host} IP: [IP::remote_addr]"   
  220.   
  221.     if { [IP::remote_addr] starts_with "10.120." } {   
  222.           if { not (${refer_host} starts_with "intranet") } {   
  223.                 if { [HTTP::uri] == "/" || [HTTP::uri] == "" || [HTTP::uri] == "/our/intranet/site"} {   
  224.                     if { $DEBUG } {   
  225.                        log local0. "SoCal redirect: [ IP::remote_addr ]"   
  226.                        log local0. "URI: [ HTTP::uri ]"   
  227.                        log local0. "Referer: ${refer_host}"   
  228.                     }   
  229.                    
  230.                     HTTP::redirect "http://${host}/intranet/socal"   
  231.                     set FINISHED 1   
  232.                     return  
  233.                 }   
  234.           }   
  235.     }   
  236. }   
  237.   
  238.   
  239. ==========================================   
  240. when HTTP_REQUEST {   
  241.   ##   
  242.   ## Default Variables   
  243.   ##   
  244.   set uriValue [HTTP::uri]   
  245.   set srcAddr [IP::remote_addr]   
  246.   set internalHost http://internal.example.com   
  247.   set sendCacheControl 0   
  248.   # 1 is compressed, 0 is not   
  249.   set compress_client_ok 1   
  250.   
  251.   ##   
  252.   ## Compression   
  253.   ##   
  254.   if { $srcAddr starts_with "10.1.1." } {   
  255.     # Disabling Compression for Client 1   
  256.     set compress_client_ok 0   
  257.   } elseif { $srcAddr starts_with "10.2.2." } {   
  258.     # Disabling Compression for Client 2   
  259.     set compress_client_ok 0   
  260.   } elseif { $srcAddr starts_with "10.3.3." } {   
  261.     # Disabling Compression for Client 3   
  262.     # Except for NPS   
  263.     if { $uriValue starts_with "/nps/" } {   
  264.       set compress_client_ok 1   
  265.     } else {   
  266.       set compress_client_ok 0   
  267.     }   
  268.   } elseif { $srcAddr starts_with "192.168.113." } {   
  269.     # The lab for testing   
  270.     set compress_client_ok 0   
  271.   }   
  272.   
  273.   ##   
  274.   ## Generic Redirects   
  275.   ##   
  276.   if { $uriValue starts_with "/forme" } {   
  277.     HTTP::uri /index.html   
  278.   } elseif { $uriValue starts_with "/formf" } {   
  279.     HTTP::uri /index_f.html   
  280.   } elseif { $uriValue starts_with "/fape" } {   
  281.     HTTP::uri /fapindex.html   
  282.   } elseif { $uriValue starts_with "/fapf" } {   
  283.     HTTP::uri /fapindex_f.html   
  284.   } elseif { $uriValue starts_with "/vace" } {   
  285.     HTTP::uri /vacindex.html   
  286.   } elseif { $uriValue starts_with "/vacf" } {   
  287.     HTTP::uri /vacindex_f.html   
  288.   } elseif { $uriValue starts_with "/idcd" } {   
  289.     HTTP::uri /idcd.html   
  290.   } elseif { $uriValue starts_with "/johnson" } {   
  291.     HTTP::uri /johnsonindex.html   
  292.   } elseif { $uriValue starts_with "/pplus" } {   
  293.     HTTP::redirect $internalHost/forms90/f90nosec?config=pplus   
  294.   }   
  295.   
  296.   ##   
  297.   ## Start the WebSphere 4 Configuration   
  298.   ##   
  299.   if { $uriValue starts_with "/sso/" } {   
  300.     HTTP::header replace HOST sso-app.example.com:8000   
  301.     pool was   
  302.   } elseif { $uriValue starts_with "/nps/" } {   
  303.     HTTP::header replace HOST nps-app.example.com:8000   
  304.     pool was   
  305.   } elseif { $uriValue starts_with "/qar/" } {   
  306.     HTTP::header replace HOST qar-app.example.com:8000   
  307.     pool was-qar   
  308.   } elseif { $uriValue starts_with "/prs" } {   
  309.     HTTP::header replace HOST prs-app.example.com:8000   
  310.     pool was   
  311.   } elseif { $uriValue starts_with "/inqportal/" } {   
  312.     HTTP::header replace HOST ip-app.example.com:8000   
  313.     pool was   
  314.   } elseif { $uriValue starts_with "/gmp/" } {   
  315.     HTTP::header replace HOST gmp-app.example.com:8000   
  316.     pool was   
  317.   } elseif { $uriValue starts_with "/lws/" } {   
  318.     HTTP::header replace HOST lw-app.example.com:8000   
  319.     pool was   
  320.   } elseif { $uriValue starts_with "/oms/" } {   
  321.     HTTP::header replace HOST om-app.example.com:8000   
  322.     pool was   
  323.   } elseif { $uriValue starts_with "/es/" } {   
  324.     if { $uriValue contains "u_.uhtml" } {   
  325.       set sendCacheControl 1   
  326.     }   
  327.     pool was-es   
  328.   } elseif { $uriValue starts_with "/wsso/" } {   
  329.     regsub "/wsso/" $uriValue "/" newURI   
  330.     HTTP::header replace HOST abcclogin-app.example.com:8000   
  331.     HTTP::uri $newURI   
  332.     pool was   
  333.   } elseif { $uriValue starts_with "/ABCCLogin/" } {   
  334.     HTTP::header replace HOST abcclogin-app.example.com:8000   
  335.     pool was   
  336.   }   
  337.   
  338.   ##   
  339.   ## Starting the Oracle Application Server Configuration   
  340.   ##   
  341.   if { $uriValue starts_with "/discoverer/osso_login_success" } {   
  342.     regsub "/discoverer/" $uriValue "/" newURI   
  343.     HTTP::uri $newURI   
  344.     pool oas-disco   
  345.   } elseif { $uriValue starts_with "/discoverer/osso_logout_success" } {   
  346.     regsub "/discoverer/" $uriValue "/" newURI   
  347.     HTTP::uri $newURI   
  348.     pool oas-disco   
  349.   } elseif { $uriValue starts_with "/osso_login_success" } {   
  350.     if { [HTTP::header refer] contains "/discoverer/" } {   
  351.       pool oas-disco   
  352.     } else {   
  353.       pool oas-app   
  354.     }   
  355.   } elseif { $uriValue starts_with "/osso_logout_success" } {   
  356.     if { [HTTP::header refer] contains "/discoverer/" } {   
  357.       pool oas-disco   
  358.     } else {   
  359.       pool oas-app   
  360.     }   
  361.   } elseif { $uriValue starts_with "/portal/pls/" } {   
  362.     regsub "/portal/" $uriValue "/" newURI   
  363.     HTTP::uri $newURI   
  364.     pool oas-app   
  365.   } elseif { $uriValue starts_with "/infra/pls/" } {   
  366.     regsub "/infra/" $uriValue "/" newURI   
  367.     HTTP::uri $newURI   
  368.     pool oas-infra   
  369.   } elseif { $uriValue starts_with "/sso_mes/forms90/" } {   
  370.     regsub "/sso_mes/" $uriValue "/" newURI   
  371.     HTTP::uri $newURI   
  372.     pool oas-app   
  373.   } elseif { $uriValue starts_with "/sso_cmf/forms90/" } {   
  374.     regsub "/sso_cmf/" $uriValue "/" newURI   
  375.     HTTP::uri $newURI   
  376.     pool oas-app   
  377.   } elseif { $uriValue starts_with "/orasso/" } {   
  378.     regsub "/orasso/" $uriValue "/pls/orasso" newURI   
  379.     HTTP::uri $newURI   
  380.     pool oas-infra   
  381.   } elseif { $uriValue starts_with "/reports" } {   
  382.     pool oas-app   
  383.   } elseif { $uriValue starts_with "/forms90" } {   
  384.     pool oas-app   
  385.   } elseif { $uriValue starts_with "/discoverer" } {   
  386.     pool oas-disco   
  387.   } elseif { $uriValue starts_with "/jinitiator" } {   
  388.     pool oas-app   
  389.   } elseif { $uriValue starts_with "/vac/" } {   
  390.     pool oas-app   
  391.   } elseif { $uriValue starts_with "/icons/" } {   
  392.     pool oas-app   
  393.   } elseif { $uriValue starts_with "/images/" } {   
  394.     pool oas-app   
  395.   } elseif { $uriValue starts_with "/pls/" } {   
  396.     pool oas-infra   
  397.   }   
  398.   
  399.   ##   
  400.   ## Starting the WebSphere 6 Configuration   
  401.   ##   
  402.   if { $uriValue starts_with "/UWAWeb/" } {   
  403.     pool was6   
  404.   } elseif { $uriValue starts_with "/RAWeb/" } {   
  405.     pool was6   
  406.   } elseif { $uriValue starts_with "/PlanAA" } {   
  407.     pool was6   
  408.   } elseif { $uriValue starts_with "/GroupCCWeb/" } {   
  409.     pool was6   
  410.   } elseif { $uriValue starts_with "/AgentBonusWeb/" } {   
  411.     pool was6   
  412.   } elseif { $uriValue starts_with "/ftp/" } {   
  413.     pool was6   
  414.   } elseif { $uriValue starts_with "/PMP/" } {   
  415.     pool was6   
  416.   }   
  417.   
  418.   ##   
  419.   ## End of HTTP_REQUEST Configuration   
  420.   ##   
  421. }   
  422.   
  423. when HTTP_RESPONSE {   
  424.   ##   
  425.   ## Default Variables for this Section   
  426.   ##   
  427.   set location [HTTP::header location]   
  428.   set destHost "//internal.example.com"   
  429.   set sunHost "//bcsun...example.com:800."   
  430.   set unifiHost "-app.example.com:8000"   
  431.   set wwwHost "//wserv1.example.com"   
  432.   set webAppHost "//webappi.example.com"   
  433.   set hdr_content_type [string tolower [HTTP::header Content-Type]]   
  434.   
  435.   ##   
  436.   ## Compression   
  437.   ##   
  438.   if { $hdr_content_type starts_with "text/" or    
  439.        $hdr_content_type equals "application/x-javascript" or    
  440.        $hdr_content_type equals "application/xml" } {   
  441.     if { $compress_client_ok == 1 } {   
  442.       COMPRESS::enable   
  443.       HTTP::header insert Vary Accept-Encoding   
  444.     }   
  445.   }   
  446.   
  447.   ##   
  448.   ## Sending HTTP/1.1 Cache-Control Header if required   
  449.   ##   
  450.   if { $sendCacheControl equals 1 } {   
  451.     HTTP::header replace Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"   
  452.   }   
  453.   
  454.   ##   
  455.   ## Ensuring the location header is correct   
  456.   ##   
  457.   if { [regexp "\/\/....$unifiHost" $location] } {   
  458.     regsub "\/\/....$unifiHost" $location $destHost newLocation   
  459.     HTTP::header replace location $newLocation   
  460.   } elseif { [regexp "\/\/...$unifiHost" $location] } {   
  461.     regsub "\/\/...$unifiHost" $location $destHost newLocation   
  462.     HTTP::header replace location $newLocation   
  463.   } elseif { [regexp "\/\/..$unifiHost" $location] } {   
  464.     regsub "\/\/..$unifiHost" $location $destHost newLocation   
  465.     HTTP::header replace location $newLocation   
  466.   } elseif { $location contains $wwwHost } {   
  467.     regsub $wwwHost $location $destHost newLocation   
  468.     HTTP::header replace location $newLocation   
  469.   } elseif { $location contains $webAppHost } {   
  470.     regsub $webAppHost $location $destHost newLocation   
  471.     HTTP::header replace location $newLocation   
  472.   } elseif { $location contains $sunHost } {   
  473.     regsub $sunHost $location $destHost newLocation   
  474.     HTTP::header replace location $newLocation   
  475.   }   
  476.   
  477.   ##   
  478.   ## End of HTTP_RESPONSE Configuration   
  479.   ##   
  480. }   
  481.   
  482. ============================================   
  483. when RULE_INIT {       
  484.         array set ::CLIENT_SERVERS {    
  485.     #SITE B CLIENT SERVERS    
  486.     #SERVER IP #SERVER VIP    
  487.     10.10.70.128 10.10.69.50    
  488.     10.10.70.129 10.10.69.50    
  489.     10.10.70.130 10.10.69.50    
  490.     10.10.70.131 10.10.69.50    
  491.     10.10.70.132 10.10.69.50    
  492.     10.10.70.133 10.10.69.50    
  493.     10.10.70.134 10.10.69.50&
网络安全 | F5 WAF 黑白名单配置实践指南 F5 WAF 的黑白名单功能允许管理员根据 IP 地址、URL 或其他条件对流量进行分类和控制。通过将特定的 IP 地址或子网添加到白名单中,可以确保这些流量不会被误拦截;而将已知的恶意 IP 地址添加到黑名单中,则可以有效阻止这些流量。通过结合 Data Group 和 iRules,F5 WAF 的黑白名单功能可以实现更灵活、更高效的流量控制策略。合理使用这些工具,不仅可以提高系统的安全性,还可以优化性能,确保业务的平稳运行。 阅读详情

相关推荐

F5 iRules入门学习笔记

基本介绍IRules主要应用在F5负载均衡设备GTM、LTM和LC,它使用的是TCL语言,由事件、命令和逻辑三部分组成。它可以工作在OSI模型的3-7层,根据协议的不同,实现不同的功能。IRules的功能:1、实现了对所有TCP、UDP应用的数据包分析与信息提取功能;2、根据数据信息进行分流;3、双向的数据流改写功能;4、选择性地址转换(iSNAT);5、基于内容的会话保持。...

weixin_34332905的博客 4278

F5负载均衡配置

配置实例详解 一、设备环境: F5产品 2、配置会话保持60分钟; 3、配置获取客户端真实IP地址功能(通过x-forwarded-for参数的http头获取); 三、概念: Node:节点,用过负载的real主机 Pool:池、组,把node节点加入到一个组,对该组做一些局部配置。 Virtualserver:虚拟服务,就是指负载均衡的VIP地址,也是客户端最终访问的负载地址,以及该实例的一些特殊配置等。 下面是F5的操作界面,有关规则操作都【Local Traffic】菜单下。

Jian Sun_的博客 2万+

F5 iRule示例综合展示

else {

cnxhsy的博客 966

认识F5 Irules

什么是iRules? iRules是F5基于TCL语言的定制脚本扩展模块(可在F5的官方网站上下载iRules Editor,方便阅读与编写),通过这个模块,您可以对F5公司的产品随心所欲地再定义,使得该产品更好地×××。笔者在写这篇文章的时候在网络上针对iRules的用法进行过相关的调查,发现了一个很有意思的例子,现在拿出来和大家分享一下,以便与您能够更好的理...

weixin_34272308的博客 1082

50个精选F5 iRule代码与应用场景解析

F5 iRules是一种高级网络配置技术,它允许用户自定义网络流量的行为,从而提供精细化的控制和灵活性。通过iRules,网络管理员能够编写脚本来处理进入和离开F5设备的网络流量,实现复杂的应用层策略。用户定义的变量可以用来记录客户端特定的信息或之前请求的响应,然后基于这些变量进行路由选择。这允许管理员根据用户的会话状态,而不是仅仅基于单次请求,进行智能路由决策。在Web应用中,错误页面是用户在遭遇问题时首先接触到的反馈界面。

weixin_35754962的博客 1623

iRule Editor最新版详解与应用

F5设备是网络负载均衡与应用交付领域的领导者,它为现代数据中心提供了一系列解决方案,以保证业务连续性、提高应用程序的性能和安全性。F5设备通过智能流量管理,确保用户能够以最佳的体验访问应用程序,无论是在本地还是云端。性能优化是新版 iRule Editor 的另一大亮点。通过优化代码解析算法和内存使用,编辑器对大型脚本的处理速度有了显著提高,减少了卡顿和延迟,让大项目的开发更加流畅。graph LRA[开始编辑 iRule] -->|加载模板库| B(选择模板)

weixin_34520664的博客 908

F5负载均衡上使用iRule 来选择SNAT pool

需求:使用iRule 根据不同目的地址或端口,来选择SNAT 地址 ,实现相同的后台节点,访问不同目的地址或者目的端口时,源地址也会不同; 网络概况:内网:后台节点server:192.168.10.71对应VLAN: Internal-selfIP: 192.168.10.1外网:客户端client: 172.16.10.172对应VLAN: external-selfIP: 172....

weixin_33804990的博客 1471

iRules的介绍---F5中的重要内容

iRule是F5 BIG-IP设备提供的功能强大的灵活特性,它是基于F5独一无二的TMOS架构。iRule将给你带来无与伦比的对流量的直接操控和对任意IP应用流量的管理。iRules使用的是简单易用的脚本语法,可以让你自定义如何截取,检查,转换和引导inbound和oubound的应用流量

f5的irules和packet filters两个功能的使用

最近公司网站受到了几次***,结合了nginx服务器的iptables和f5来抵御*** 以下是在f5上使用了的的两种安全策略 packet filters (包过滤。替代了nginx服务器上的iptables) :在network=>packet filters下创建规则 action (none | accept | discard | re...

weixin_34292402的博客 459

F5 irule编程指南手册

F5 irule编程指南手册,包括条件、动作,以及如何触发irule脚本环境等等内容

F5 IRULE 介绍

F5 IRULE

一个 F5 irule 的例子

//完成根据HTTP请求的uri组成,选用不用的节点池作为投递目标的例子  when HTTP_REQUEST{   set pool "Pool"   if { [HTTP::method] == "GET" }   {       set URI [HTTP::uri]       set URI_MID [lindex [split $URI "/"] 2]       if {

morenzhanghu的专栏 2131

f5 iRules 配置电子书

f5 irules 配置电子书 Wiki-iRulesWiki-iRulesWiki-iRules

Tcl为F5 LTM编写iRule

  什么是TCL?使用什么开发调试工具?参考资料? 什么是F5 LTM? 什么是iRule? 使用TCL为F5 LTM设备写iRule 在F5 LTM设备上应用iRule         Tcl("Tool Command Language",“工具命令语言”)一种 脚本语言。 由John Ousterhout创建,关于TCL的历史可以参考:源文档 h

坚强2002@优快云 1332

F5全球领先的负载均衡厂商介绍

F5作为全球领先的负载均衡厂商,在业界有着非常好的口碑,作为F5的售前工程师也很荣幸,这个PPT是我为客户介绍F5使用的稿件,希望对想了解F5,了解负载均衡的人带来帮助。

Unity安卓打包实战:SDK与JDK配置全攻略

本文详细介绍了Unity安卓打包过程中SDK与JDK的配置方法,包括工具下载、安装步骤、环境变量设置及常见错误排查。通过实战指南帮助开发者快速完成Unity安卓打包环境搭建,提升开发效率。

weixin_30338481的博客 416

F5 Irule学习记1

[背景]以前为一个项目学习过一段时间的Irule,最近又因其他需求,需要将其拾其,但突然发现,以前学的没有做整理,有点遗忘,这次想将学习的过程记录下来.什么是Irule,我想大家google下,肯定会比我说的还详细.对与它能干什么,我想说的是它什么都能做,当然是在进入到流出F5这段时间里.所以,我们可以在数据流进入后,修改相应的数据包,重构请求包,或者在后端服务器相应后,做出相应内容的重写,都是可...

weixin_34306593的博客 473

ABB机器人与西门子PLC、工业相机联合实现无序抓取的完整调试方案

将此方案导入系统后,逐步执行调试,确保各环节信号正常触发,即可实现高效无序抓取!

CHUXUEZHE8210的博客 1993

F5集群配置公共irule,解决X-Frame-Options漏洞及host头漏洞

为什么80%的码农都做不了架构师?>>> ...

weixin_34004576的博客 618

STM32CUBEMX+STM32H750VB+LWIP+LAN8720A+FREERTOS TCP服务器、UDP数据接收发送、网线热插拔、IAR-8.32开发

STM32CUBEMX+STM32H750VB+LWIP+LAN8720A+FREERTOS TCP服务器、UDP数据接收发送、网线热插拔、IAR-8.32开发STM32H750VB使用STM32CUBEMX生成工程IAR+J-LINK调试准备工作CUBEMX生成的代码问题所在如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章U

qq_37433166的博客 5345

calibre:将calibre 的layer number 转换为实际的laymer 名称(7)

可以使用与版图数据库配套的(Standard Verification Rule Format,标准验证规则格式),在 Calibre DESIGNrev 中加载图层名称。

u013620135的博客 984

编写 iRule

• iRule 简介 • 创建iRule • 控制对iRule 的选择运用 • 指定工具命令 • 指定流量目的地和地址转换 • 查询标头或内容数据 • 处理标头或内容数据 • 使用UIE 函数命令 • 使用Profile • 通过iRule 启用会话持续性 • 创建、管理和使用数据组 • 覆盖Profile 设置 iRule简介 iRule 是BIG-IP®本地流量管理(

xo_zhang的专栏 4823

华为OD机试 - 小扇和小船的数字游戏 - 二进制(Python/JS/C/C++ 2024 C卷 200分)

二进制表示:任何数 n 的二进制表示中,要找到下一个有相同数量的1的数,我们需要在最低位的0后面的最低位的1进行操作。右侧交换法则:找到右侧的第一个0,位于第一个1的左边,将这个0变成1(提升这个位),并将这个1变成0(下移这个位)。调整尾部1:为了得到最小的数,将所有低于已交换的1的位重置,使得所有1尽可能靠右。

学Java,找哪吒 1162
上一篇: 贴几个自己写的BigIP F5的iRule
下一篇: 有人知道根据Session ID如何取得Session对象吗?
benwdm
博客等级 码龄26年 87粉丝 467原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值