F5 BIG-IP
エンタープライズ向けアプリケーション配信コントローラー。高度なロードバランシング、DDoS保護、WAF、SSL処理を統合。
サーバー
F5 BIG-IP
概要
F5 BIG-IPは、業界をリードするアプリケーション配信コントローラー(ADC)として、企業環境において最も信頼性の高いロードバランサー・プロキシソリューションです。真のフルプロキシアーキテクチャを採用し、クライアント側とサーバー側で独立した接続を維持することで、トラフィックの動的な拡張と最適化を実現します。Local Traffic Manager(LTM)、DNS、Access Policy Manager(APM)等の幅広いソフトウェアモジュールにより、負荷分散、セキュリティ、パフォーマンス最適化を包括的に提供します。オンプレミス、クラウド、ハイブリッド環境での柔軟な導入が可能で、大規模なエンタープライズアプリケーションに対応します。
詳細
F5 BIG-IPは、市場で唯一の真のフルプロキシを提供し、クライアント接続とサーバー接続を完全に分離して管理します。この独自のアーキテクチャにより、トラフィックの詳細な制御と変換が可能になります。LTM(Local Traffic Manager)モジュールは、高度なロードバランシング、SSL終端・ブリッジング、アプリケーションセキュリティ機能を提供します。iRulesプログラミング言語により、カスタムロジックの実装が可能で、複雑なトラフィック制御要件に対応できます。また、APMによる認証・認可機能、DNSモジュールによるインテリジェントなトラフィックルーティング等、包括的なアプリケーション配信機能を備えています。
主な特徴
- フルプロキシアーキテクチャ: クライアント・サーバー接続の完全分離による高度なトラフィック制御
- 包括的なセキュリティ: SSL処理、DDoS保護、Webアプリケーションファイアウォール
- 高度な負荷分散: 多様なアルゴリズムとヘルスチェックによる最適な負荷分散
- iRulesプログラミング: 柔軟なカスタムロジック実装による複雑な要件への対応
- モジュラー設計: LTM、APM、DNS等の専門モジュールによる機能拡張
- ハイアベイラビリティ: アクティブ・パッシブ構成による無停止運用
メリット・デメリット
メリット
- エンタープライズ環境における実績豊富な安定性と信頼性
- フルプロキシによる詳細なトラフィック制御とパフォーマンス最適化
- SSL終端・ブリッジング機能による暗号化処理の効率化
- 包括的なセキュリティ機能による多層防御の実現
- iRulesによる柔軟なカスタマイゼーションと複雑な要件への対応
- 豊富なモジュールによる統合的なアプリケーション配信プラットフォーム
デメリット
- 高額なライセンス費用と継続的な保守コスト
- 設定・運用に専門知識が必要で学習コストが高い
- 過度に高機能で小規模環境には不適切
- ベンダーロックインリスクと移行困難性
- クラウドネイティブ環境では複雑化する場合がある
- ライセンスモデルの複雑さとコンプライアンス管理の負担
参考ページ
書き方の例
基本設定とVirtual Server
# tmsh (Traffic Management Shell) による設定
# ノード(バックエンドサーバー)定義
tmsh create ltm node web1 { address 192.168.1.10 }
tmsh create ltm node web2 { address 192.168.1.11 }
tmsh create ltm node web3 { address 192.168.1.12 }
# プール(サーバーグループ)作成
tmsh create ltm pool web_pool {
members {
web1:80 { address 192.168.1.10 }
web2:80 { address 192.168.1.11 }
web3:80 { address 192.168.1.12 }
}
monitor http
load-balancing-mode round-robin
}
# Virtual Server(ロードバランサーエンドポイント)作成
tmsh create ltm virtual web_vs {
destination 10.1.1.100:80
pool web_pool
source-address-translation { type automap }
profiles {
http { }
tcp { }
}
}
# 設定保存
tmsh save sys config
SSL終端設定
# SSL証明書とキーのインポート
tmsh install sys crypto cert server.crt from-local-file /var/tmp/server.crt
tmsh install sys crypto key server.key from-local-file /var/tmp/server.key
# SSL プロファイル作成
tmsh create ltm profile client-ssl web_ssl_profile {
cert server.crt
key server.key
ciphers "HIGH:!aNULL:!MD5:!RC4"
options { dont-insert-empty-fragments }
}
# HTTPS Virtual Server作成
tmsh create ltm virtual web_https_vs {
destination 10.1.1.100:443
pool web_pool
source-address-translation { type automap }
profiles {
web_ssl_profile {
context clientside
}
http { }
tcp { }
}
}
# HTTPからHTTPSへのリダイレクト
tmsh create ltm virtual web_http_redirect {
destination 10.1.1.100:80
profiles {
http { }
tcp { }
}
rules { http_to_https_redirect }
}
ヘルスチェック設定
# カスタムHTTPヘルスチェック作成
tmsh create ltm monitor http web_health_check {
defaults-from http
destination "*:80"
interval 10
timeout 31
send "GET /health HTTP/1.1\r\nHost: example.com\r\nConnection: Close\r\n\r\n"
recv "HTTP/1.1 200"
recv-disable "HTTP/1.1 503"
}
# データベースヘルスチェック
tmsh create ltm monitor mysql db_health_check {
defaults-from mysql
destination "*:3306"
interval 30
timeout 91
username dbmonitor
password dbpass123
database testdb
send "SELECT 1"
recv "1"
count 3
}
# プールにヘルスチェック適用
tmsh modify ltm pool web_pool monitor web_health_check
tmsh modify ltm pool db_pool monitor db_health_check
高度な負荷分散設定
# 重み付きラウンドロビン設定
tmsh modify ltm pool web_pool {
members modify {
web1:80 { priority-group 10 ratio 3 }
web2:80 { priority-group 10 ratio 2 }
web3:80 { priority-group 5 ratio 1 }
}
load-balancing-mode ratio-member
}
# 永続化(セッション維持)設定
tmsh create ltm persistence source-addr web_persistence {
defaults-from source_addr
timeout 1800
mask 255.255.255.0
}
tmsh modify ltm virtual web_vs {
persist {
web_persistence {
default yes
}
}
}
# Cookieベース永続化
tmsh create ltm persistence cookie web_cookie_persistence {
defaults-from cookie
cookie-name "F5_BIGIP"
expiration 0
method insert
}
iRules実装
# HTTP to HTTPS リダイレクト iRule
when HTTP_REQUEST {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
# コンテンツベースルーティング
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/api/*" {
pool api_pool
}
"/admin/*" {
pool admin_pool
}
"/images/*" -
"/css/*" -
"/js/*" {
pool static_pool
}
default {
pool web_pool
}
}
}
# セキュリティ強化 iRule
when HTTP_REQUEST {
# 不正なUser-Agentをブロック
if { [HTTP::header "User-Agent"] matches_regex "(?i)(bot|crawler|spider)" } {
HTTP::respond 403 content "Access Denied"
return
}
# SQLインジェクション検出
if { [HTTP::query] matches_regex "(?i)(union|select|insert|delete|drop)" } {
log local0. "SQL Injection attempt from [IP::client_addr]: [HTTP::query]"
HTTP::respond 403 content "Malicious request detected"
return
}
# レート制限
set client_ip [IP::client_addr]
set current_time [clock seconds]
set rate_limit_key "rate_limit_$client_ip"
if { [table lookup $rate_limit_key] == "" } {
table set $rate_limit_key 1 indef 60
} else {
set request_count [table incr $rate_limit_key]
if { $request_count > 100 } {
HTTP::respond 429 content "Rate limit exceeded"
return
}
}
}
# レスポンス圧縮
when HTTP_RESPONSE {
if { [HTTP::header "Content-Type"] matches_regex "(?i)(text|application)" } {
COMPRESS::enable
}
}
ハイアベイラビリティ設定
# デバイストラスト設定
tmsh modify cm device-trust {
ca-devices add { standby-unit.example.com }
device-name active-unit.example.com
}
# デバイスグループ作成
tmsh create cm device-group ha_group {
type sync-failover
devices {
active-unit.example.com
standby-unit.example.com
}
auto-sync enabled
save-on-auto-sync enabled
}
# VLANフェイルセーフ設定
tmsh modify net vlan internal {
failsafe enabled
failsafe-action go-offline-restart-tm
}
# トラフィックグループ設定
tmsh create cm traffic-group traffic-group-1 {
ha-order {
active-unit.example.com
standby-unit.example.com
}
auto-failback-enabled true
auto-failback-time 60
}
# 同期実行
tmsh run cm config-sync to-group ha_group
APM(Access Policy Manager)設定
# 認証ポリシー作成
tmsh create apm policy web_auth_policy {
default-language en
type ltm-apm
}
# LDAP認証設定
tmsh create apm aaa ldap ldap_auth {
server ldap.example.com
port 389
admin-name "cn=admin,dc=example,dc=com"
admin-password admin123
user-base-dn "ou=users,dc=example,dc=com"
user-name-attribute uid
group-base-dn "ou=groups,dc=example,dc=com"
group-name-attribute cn
group-member-attribute member
}
# 多要素認証設定
tmsh create apm aaa radius radius_mfa {
server radius.example.com
port 1812
secret shared_secret_key
nas-id-value "F5-BIG-IP"
}
# アクセスプロファイル作成
tmsh create apm profile access web_access_profile {
accept-languages { en ja }
default-language en
policy web_auth_policy
}
# Virtual ServerへのAPM適用
tmsh modify ltm virtual web_vs {
profiles add {
web_access_profile {
context all
}
}
}
パフォーマンス最適化
# TCP最適化プロファイル
tmsh create ltm profile tcp tcp_optimized {
defaults-from tcp-wan-optimized
congestion-control bbr
initial-congestion-window-size 10
initial-receive-window-size 64
receive-window-size 131072
send-buffer-size 262144
tcp-options { selective-acks time-stamps window-scaling }
}
# HTTP最適化プロファイル
tmsh create ltm profile http http_optimized {
defaults-from http
compress-gzip level 6
compress-buffer-size 4096
oneconnect-transformations enabled
response-chunking unchunk
server-agent-name "F5-BIG-IP"
}
# キャッシュプロファイル
tmsh create ltm profile web-acceleration cache_profile {
defaults-from optimized-caching
cache-size 100m
cache-aging-rate 9
cache-client-cache-control-mode all
cache-insert-age-header enabled
}
# Virtual Serverに最適化プロファイル適用
tmsh modify ltm virtual web_vs {
profiles modify {
tcp { context all }
http { context all }
}
profiles add {
tcp_optimized { context all }
http_optimized { context all }
cache_profile { context all }
}
}
モニタリングと分析
# 統計情報確認
tmsh show ltm virtual web_vs
tmsh show ltm pool web_pool
tmsh show ltm pool web_pool members
# 接続状況確認
tmsh show sys connection
tmsh show sys connection count
# パフォーマンス統計
tmsh show ltm virtual web_vs stat
tmsh show ltm pool web_pool stat
# ログ設定
tmsh modify sys syslog {
remote-servers add {
syslog.example.com {
host syslog.example.com
local-ip 10.1.1.100
remote-port 514
}
}
}
# HSL(High Speed Logging)設定
tmsh create ltm pool hsl_pool {
members {
syslog.example.com:514 {
address syslog.example.com
}
}
}
tmsh create ltm logdest syslog hsl_dest {
pool hsl_pool
protocol udp
}
tmsh create ltm publisher hsl_pub {
destinations {
hsl_dest
}
}
トラブルシューティング
# ログ確認
tmsh show sys log ltm
tmsh show sys log tmm
# 接続テーブル確認
tmsh show sys connection ss-server-addr 192.168.1.10
# プール状態確認
tmsh show ltm pool web_pool detail
# Virtual Server状態確認
tmsh show ltm virtual web_vs profiles
# ネットワークトラブルシューティング
tmsh run util tcpdump -i 0.0 -s0 -w /var/tmp/capture.pcap host 192.168.1.10
tmsh run util ping 192.168.1.10
# 設定バックアップ
tmsh save sys ucs backup_$(date +%Y%m%d_%H%M%S).ucs
# パフォーマンス診断
tmsh show sys performance all
tmsh show sys cpu
tmsh show sys memory