2016/03/27

F5 iRules 設定

F5 iRules 設定
筆記一下

設定固定ip轉道設定的pool

when CLIENT_ACCEPTED {  
  if { [IP::addr [IP::remote_addr] equals 192.168.1.226/255.255.255.255] } {  
    pool xx_tt  
  } else {  
    pool xx_80
  }  
}  


設定固定ip轉道設定的pool下的member主機

when CLIENT_ACCEPTED {  
  if { [IP::addr [IP::remote_addr] equals 192.168.1.234/255.255.255.255] } {  
    pool xx_80 member 192.168.1.204 80
  } else {  
    pool xx_80
  }  
}

自動轉址abc網域任一網頁都轉到www.xyz.com.tw

when HTTP_REQUEST {
if { [HTTP::host] equals "abc.com.tw" }
{
 HTTP::redirect "http://www.xyz.com.tw[HTTP::uri]"

}

}


指定某些網頁http轉https (強制加密)

when HTTP_REQUEST {
      switch -glob [HTTP::path] {
      /a01.aspx* -
      /b03.aspx* -
      /Member.aspx* -
      /Login.aspx* -
      /login.aspx*{
      HTTP::redirect "https://[HTTP::host][HTTP::uri]"
      log local0. " Redirect client to https://[HTTP::host][HTTP::uri] "
}
}
}

指定某些網頁https轉http (強制不加密減輕ssl)
when HTTP_REQUEST {
      switch -glob [HTTP::path] {
      /abc.aspx* -
      /aa12.aspx* -
      /default.aspx*{
      HTTP::redirect "http://[HTTP::host][HTTP::uri]"
      log local0. " Redirect client to http://[HTTP::host] [HTTP::uri] "
}
}
}


檢查網頁回應狀態碼 轉到特定網址
when HTTP_RESPONSE {
 switch [HTTP::status] {
  "200" -
  "404" -
  "301" -
  "302" -
  "304" {
  }
  default {
  HTTP::redirect "http://www.aaa.com.tw/error/error.html"
  log local0. " Response code [HTTP::status] detected for server [IP::server_addr]"
  }
 }
}

檢查網址抬頭不是帶特定host就轉到 轉到特定網址
when HTTP_REQUEST {
if { not([HTTP::host] equals "www.abc.com.tw")}
{
 HTTP::redirect "http://www.abc.com.tw[HTTP::uri]"

}



}

2016/03/24

Apple TV 出現3905連線錯誤的解決方法

Apple TV 出現3905連線錯誤的解決方法
其實就是ATV本身在WIFI連線時沒有傳遞MAC ADDRESS給WIFI AP
所以當把WIFI中鎖定MAC ADDRESS上網的功能關閉後就一切正常了
這個問題在ATV  2016/3/24當下最新的韌體上仍未解決
或許在未來的新版本有可能會解決,但是目前來說唯一解法就是關閉MAC ADDRESS檢查


BTW~解決這問題的今天...是我的生日..但是....我並不好過, 哀~