FortiADC SLB Virtual Server L7 方式部署介绍 版本 1.0 时间支持的版本作者状态反馈 2015 年 10 月 FortiADC v4.3.x 刘康明已审核 support_cn@fortinet.com
目录 简介... 3 Virtual Server L7 代理部署方式介绍... 3 Virtual Server L7 携带源地址代理部署方式介绍... 5 Fortinet 公司第 2 页 / 共 7 页 www.fortinet.com.cn
简介 FortiADC L7 方式的服务器负载均衡主要通过报文中的真正有意义的应用层内容, 再加上 FortiADC 设置的负载调度算法, 而决定最终选择的内部服务器 以常见的 HTTP 为例, 负载均衡设备如果要根据真正的应用层内容再选择服务器, 只能先代理最终的服务器和客户端建立连接 ( 三次握手 ) 后, 才可能接受到客户端发送的真正应用层内容的报文, 然后再根据该报文中的特定字段, 再加上 FortiADC 设置的调度算法, 决定最终选择的内部服务器 FortiADC 在这种情况下, 更类似于一个代理代理服务器 L7 方式的 SLB 和 L4 相比有一个比较大的优势就是安全性, 网络中最常见的 SYN Flood 攻击, 即黑客控制众多源客户端, 使用虚假 IP 地址对同一目标发送 SYN 攻击, 通常这种攻击会大量发送 SYN 报文, 耗尽服务器上的相关资源, 以达到 DoS 的目的 从技术原理上也可以看出,L4 模式下这些 SYN 攻击都会被转发到后端的服务器上, 而 L7 模式下这些 SYN 攻击由于三次握手不完整自然在负载均衡设备上就截止, 不会影响后台服务器的正常运营 本文将介绍 FortiADC 设备 SLB L7 模式部署的配置方式 Virtual Server L7 代理部署方式介绍 FortiADC SLB 可工作于 7 层代理模式,ADC 将使用出接口 IP 代理客户端与真 实服务器建立连接, 具体处理过程如下图所示 : Fortinet 公司第 3 页 / 共 7 页 www.fortinet.com.cn
客户端发起对 ADC 的 Virtual IP(V_IP) 和 Port 的访问,ADC 先使用 V_IP 与客户端建立起 TCP 连接, 然后 ADC 再使用自己的出接口 IP(IF_IP) 代理发起对真实服务器 (R_IP) 的 TCP 连接,FortiADC 在其中充当代理的角色, 同时实现多个服务器之间业务的负载调度 配置举例 10.60.100.101/16 Redhat-http server1 10.63.100.102/16 L7 PROXY VS:IP10.60.100.100 Port4:10.63.100.1/16 Port2:10.60.100.1/16 ADC Centos-http server2 10.63.100.22/16 10.60.100.102/16 Centos-http server3 10.63.100.23/16 1.config ADC intetface : FortiADC# config system interface FortiADC (interface) # edit port2 FortiADC (port2) # set ip 10.60.100.1/16(clientside) FortiADC (port2) # next FortiADC (interface) # edit port4 FortiADC (port2) # set ip 10.63.100.1/16 (serverside) FortiADC (port4) # end Fortinet 公司第 4 页 / 共 7 页 www.fortinet.com.cn
2.config pool:(realserver pool with 3 members) FortiADC # config load-balance pool FortiADC (pool) # edit pool-4 FortiADC (pool-4) # config pool_member FortiADC (pool_member) # edit 1 FortiADC (4) # set ip 10.63.100.102 FortiADC (4) # next FortiADC (pool_member) # edit 2 FortiADC (1) # set ip 10.63.100.22 FortiADC (pool_member) # edit 3 FortiADC (1) # set ip 10.63.100.23 3.config method:can use default (LB_METHOD_ROUND_ROBIN) 4.config profile:can use default (LB_PROF_HTTP) 5.config virtual-server: FortiADC # config load-balance virtual-server FortiADC (virtual-server) # edit vs7 (add virtual-server) FortiADC (vs7) # set type l7-load-balance (set type L7) FortiADC (vs7) # set interface port2 (set interface) FortiADC (vs7) # set ip 10.60.100.100 (virtual-server IP) FortiADC (vs7) # set port 80 (virtual-server port) FortiADC (vs7) # set load-balance-profile LB_PROF_HTTP ( 选择 profile L7 协议 ) FortiADC (vs7) # set load-balance-method LB_METHOD_ROUND_ROBIN ( 轮询调度 ) FortiADC (vs7) # set load-balance-pool pool-4 ( 调用 Real Server Pool) FortiADC (vs7) # end 当多个客户端发起 访问, 将打开 Web 页面并在 server1 server2 server3 之间轮询调度,FortiADC 采用七层代理调度的方式实现负载 Virtual Server L7 携带源地址代理部署方式介绍 SLB L7 代理携带源地址, 顾名思义就是,FortiADC 在进行代理的时候, 直接使用客户端的 IP(C_IP) 进行与真实服务器 (R_IP) 建立连接, 而并非使用出接口的 IP 地址 (IF_IP), 这样做的好处是, 服务器可以直观的了解到客户访问的 IP 地址 具体工作过程如下图所示 : Fortinet 公司第 5 页 / 共 7 页 www.fortinet.com.cn
客户端发起对 ADC 的 Virtual IP(V_IP) 和 Port 的访问,ADC 先使用 V_IP 与客户端建立起 TCP 连接, 然后 ADC 再借用 Client 的 IP 地址 (C_IP) 代理发起对真实服务器 (R_IP) 的 TCP 连接,FortiADC 在其中充当代理的角色, 同时实现多个服务器之间业务的负载调度 配置举例 10.60.100.101/16 Redhat-http server1 10.63.100.102/16 L7 PROXY VS:IP10.60.100.100 Port4:10.63.100.1/16 Port2:10.60.100.1/16 ADC Centos-http server2 10.63.100.22/16 10.60.100.102/16 Centos-http server3 10.63.100.23/16 1.config ADC intetface : FortiADC# config system interface FortiADC (interface) # edit port2 FortiADC (port2) # set ip 10.60.100.1/16(clientside) FortiADC (port2) # next FortiADC (interface) # edit port4 Fortinet 公司第 6 页 / 共 7 页 www.fortinet.com.cn
FortiADC (port2) # set ip 10.63.100.1/16 (serverside) FortiADC (port4) # end 2.config pool:(realserver pool with 3 members) FortiADC # config load-balance pool FortiADC (pool) # edit pool-4 FortiADC (pool-4) # config pool_member FortiADC (pool_member) # edit 1 FortiADC (4) # set ip 10.63.100.102 FortiADC (4) # next FortiADC (pool_member) # edit 2 FortiADC (1) # set ip 10.63.100.22 FortiADC (pool_member) # edit 3 FortiADC (1) # set ip 10.63.100.23 3.config method:can use default (LB_METHOD_ROUND_ROBIN) 4.config profile:need to config user defined profile, and set client-address enable FortiADC # config load-balance profile FortiADC (profile) # edit l7southaddr FortiADC (l7southaddr) # set type http FortiADC (l7southaddr) # set client-address enable 5.config virtual-server: FortiADC # config load-balance virtual-server FortiADC (virtual-server) # edit vs7 (add virtual-server) FortiADC (vs7) # set type l7-load-balance (set type L7) FortiADC (vs7) # set interface port2 (set interface) FortiADC (vs7) # set ip 10.60.100.100 (virtual-server IP) FortiADC (vs7) # set port 80 (virtual-server port) FortiADC (vs7) # set load-balance-profile l7southaddr ( 选择 profile L7 协议 ) FortiADC (vs7) # set load-balance-method LB_METHOD_ROUND_ROBIN ( 轮询调度 ) FortiADC (vs7) # set load-balance-pool pool-4 ( 调用 Real Server Pool) FortiADC (vs7) # end 当多个客户端发起 访问, 将打开 Web 页面并在 server1 server2 server3 之间轮询调度,FortiADC 采用七层代理调度的方式实现负载 Fortinet 公司第 7 页 / 共 7 页 www.fortinet.com.cn