Showing posts with label F5. Show all posts
Showing posts with label F5. Show all posts
Friday, November 1, 2019
F5 BIG-IP负载均衡器配置实例与Web管理界面体验
前言:最近一直在对比测试F5 BIG-IP和Citrix NetScaler负载均衡器的各项性能,于是写下此篇文章,记录F5 BIG-IP的常见应用配置方法。
目前,许多厂商推出了专用于平衡服务器负载的负载均衡器,如F5 Network公司的BIG-IP,Citrix公司的NetScaler。F5 BIG-IP LTM 的官方名称叫做本地流量管理器,可以做4-7层负载均衡,具有负载均衡、应用交换、会话交换、状态监控、智能网络地址转换、通用持续性、响应错误处理、IPv6网关、高级路由、智能端口镜像、SSL加速、智能HTTP压缩、TCP优化、第7层速率整形、内容缓冲、内容转换、连接加速、高速缓存、Cookie加密、选择性内容加密、应用攻击过滤、拒绝服务(DoS)攻击和SYN Flood保护、防火墙—包过滤、包消毒等功能。
以下是F5 BIG-IP用作HTTP负载均衡器的主要功能:
①、F5 BIG-IP提供12种灵活的算法将所有流量均衡的分配到各个服务器,而面对用户,只是一台虚拟服务器。
②、F5 BIG-IP可以确认应用程序能否对请求返回对应的数据。假如F5 BIG-IP后面的某一台服务器发生服务停止、死机等故障,F5会检查出来并将该服务器标识为宕机,从而不将用户的访问请求传送到该台发生故障的服务器上。这样,只要其它的服务器正常,用户的访问就不会受到影响。宕机一旦修复,F5 BIG-IP就会自动查证应用已能对客户请求作出正确响应并恢复向该服务器传送。
③、F5 BIG-IP具有动态Session的会话保持功能。
④、F5 BIG-IP的iRules功能可以做HTTP内容过滤,根据不同的域名、URL,将访问请求传送到不同的服务器。
Sunday, April 21, 2013
F5 BIG-IP负载均衡器配置实例与Web管理界面体验
前言:最近一直在对比测试F5 BIG-IP和Citrix NetScaler负载均衡器的各项性能,于是写下此篇文章,记录F5 BIG-IP的常见应用配置方法。
目前,许多厂商推出了专用于平衡服务器负载的负载均衡器,如F5 Network公司的BIG-IP,Citrix公司的NetScaler。F5 BIG-IP LTM 的官方名称叫做本地流量管理器,可以做4-7层负载均衡,具有负载均衡、应用交换、会话交换、状态监控、智能网络地址转换、通用持续性、响应错误处理、IPv6网关、高级路由、智能端口镜像、SSL加速、智能HTTP压缩、TCP优化、第7层速率整形、内容缓冲、内容转换、连接加速、高速缓存、Cookie加密、选择性内容加密、应用攻击过滤、拒绝服务(DoS)攻击和SYN Flood保护、防火墙—包过滤、包消毒等功能。
以下是F5 BIG-IP用作HTTP负载均衡器的主要功能:
①、F5 BIG-IP提供12种灵活的算法将所有流量均衡的分配到各个服务器,而面对用户,只是一台虚拟服务器。
②、F5 BIG-IP可以确认应用程序能否对请求返回对应的数据。假如F5 BIG-IP后面的某一台服务器发生服务停止、死机等故障,F5会检查出来并将该服务器标识为宕机,从而不将用户的访问请求传送到该台发生故障的服务器上。这样,只要其它的服务器正常,用户的访问就不会受到影响。宕机一旦修复,F5 BIG-IP就会自动查证应用已能对客户请求作出正确响应并恢复向该服务器传送。
③、F5 BIG-IP具有动态Session的会话保持功能。
④、F5 BIG-IP的iRules功能可以做HTTP内容过滤,根据不同的域名、URL,将访问请求传送到不同的服务器。
下面,结合实例,配置F5 BIG-IP LTM v9.x:
①、如图,假设域名blog.s135.com被解析到F5的外网/公网虚拟IP:61.1.1.3(vs_squid),该虚拟IP下有一个服务器池(pool_squid),该服务器池下包含两台真实的Squid服务器(192.168.1.11和192.168.1.12)。
②、如果Squid缓存未命中,则会请求F5的内网虚拟IP:192.168.1.3(vs_apache),该虚拟IP下有一个默认服务器池(pool_apache_default),该服务器池下包含两台真实的Apache服务器(192.168.1.21和192.168.1.22),当该虚拟IP匹配iRules规则时,则会访问另外一个服务器池(pool_apache_irules),该服务器池下同样包含两台真实的Apache服务器(192.168.1.23和192.168.1.24)。
③、另外,所有真实服务器的默认网关指向F5的自身内网IP,即192.168.1.2。
④、所有的真实服务器通过SNAT IP地址61.1.1.4访问互联网。
详细配置步骤:
一、登录到F5 BIG-IP管理界面:
1、初次使用:
①、打开F5 BIG-IP电源,用一根网线(直连线和交叉线均可)连接F5 BIG-IP的3.1管理网口和笔记本电脑的网口,将笔记本电脑的IP地址配置为“192.168.1.*”,子网掩码配置为“255.255.255.0”。
②、用浏览器访问F5 BIG-IP的出厂默认管理IP地址https://192.168.1.245或https://192.168.245.245
③、输入出厂默认用户名:admin,密码:admin
④、点击Activate进入F5 BIG-IP License申请与激活页面,激活License。
⑤、修改默认管理密码。
2、以后登录:
通过F5 BIG-IP的自身外网IP登录。
①、假设设置的F5自身外网IP为61.1.1.2,就可以通过https://61.1.1.2/登录。
②、还可以通过SSH登录,用户名为root,密码跟Web管理的密码相同。
二、创建两个VLAN:internal和external,分别表示内网和外网。
★创建VLAN演示页面:http://blog.s135.com/book/f5/vlan_create.htm
★VLAN列表演示页面:http://blog.s135.com/book/f5/vlan_list.htm
1、创建VLAN:internal(内网)
在“Network→VLANs”页面点击“create”按钮:
①、Name栏填写:internal(填一个英文名称)
②、Tag栏填写:4093(填一个数字)
③、Interfaces栏:将Available列的“1.1”拉到Untagged列。1.1表示F5 BIG-IP的第一块网卡。
2、创建VLAN:external(外网)
在“Network→VLANs”页面点击“create”按钮创建VLAN:
①、Name栏填写:internal(填一个英文名称)
②、Tag栏填写:4094(填一个数字)
③、Interfaces栏:将Available列的“1.2”拉到Untagged列。1.2表示F5 BIG-IP的第二块网卡。
三、创建F5 BIG-IP的自身IP:分别对应internal(内网)和external(外网)。
★创建自身IP演示页面:http://blog.s135.com/book/f5/selfip_create.htm
1、创建自身内网IP:192.168.1.2
在“Network→Self IPs”页面点击“create”按钮:
①、IP Address栏填写:192.168.1.2(填内网IP地址)
②、Netmask栏填写:255.255.255.0(填内网子网掩码)
③、VLAN栏选择:internal
④、Port Lockdown栏选择:Allow Default(默认值)
2、创建自身外网IP:61.1.1.2
在“Network→Self IPs”页面点击“create”按钮:
①、IP Address栏填写:61.1.1.2(填外网IP地址)
②、Netmask栏填写:255.255.255.0(填外网子网掩码)
③、VLAN栏选择:external
④、Port Lockdown栏选择:Allow Default(默认值)
四、创建默认网关路由
★创建默认网关路由演示页面:http://blog.s135.com/book/f5/routes_create.htm
1、创建默认网关路由
在“Network→Routes”页面点击“create”按钮:
①、Type栏选择:Default Gateway(默认值)
②、Resource栏选择:Use Gateeay...,在其后的输入框填写网关IP地址:61.1.1.1(这里假设此IP为外网网关地址)
五、创建服务器自定义健康检查
★创建服务器自定义健康检查演示页面:http://blog.s135.com/book/f5/monitors_create.htm
1、创建自定义HTTP健康检查:monitor_http
在“Local Traffic→Monitors”页面点击“create”按钮:
①、Name栏填写:monitor_http(填一个英文名称)
②、Type栏选择:HTTP
③、Import Settings栏选择:HTTP
④、Interval栏填写:5(表示每5秒钟进行一次健康检查)
⑤、Timeout栏填写:16(表示健康检查的连接超时时间为16秒)
⑥、Send String栏填写:GET /(也可以根据自己的需求发送其他方法的请求,例如HEAD /或者GET /index.htm)
⑦、Receive String栏填写:(填写对应的返回字符串,默认不填写)
六、创建服务器池(pool)
★创建服务器池演示页面:http://blog.s135.com/book/f5/pools_create.htm
1、创建Squid服务器池:pool_squid
在“Local Traffic→Pools”页面点击“create”按钮:
①、Name栏填写:pool_squid(填一个英文名称)
②、Health Monitors栏:将第四步创建的自定义HTTP健康检查“monitor_http”由Available列拉到Active列
③、Load Balancing Method栏选择:Round Robin(这里选择的负载均衡方式是轮询,也可以选择其他方式)
④、New Members栏:先选择New Address,再添加两台Squid服务器的IP地址192.168.1.11、192.168.1.12以及它们的端口80
2、创建第一组Apache服务器池:pool_apache_default
在“Local Traffic→Pools”页面点击“create”按钮:
①、Name栏填写:pool_apache_default(填一个英文名称)
②、Health Monitors栏:将第四步创建的自定义HTTP健康检查“monitor_http”由Available列拉到Active列
③、Load Balancing Method栏选择:Round Robin(这里选择的负载均衡方式是轮询,也可以选择其他方式)
④、New Members栏:先选择New Address,再添加第一组两台Apache服务器的IP地址192.168.1.21、192.168.1.22以及它们的端口80
3、创建第二组Apache服务器池:pool_apache_irules
在“Local Traffic→Pools”页面点击“create”按钮:
①、Name栏填写:pool_apache_irules(填一个英文名称)
②、Health Monitors栏:将第四步创建的自定义HTTP健康检查“monitor_http”由Available列拉到Active列
③、Load Balancing Method栏选择:Round Robin(这里选择的负载均衡方式是轮询,也可以选择其他方式)
④、New Members栏:先选择New Address,再添加第二组两台Apache服务器的IP地址192.168.1.23、192.168.1.24以及它们的端口80
七、创建供七层负载均衡使用的Profiles配置
★创建Profiles演示页面:http://blog.s135.com/book/f5/profiles_create.htm
1、创建Profiles配置:profile_http
在“Local Traffic→Profiles”页面点击“create”按钮:
①、Name栏填写:profile_http(填一个英文名称)
②、Parent Profile栏选择:HTTP
③、Insert XForwarded For栏:如果需要,可以选中方框,选择Enable(在Header头中插入x-forwarded-for标记,以便做七层负载均衡时能够获取用户真实IP,本文中Squid服务器开启了follow_x_forwarded_for allow all,因此F5无需设置此项)
注:在此设置页面中,还有压缩等优化功能,可以根据需要进行设置。
八、创建iRules规则
★创建iRules规则演示页面:http://blog.s135.com/book/f5/irules_create.htm
1、创建iRules规则:irules_apache
在“Local Traffic→Profiles”页面点击“create”按钮:
①、Name栏填写:irules_apache(填一个英文名称)
②、Definition栏填写以下脚本,将访问的域名为“blog.s135.com”,访问的网址以“.htm”结尾,或者以“/read.php”开头的请求全部转到服务器池“pool_apache_irules”:
九、创建虚拟服务器(Virtual Servers)
★创建虚拟服务器演示页面:http://blog.s135.com/book/f5/vs_create.htm
1、以“四层”负载均衡模式创建Squid虚拟服务器:vs_squid
在“Local Traffic→Virtual Servers”页面点击“create”按钮:
⑴、General Properties大类下:
①、Name栏填写:vs_squid(填一个英文名称)
②、Destination栏:选择Host,填写Squid服务器的外网虚拟IP(Virtual IP,简称VIP):61.1.1.3
③、Service Port栏填写:80
⑵、Configuration大类下:
①、Configuration栏选择: Advanced(选择高级模式,这一步很重要)
②、Type栏选择:Performance (Layer 4)
③、SNAT Pool栏选择:None(注意:这一步很重要,四层模式下,请确保此项选择为None)
⑶、Resources大类下:
①、Default Pool栏选择:pool_squid
注意:F5的四层负载均衡由硬件芯片处理,不消耗CPU资源,能够处理更大的访问量。在四层负载均衡模式下,真实服务器的默认网关必须指向F5的自身内网IP,即192.168.1.2
2、以“七层”负载均衡模式创建Apache虚拟服务器:vs_apache
在“Local Traffic→Virtual Servers”页面点击“create”按钮:
⑴、General Properties大类下:
①、Name栏填写:vs_apache(填一个英文名称)
②、Destination栏:选择Host,填写Apache服务器的内网虚拟IP(Virtual IP,简称VIP):192.168.1.3
③、Service Port栏填写:80
⑵、Configuration大类下:
Configuration栏选择: Advanced(选择高级模式,这一步很重要)
①、Type栏选择:Standard(标准模式,即七层负载均衡模式)
②、HTTP Profile栏选择:profile_http(注意:此项为None时,不能使用iRules规则,因此必须选一个。在此选择第六步创建的profile_http)
③、SNAT Pool栏选择:Auto Map(注意:在本文的架构中必须选择,原因如下)
说明:当其中的一台Squid服务器“192.168.1.11”缓存未命中时,会去访问虚拟IP“192.168.1.3”。如果SNAT Pool选择默认值None,虚拟IP“192.168.1.3”后端的Apache服务器,看到的将是Squid服务器的真实IP“192.168.1.11”。由于Squid和Apache服务器的IP地址属于在同一网段,Apache服务器将无需经过F5网关“192.168.1.2”,直接通过交换机回包给Squid服务器“192.168.1.11”,这样虚拟IP“192.168.1.3”就会收不到回包信息,HTTP请求无法完成。因此,需要选择Auto Map,进行地址转换,让后端Apache服务器看到的是F5的自身内网IP,回包给F5。
⑶、Resources大类下:
①、iRules栏:将Available列的“irules_apache”拉到Enabled列。
②、Default Pool栏选择:pool_apache_default
⑷、Apache虚拟服务器──vs_apache创建完成后,如需进行修改,在以下两个配置页完成:
★修改虚拟服务器演示页面1:http://blog.s135.com/book/f5/vs_properties.htm
★修改虚拟服务器演示页面2:http://blog.s135.com/book/f5/vs_resources.htm
十、创建SNAT安全网络地址转换,让真实服务器能够访问互联网、对外发邮件
★创建SNAT演示页面:http://blog.s135.com/book/f5/snat_create.htm
1、创建SNAT:snat_all_server
在“Local Traffic→SNATs”页面点击“create”按钮:
①、Name栏填写:snat_all_server(填一个英文名称)
②、Translation栏选择:IP Address,并填写SNAT IP地址:61.1.1.4(此项也可以选择Automap,使用F5的自身外网IP作为SNAT IP)
③、Origin栏选择:Address List
④、Address List栏:①Type栏选择host,填写要访问互联网、对外发邮件的内网IP地址。②或者Type栏选择Network,填写要访问互联网、对外发邮件的网段和子网掩码。
⑤、VLAN Traffic栏选择:Enabled on...
⑥、VLAN List栏:将Available列的“internal”拉到Selected列。
注意:真实服务器的默认网关需要指向F5的自身内网IP,即192.168.1.2,才能通过SNAT访问互联网、对外发邮件。
附1:
《F5 BIG-IP LTM 配置手册(中文简化版)》
《F5 BIG-IP LTM 配置手册(英文详细版)》
附2:
使用F5 BIG-IP作为负载均衡器的部分国内网站:
目前,许多厂商推出了专用于平衡服务器负载的负载均衡器,如F5 Network公司的BIG-IP,Citrix公司的NetScaler。F5 BIG-IP LTM 的官方名称叫做本地流量管理器,可以做4-7层负载均衡,具有负载均衡、应用交换、会话交换、状态监控、智能网络地址转换、通用持续性、响应错误处理、IPv6网关、高级路由、智能端口镜像、SSL加速、智能HTTP压缩、TCP优化、第7层速率整形、内容缓冲、内容转换、连接加速、高速缓存、Cookie加密、选择性内容加密、应用攻击过滤、拒绝服务(DoS)攻击和SYN Flood保护、防火墙—包过滤、包消毒等功能。
以下是F5 BIG-IP用作HTTP负载均衡器的主要功能:
①、F5 BIG-IP提供12种灵活的算法将所有流量均衡的分配到各个服务器,而面对用户,只是一台虚拟服务器。
②、F5 BIG-IP可以确认应用程序能否对请求返回对应的数据。假如F5 BIG-IP后面的某一台服务器发生服务停止、死机等故障,F5会检查出来并将该服务器标识为宕机,从而不将用户的访问请求传送到该台发生故障的服务器上。这样,只要其它的服务器正常,用户的访问就不会受到影响。宕机一旦修复,F5 BIG-IP就会自动查证应用已能对客户请求作出正确响应并恢复向该服务器传送。
③、F5 BIG-IP具有动态Session的会话保持功能。
④、F5 BIG-IP的iRules功能可以做HTTP内容过滤,根据不同的域名、URL,将访问请求传送到不同的服务器。
下面,结合实例,配置F5 BIG-IP LTM v9.x:
①、如图,假设域名blog.s135.com被解析到F5的外网/公网虚拟IP:61.1.1.3(vs_squid),该虚拟IP下有一个服务器池(pool_squid),该服务器池下包含两台真实的Squid服务器(192.168.1.11和192.168.1.12)。
②、如果Squid缓存未命中,则会请求F5的内网虚拟IP:192.168.1.3(vs_apache),该虚拟IP下有一个默认服务器池(pool_apache_default),该服务器池下包含两台真实的Apache服务器(192.168.1.21和192.168.1.22),当该虚拟IP匹配iRules规则时,则会访问另外一个服务器池(pool_apache_irules),该服务器池下同样包含两台真实的Apache服务器(192.168.1.23和192.168.1.24)。
③、另外,所有真实服务器的默认网关指向F5的自身内网IP,即192.168.1.2。
④、所有的真实服务器通过SNAT IP地址61.1.1.4访问互联网。
详细配置步骤:
一、登录到F5 BIG-IP管理界面:
1、初次使用:
①、打开F5 BIG-IP电源,用一根网线(直连线和交叉线均可)连接F5 BIG-IP的3.1管理网口和笔记本电脑的网口,将笔记本电脑的IP地址配置为“192.168.1.*”,子网掩码配置为“255.255.255.0”。
②、用浏览器访问F5 BIG-IP的出厂默认管理IP地址https://192.168.1.245或https://192.168.245.245
③、输入出厂默认用户名:admin,密码:admin
④、点击Activate进入F5 BIG-IP License申请与激活页面,激活License。
⑤、修改默认管理密码。
2、以后登录:
通过F5 BIG-IP的自身外网IP登录。
①、假设设置的F5自身外网IP为61.1.1.2,就可以通过https://61.1.1.2/登录。
②、还可以通过SSH登录,用户名为root,密码跟Web管理的密码相同。
二、创建两个VLAN:internal和external,分别表示内网和外网。
★创建VLAN演示页面:http://blog.s135.com/book/f5/vlan_create.htm
★VLAN列表演示页面:http://blog.s135.com/book/f5/vlan_list.htm
1、创建VLAN:internal(内网)
在“Network→VLANs”页面点击“create”按钮:
①、Name栏填写:internal(填一个英文名称)
②、Tag栏填写:4093(填一个数字)
③、Interfaces栏:将Available列的“1.1”拉到Untagged列。1.1表示F5 BIG-IP的第一块网卡。
2、创建VLAN:external(外网)
在“Network→VLANs”页面点击“create”按钮创建VLAN:
①、Name栏填写:internal(填一个英文名称)
②、Tag栏填写:4094(填一个数字)
③、Interfaces栏:将Available列的“1.2”拉到Untagged列。1.2表示F5 BIG-IP的第二块网卡。
三、创建F5 BIG-IP的自身IP:分别对应internal(内网)和external(外网)。
★创建自身IP演示页面:http://blog.s135.com/book/f5/selfip_create.htm
1、创建自身内网IP:192.168.1.2
在“Network→Self IPs”页面点击“create”按钮:
①、IP Address栏填写:192.168.1.2(填内网IP地址)
②、Netmask栏填写:255.255.255.0(填内网子网掩码)
③、VLAN栏选择:internal
④、Port Lockdown栏选择:Allow Default(默认值)
2、创建自身外网IP:61.1.1.2
在“Network→Self IPs”页面点击“create”按钮:
①、IP Address栏填写:61.1.1.2(填外网IP地址)
②、Netmask栏填写:255.255.255.0(填外网子网掩码)
③、VLAN栏选择:external
④、Port Lockdown栏选择:Allow Default(默认值)
四、创建默认网关路由
★创建默认网关路由演示页面:http://blog.s135.com/book/f5/routes_create.htm
1、创建默认网关路由
在“Network→Routes”页面点击“create”按钮:
①、Type栏选择:Default Gateway(默认值)
②、Resource栏选择:Use Gateeay...,在其后的输入框填写网关IP地址:61.1.1.1(这里假设此IP为外网网关地址)
五、创建服务器自定义健康检查
★创建服务器自定义健康检查演示页面:http://blog.s135.com/book/f5/monitors_create.htm
1、创建自定义HTTP健康检查:monitor_http
在“Local Traffic→Monitors”页面点击“create”按钮:
①、Name栏填写:monitor_http(填一个英文名称)
②、Type栏选择:HTTP
③、Import Settings栏选择:HTTP
④、Interval栏填写:5(表示每5秒钟进行一次健康检查)
⑤、Timeout栏填写:16(表示健康检查的连接超时时间为16秒)
⑥、Send String栏填写:GET /(也可以根据自己的需求发送其他方法的请求,例如HEAD /或者GET /index.htm)
⑦、Receive String栏填写:(填写对应的返回字符串,默认不填写)
六、创建服务器池(pool)
★创建服务器池演示页面:http://blog.s135.com/book/f5/pools_create.htm
1、创建Squid服务器池:pool_squid
在“Local Traffic→Pools”页面点击“create”按钮:
①、Name栏填写:pool_squid(填一个英文名称)
②、Health Monitors栏:将第四步创建的自定义HTTP健康检查“monitor_http”由Available列拉到Active列
③、Load Balancing Method栏选择:Round Robin(这里选择的负载均衡方式是轮询,也可以选择其他方式)
④、New Members栏:先选择New Address,再添加两台Squid服务器的IP地址192.168.1.11、192.168.1.12以及它们的端口80
2、创建第一组Apache服务器池:pool_apache_default
在“Local Traffic→Pools”页面点击“create”按钮:
①、Name栏填写:pool_apache_default(填一个英文名称)
②、Health Monitors栏:将第四步创建的自定义HTTP健康检查“monitor_http”由Available列拉到Active列
③、Load Balancing Method栏选择:Round Robin(这里选择的负载均衡方式是轮询,也可以选择其他方式)
④、New Members栏:先选择New Address,再添加第一组两台Apache服务器的IP地址192.168.1.21、192.168.1.22以及它们的端口80
3、创建第二组Apache服务器池:pool_apache_irules
在“Local Traffic→Pools”页面点击“create”按钮:
①、Name栏填写:pool_apache_irules(填一个英文名称)
②、Health Monitors栏:将第四步创建的自定义HTTP健康检查“monitor_http”由Available列拉到Active列
③、Load Balancing Method栏选择:Round Robin(这里选择的负载均衡方式是轮询,也可以选择其他方式)
④、New Members栏:先选择New Address,再添加第二组两台Apache服务器的IP地址192.168.1.23、192.168.1.24以及它们的端口80
七、创建供七层负载均衡使用的Profiles配置
★创建Profiles演示页面:http://blog.s135.com/book/f5/profiles_create.htm
1、创建Profiles配置:profile_http
在“Local Traffic→Profiles”页面点击“create”按钮:
①、Name栏填写:profile_http(填一个英文名称)
②、Parent Profile栏选择:HTTP
③、Insert XForwarded For栏:如果需要,可以选中方框,选择Enable(在Header头中插入x-forwarded-for标记,以便做七层负载均衡时能够获取用户真实IP,本文中Squid服务器开启了follow_x_forwarded_for allow all,因此F5无需设置此项)
注:在此设置页面中,还有压缩等优化功能,可以根据需要进行设置。
八、创建iRules规则
★创建iRules规则演示页面:http://blog.s135.com/book/f5/irules_create.htm
1、创建iRules规则:irules_apache
在“Local Traffic→Profiles”页面点击“create”按钮:
①、Name栏填写:irules_apache(填一个英文名称)
②、Definition栏填写以下脚本,将访问的域名为“blog.s135.com”,访问的网址以“.htm”结尾,或者以“/read.php”开头的请求全部转到服务器池“pool_apache_irules”:
- when HTTP_REQUEST {
- if {[HTTP::host] equals "blog.s135.com" and [HTTP::uri] ends_with ".htm"} {
- pool pool_apache_irules
- }
- elseif {[HTTP::host] equals "blog.s135.com" and [HTTP::uri] starts_with "/read.php"} {
- pool pool_apache_irules
- }
- }
九、创建虚拟服务器(Virtual Servers)
★创建虚拟服务器演示页面:http://blog.s135.com/book/f5/vs_create.htm
1、以“四层”负载均衡模式创建Squid虚拟服务器:vs_squid
在“Local Traffic→Virtual Servers”页面点击“create”按钮:
⑴、General Properties大类下:
①、Name栏填写:vs_squid(填一个英文名称)
②、Destination栏:选择Host,填写Squid服务器的外网虚拟IP(Virtual IP,简称VIP):61.1.1.3
③、Service Port栏填写:80
⑵、Configuration大类下:
①、Configuration栏选择: Advanced(选择高级模式,这一步很重要)
②、Type栏选择:Performance (Layer 4)
③、SNAT Pool栏选择:None(注意:这一步很重要,四层模式下,请确保此项选择为None)
⑶、Resources大类下:
①、Default Pool栏选择:pool_squid
注意:F5的四层负载均衡由硬件芯片处理,不消耗CPU资源,能够处理更大的访问量。在四层负载均衡模式下,真实服务器的默认网关必须指向F5的自身内网IP,即192.168.1.2
2、以“七层”负载均衡模式创建Apache虚拟服务器:vs_apache
在“Local Traffic→Virtual Servers”页面点击“create”按钮:
⑴、General Properties大类下:
①、Name栏填写:vs_apache(填一个英文名称)
②、Destination栏:选择Host,填写Apache服务器的内网虚拟IP(Virtual IP,简称VIP):192.168.1.3
③、Service Port栏填写:80
⑵、Configuration大类下:
Configuration栏选择: Advanced(选择高级模式,这一步很重要)
①、Type栏选择:Standard(标准模式,即七层负载均衡模式)
②、HTTP Profile栏选择:profile_http(注意:此项为None时,不能使用iRules规则,因此必须选一个。在此选择第六步创建的profile_http)
③、SNAT Pool栏选择:Auto Map(注意:在本文的架构中必须选择,原因如下)
说明:当其中的一台Squid服务器“192.168.1.11”缓存未命中时,会去访问虚拟IP“192.168.1.3”。如果SNAT Pool选择默认值None,虚拟IP“192.168.1.3”后端的Apache服务器,看到的将是Squid服务器的真实IP“192.168.1.11”。由于Squid和Apache服务器的IP地址属于在同一网段,Apache服务器将无需经过F5网关“192.168.1.2”,直接通过交换机回包给Squid服务器“192.168.1.11”,这样虚拟IP“192.168.1.3”就会收不到回包信息,HTTP请求无法完成。因此,需要选择Auto Map,进行地址转换,让后端Apache服务器看到的是F5的自身内网IP,回包给F5。
⑶、Resources大类下:
①、iRules栏:将Available列的“irules_apache”拉到Enabled列。
②、Default Pool栏选择:pool_apache_default
⑷、Apache虚拟服务器──vs_apache创建完成后,如需进行修改,在以下两个配置页完成:
★修改虚拟服务器演示页面1:http://blog.s135.com/book/f5/vs_properties.htm
★修改虚拟服务器演示页面2:http://blog.s135.com/book/f5/vs_resources.htm
十、创建SNAT安全网络地址转换,让真实服务器能够访问互联网、对外发邮件
★创建SNAT演示页面:http://blog.s135.com/book/f5/snat_create.htm
1、创建SNAT:snat_all_server
在“Local Traffic→SNATs”页面点击“create”按钮:
①、Name栏填写:snat_all_server(填一个英文名称)
②、Translation栏选择:IP Address,并填写SNAT IP地址:61.1.1.4(此项也可以选择Automap,使用F5的自身外网IP作为SNAT IP)
③、Origin栏选择:Address List
④、Address List栏:①Type栏选择host,填写要访问互联网、对外发邮件的内网IP地址。②或者Type栏选择Network,填写要访问互联网、对外发邮件的网段和子网掩码。
⑤、VLAN Traffic栏选择:Enabled on...
⑥、VLAN List栏:将Available列的“internal”拉到Selected列。
注意:真实服务器的默认网关需要指向F5的自身内网IP,即192.168.1.2,才能通过SNAT访问互联网、对外发邮件。
附1:
《F5 BIG-IP LTM 配置手册(中文简化版)》
《F5 BIG-IP LTM 配置手册(英文详细版)》
附2:
使用F5 BIG-IP作为负载均衡器的部分国内网站:
Monday, April 8, 2013
F5 Application Delivery Fundamentals Exam Study and Resource Guide
Section 1 - OSI
The first section of the exam concentrates on some basic networking concepts, working up the OSI model from the bottom. Most of this information is common knowledge in the networking industry, but I guarantee that you don't know all of it, especially when you get to the application layer protocols. This is mostly a collection of Wikipedia articles, but with information this basic, Wiki is our friend.
This section is worth 33% of the total test score.
Another OSI Model Overview
ARP on F5
MAC Address
Broadcast Domain
VLANs
Link Aggregation Wiki
Big IP Link Aggregation
TCP/IP Overview
IP Addressing & Subnetting
Routing Protocols
IP Packet Fragmentation
IP TTL (Time to Live)
TCP Functionality
TCP Connection Setup by Virtual Server Type
TCP Profile Settings (Tunables)
UDP Functionality
UDP Profile Settings (Tunables)
TCPDUMP on F5
HTTP Functionality
HTTP Status Codes
HTTP Headers
F5 HTTP White Paper
DNS Functionality
DNS Record Types
SIP Functionality
F5 SIP White Paper
FTP Functionality
SMTP Functionality
HTTP Cookies
My Name is URL
Section 2 - F5 Solutions and Technology
In this section, we get into the actual F5 Solutions. Most engineers taking this exam will be experienced with LTM and iRules, but little else. Hopefully, the familiarity gained from the F5 datasheets and white papers shown below will help you to understand the breadth of the F5 offerings. Prepare to take the first step into a larger world.
This section is also worth 33% of the total test score.
Application Security Manager (ASM)
Local Traffic Manager (LTM)
Global Traffic Manager (GTM)
Enterprise Manager (EM)
WAN Optimization Manager (WOM)
Web Accelerator
ARX File Virtualization
F5 White Papers
F5 Datasheets
Packet-Based vs Full Proxy
SNAT
Auto Last Hop
Virtual Server Types
Config Sync
Big IP HA Features
Mirroring
VLAN Failsafe
Section 3 - Load Balancing Essentials
This section is a short one compared to the previous two. It's worth 17% of the total test score. If you're going after an F5 certification, you're probably already familiar with much of this material, so you probably won't have to study as much for this section. It never hurts to brush up on the algorithms and persistence methods.
Load Balancing 101
Load Balancing Algorithms (Devcentral)
More on Load Balancing Algorithms
Another Load Balancing Algorithm Article
Yet Another Load Balancing Algorithm Article
Persistence
Client / Server on Wiki - Yes, I'm surprised this is even a question.
Section 4 - Security
This section is weighted at 11% of the total test score, but it feels like it should be more.
Positive vs Negative Security
Cryptography
SSL Certificates (Devcentral)
Certificate Chains
Public-Key Cryptography
Symmetric vs Asymmetric Encryption
Client SSL Profiles
Server SSL Profiles
SSLDUMP Utility
AAA
Single Sign On
Multi-factor Authentication
IPsec VPN
IPSEC vs SSL VPN
Section 5 - Application Delivery Platforms
The final section is worth only 7% of the total test score. The finish line is in sight!
Virtualization Platforms
Application Performance Optimization
TCP Optimization
Oneconnect
Caching
Compression
Pipelining
Acceleration 101
Acceleration 102
--------------------------------------------------------------------------------------------------------------------------------
Purpose of this document
Networking basics
Networking concepts, switching, addressing, media access control
IP and host addressing, routing, packet traversing
TCP, UDP concepts
HTTP concepts, SIP, SMTP, DNS
Concepts and examples
SSL Concepts, termination, client SSL, acceleration
Whitepapers and data sheets
Best practices, examples, wiki groups
Best practices, examples, wiki groups
Best practices, examples, wiki groups
LTM architecture
Redundant pair concepts, setup, and synchronization
Load balancing methods, configuration
Hypervisors, supported platforms, virtualization
The first section of the exam concentrates on some basic networking concepts, working up the OSI model from the bottom. Most of this information is common knowledge in the networking industry, but I guarantee that you don't know all of it, especially when you get to the application layer protocols. This is mostly a collection of Wikipedia articles, but with information this basic, Wiki is our friend.
This section is worth 33% of the total test score.
- Objective 1.01 - Explain, compare and contrast the OSI layers
Another OSI Model Overview
- Objective 1.02 - Explain protocols and technologies specific to the data-link layer
ARP on F5
MAC Address
Broadcast Domain
VLANs
Link Aggregation Wiki
Big IP Link Aggregation
- Objective 1.03 - Explain protocols and apply technologies specific to the network layer
TCP/IP Overview
IP Addressing & Subnetting
Routing Protocols
IP Packet Fragmentation
IP TTL (Time to Live)
- Objective 1.04 - Explain the features and functionality of protocols and technologies specific to the transport layer
TCP Functionality
TCP Connection Setup by Virtual Server Type
TCP Profile Settings (Tunables)
UDP Functionality
UDP Profile Settings (Tunables)
TCPDUMP on F5
- Objective 1.05 - Explain the features and functionality of protocols and technologies specific to the application layer
HTTP Functionality
HTTP Status Codes
HTTP Headers
F5 HTTP White Paper
DNS Functionality
DNS Record Types
SIP Functionality
F5 SIP White Paper
FTP Functionality
SMTP Functionality
HTTP Cookies
My Name is URL
Section 2 - F5 Solutions and Technology
In this section, we get into the actual F5 Solutions. Most engineers taking this exam will be experienced with LTM and iRules, but little else. Hopefully, the familiarity gained from the F5 datasheets and white papers shown below will help you to understand the breadth of the F5 offerings. Prepare to take the first step into a larger world.
This section is also worth 33% of the total test score.
- Objective 2.01 - Articulate the role of F5 products
Application Security Manager (ASM)
Local Traffic Manager (LTM)
Global Traffic Manager (GTM)
Enterprise Manager (EM)
WAN Optimization Manager (WOM)
Web Accelerator
ARX File Virtualization
F5 White Papers
F5 Datasheets
- Objective 2.02 - Explain the purpose, use and advantages of iRules
- Objective 2.03 - Explain the purpose, use and advantages of iApps
- Objective 2.04 - Explain the purpose, use and advantages of iControl
- Objective 2.05 - Explain the purpose of and use cases for full proxy and packet forwarding / packet based architectures
Packet-Based vs Full Proxy
SNAT
Auto Last Hop
Virtual Server Types
- Objective 2.06 - Explain the advantages and configurations of high availability (HA)
Config Sync
Big IP HA Features
Mirroring
VLAN Failsafe
Section 3 - Load Balancing Essentials
This section is a short one compared to the previous two. It's worth 17% of the total test score. If you're going after an F5 certification, you're probably already familiar with much of this material, so you probably won't have to study as much for this section. It never hurts to brush up on the algorithms and persistence methods.
- Objective 3.01 - Discuss the purpose of, use cases for, and key considerations related to load balancing
Load Balancing 101
Load Balancing Algorithms (Devcentral)
More on Load Balancing Algorithms
Another Load Balancing Algorithm Article
Yet Another Load Balancing Algorithm Article
Persistence
- Objective 3.02 - Differentiate between a client and a server
Client / Server on Wiki - Yes, I'm surprised this is even a question.
Section 4 - Security
This section is weighted at 11% of the total test score, but it feels like it should be more.
- Objective 4.01 - Compare and contrast positive and negative security models
Positive vs Negative Security
- Objective 4.02 - Explain the purpose and cryptographic services
Cryptography
SSL Certificates (Devcentral)
Certificate Chains
Public-Key Cryptography
Symmetric vs Asymmetric Encryption
Client SSL Profiles
Server SSL Profiles
SSLDUMP Utility
- Objective 4.03 - Describe the purpose and advantages of authentication
AAA
Single Sign On
Multi-factor Authentication
- Objective 4.04 - Describe the purpose, advantages and use cases of IPsec and SSL VPN
IPsec VPN
IPSEC vs SSL VPN
Section 5 - Application Delivery Platforms
The final section is worth only 7% of the total test score. The finish line is in sight!
- Objective 5.01 - Describe the purpose, advantages, use cases, and challenges associated with hardware-based application delivery platforms and virtual machines
Virtualization Platforms
- Objective 5.02 - Describe the purpose of the various types of advanced acceleration techniques.
Application Performance Optimization
TCP Optimization
Oneconnect
Caching
Compression
Pipelining
Acceleration 101
Acceleration 102
--------------------------------------------------------------------------------------------------------------------------------
F5 Fundamentals Certification Resource Guide
Purpose of this document
This document outlines topic areas covered on the F5 Fundamentals Certification Exam and resources available to help prepare test takers.
OSI model
Networking basics
· http://www.windowsnetworking.com/articles_tutorials/Networking-Basics-Part1.html
· http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/
Data link layer
Networking concepts, switching, addressing, media access control
· http://www.osischool.com/protocol/arp/basic
· http://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm_implementations_guide_10_1/sol_linkagg.html
· Book:The TCP/IP Guide, Kozierokhttp://www.tcpipguide.com/
· http://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/tmos-ip-routing-administration-11-2-0/5.html
· http://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/tmos_management_guide_10_1/tmos_arp.html
· https://support.f5.com/kb/en-us/solutions/public/3000/500/sol3523.html
· https://support.f5.com/kb/en-us/solutions/public/3000/500/sol3523.html
Network layer
IP and host addressing, routing, packet traversing
· Book:The TCP/IP Guide, Kozierok http://www.tcpipguide.com/
· http://www.tenouk.com/download/pdf/Module42.pdf
· http://www.redbooks.ibm.com/redbooks/pdfs/gg243376.pdf
· https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/tmos-ip-routing-administration-11-2-0.html
· https://support.f5.com/kb/en-us/solutions/public/13000/200/sol13284.html
Transport layer
TCP, UDP concepts
· Book:The TCP/IP Guide, Kozierok http://www.tcpipguide.com/
· http://www.osischool.com/protocol/tcp/three-way-handshake
· http://support.f5.com/kb/en-us/solutions/public/8000/000/sol8082.html
· http://support.f5.com/kb/en-us/solutions/public/7000/500/sol7559.html
· http://support.f5.com/kb/en-us/solutions/public/7000/500/sol7535.html
· http://support.f5.com/kb/en-us/solutions/public/1000/800/sol1893.html
Application layer
HTTP concepts, SIP, SMTP, DNS
· Book:The TCP/IP Guide, Kozierok http://www.tcpipguide.com/
· http://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm_configuration_guide_10_1/ltm_services_profiles.html?sr=20797034#1226979
· http://www.f5.com/pdf/white-papers/sip-defined-wp.pdf
· http://www.f5.com/pdf/white-papers/http-fundamentals-wp.pdf
· Book:DNS and Bind, Liu http://www.amazon.com/DNS-BIND-Cricket-Liu/dp/1565925122
· RFC 2616 (HTTP): http://www.ietf.org/rfc/rfc2616.txt
Positive and Negative Security
Concepts and examples
· https://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1088520/F5-Security-on-Owasp-Top-10.aspx
· https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/39/aff/47/showtab/groupforums/Default.aspx
Cryptographic services
· http://www.f5.com/pdf/white-papers/authentication-101-tb.pdf
IPSec and SSL
SSL Concepts, termination, client SSL, acceleration
· Book:SSL and TLS, Eric Rescorla, http://www.amazon.com/SSL-TLS-Designing-Building-Systems/dp/0201615983
· LTM Essentials, Module 7 on F5 University
· http://eprint.iacr.org/2004/314.pdf
· https://support.f5.com/kb/en-us/solutions/public/10000/100/sol10167.html
· https://support.f5.com/kb/en-us/solutions/public/11000/200/sol11220.htm
· https://support.f5.com/kb/en-us/solutions/public/10000/200/sol10209.html
F5 Solutions & Technology
Whitepapers and data sheets
· http://www.f5.com/solutions/resources/white-papers.html
· http://www.f5.com/solutions/resources/datasheets/
iRules
Best practices, examples, wiki groups
· https://devcentral.f5.com/wiki/iRules.HomePage.ashx
iApps
Best practices, examples, wiki groups
· https://devcentral.f5.com/wiki/iApp.HomePage.ashx
iControl
Best practices, examples, wiki groups
· https://devcentral.f5.com/default.aspx?tabid=76
· https://devcentral.f5.com/wiki/iControl.HomePage.ashx
Proxy & Packet based Architectures
LTM architecture
· LTM Essentials, Modules 1 and 2 on F5 University
· http://www.f5.com/pdf/products/big-ip-local-traffic-manager-overview.pdf
· https://support.f5.com/kb/en-us/solutions/public/7000/800/sol7820.html
· https://support.f5.com/kb/en-us/solutions/public/7000/700/sol7751.html
· https://support.f5.com/kb/en-us/solutions/public/11000/700/sol11796.html
· https://support.f5.com/kb/en-us/solutions/public/7000/700/sol7752.html
· https://support.f5.com/kb/en-us/solutions/public/12000/200/sol12272.html
· https://support.f5.com/kb/en-us/solutions/public/13000/400/sol13444.html
High Availability
Redundant pair concepts, setup, and synchronization
· LTM Essentials, Module 10 on F5 University
· https://support.f5.com/kb/en-us/solutions/public/7000/000/sol7024.html
· https://support.f5.com/kb/en-us/solutions/public/11000/700/sol11736.html
· https://support.f5.com/kb/en-us/solutions/public/7000/200/sol7222.html
· https://support.f5.com/kb/en-us/solutions/public/13000/200/sol13297.html
Load Balancing
Load balancing methods, configuration
· LTM Essentials, Module 3 on F5 University
· http://www.f5.com/pdf/white-papers/load-balancing101-wp.pdf
· https://support.f5.com/kb/en-us/solutions/public/6000/400/sol6406.html
· https://support.f5.com/kb/en-us/solutions/public/9000/100/sol9125.html
· https://support.f5.com/kb/en-us/solutions/public/12000/100/sol12105.html
Client Server roles and protocol
· http://ocw.mit.edu/courses/sloan-school-of-management/15-564-information-technology
· http://www.protocols.com/
Web Application Delivery Platforms (VM and HW Based)
Hypervisors, supported platforms, virtualization
· http://www.f5.com/solutions/virtualization/
· http://www.vmguru.nl/wordpress/wp-content/uploads/2010/08/Hypervisor-comparison.pdf
Acceleration techniques
· https://devcentral.f5.com/weblogs/macvittie/category/4335.aspx
· http://www.f5.com/solutions/acceleration/
· http://www.f5.com/pdf/white-papers/acceleration-101-wp.pdf
· http://www.f5.com/pdf/white-papers/acceleration-102-wp.pdft.
Subscribe to:
Posts (Atom)