F5配置技术文档

合集下载

F5配置指导书

F5配置指导书

F5配置指导书一.F5的登陆方式:a.web interface :https://xx.xx.xx.xx(必须在同一网段)mand line : (1)登陆到https://xx.xx.xx.xx后下载SSH client 软件即可(2)console 用串口线将终端与F5的termial端口连起来F5有两个管理口初始默认ip地址:192.168.1.245/24 和192.168.245.245/24 二.Config配置:除了用config 外,用https登陆后选setup utility 进行配置是一样的默认初始用户密码:root/default用超级终端登陆:(19200 )在登陆进去以后输入config 命令:接着选a,回车,选y 、回车系统提示你选键盘类型:Choose your keyboard type from the list below.:US - Standard 101 key接着系统提示你输入root 密码接着系统提示你输入hostname接下来,系统会出现如下画面:如果有两台bigip ,选it is a redundant BIG-IP system(两台作冗余) ,否则选it is no a redundant BIG-IP system.下面以两台BIG-IP 为例:一台的unit number 为1 另一台的则为2 ,其中failover ip 为对端bigip内网的ip地址,两台的配置相对应。

接下来系统让你选端口的类型:按C键continue 就可以了接下来系统出现如下画面:在该界面可以自己添加,删除,重新划分vlan (一般划分3个vlan (internal ,external ,admin ), 看自己喜好):该界面表示是否对该端口进行加密检查,一般内网disable 外网选enabled .内网和外网均要配别名,其中内网的别名作服务器的网关,外网的别名作vip 或proxy.的端口号,端口号的编排规则:从上往下,从左往右接着:在该地方配置路由器的ip地址,配置webserver ,三个vlan 的servername 同以前配的hostname一致,接下来系统要求你输入用https方式登陆webserver时的用户名和密码,一般用户名为admin/admin对于support password 和dns,ntp(时钟同步)回车即可,一般不需要配置。

F5配置文档

F5配置文档

1.大体配置治理地址密码admin查看版本许可:更改治理配置检查日记2.HA配置计划组网方式(一种方式)选择F5 BIG-IP LTM以并行结构接入现有网络环境中,在对BIG-IP LTM进行VLAN划分、IP地址分派时,能够将BIG-IP LTM与所需进行负载均衡的效劳器处于相同VLAN中,所分派的IP地址与效劳器原有IP地址在同一网段内。

如以下图所示:这种方式的接入,F5 BIG-IP LTM与效劳器在同一网段下,所有配置的VS 地址与效劳器IP地址均在同一网段下,通过如此的配置使网络层次结构、数据流量的传输看起来加倍清楚,实施相对较为简单。

在这种方式下效劳器的默许网关一样会设置为BIG-IP LTM上对应的Self IP 或Floating IP,使客户端流量通过BIG-IP LTM负载均衡后直接抵达后端效劳器时,无需做任何源地址转换及路由选择,保留了客户端源地址,能够很容易的知足应用上一些特定要求。

HA部署方式(一种方式)两台F5 BIG-IP LTM间采纳Failover线缆监控设备心跳信息,数据同步信息与实际业务数据别离在单独的线路上传递,具体如以下图所示:如此部署的优势在于使BIG-IP LTM设备间心跳信息和数据信息在不同的通道传送,保证了数据独立性,同时数据信息和业务信息分开,保证了其平平稳固性,但增加了设备端口的利用数量。

建议在设备端口密度充沛的情形下利用此种部署结构。

VLAN计划在此连接模式下,建议BIG-IP上划分3个VLAN,别离为:Internal:用于连接后端的服务器,通常,我们采用100M端口连接后端服务器。

failover_vlan:主要用于两台BIG-IP之间的配置同步和Session同步。

通常情况下在端口数量足够的时候我们用一个单独的端口用于配置和Session同步。

如果在端口数量不足时,可不使用本VLAN而使用internal VLAN来进行配置和Session同步。

F5配置手册

F5配置手册

F5 BIG-IP负载均衡器配置指导书目录一、网络结构与IP地址规划 (3)二、配置BIGIP3400负载均衡设备 (5)2.1设置负载均衡器管理网口地址 (5)2.2登录BIGIP的WEB管理界面 (5)2.3激活License (6)2.4初始化设置 (8)2.4.1BIG-IP 1上的平台(Platform)通用属性设置 (8)2.4.2修改系统时间 (9)2.4.3重新启动bigip (9)2.5配置网络层 (10)2.5.1划分vlan (10)2.5.2定义IP地址 (11)2.5.3配置路由 (13)2.6配置双机设置(High Availability) (14)2.6.1配置Redundant Pair的IP地址 (14)2.6.2配置双机自动切换机制FailSafe配置 (16)2.7配置服务器负载均衡 (17)2.7.1配置Monitor (18)2.7.2配置Profile (18)2.7.3配置负载均衡Pool (19)2.7.4创建iRule负载均衡控制规则以实现地址栏访问不带后缀 (21)2.7.5建立Virtual server实现对服务器的负载均衡 (21)2.8两台BIGIP配置同步 (23)2.9备份配置 (24)三、系统运行状态检查及维护 (25)3.1检查系统日志信息: (25)3.2检查pool状态 (26)3.3查看流量信息 (27)3.4查看系统当前性能参数 (28)3.5密码的更改 (28)3.6添加“只读”权限的管理员帐号 (28)一、网络结构与IP地址规划网络拓扑结构如下图所示:整个数据网络设备,采用两台BIG-IP 1600负载均衡器、及一台交换机、网络设备都采用主、备设备,以实现设备的冗余备份,以消除单点故障。

这里部署负载均衡器的目的主要是为了增加服务器的数量,以提升系统的处理能力。

但对外仍然是一个IP地址。

相关的IP地址规划如下:二、配置BIGIP3400负载均衡设备本章将主要描述BIGIP3400负载均衡设备的配置方法及配置内容。

F5负载均衡器配置指导书

F5负载均衡器配置指导书

F5负载均衡器配置指导书F5负载均衡器配置指导书目录1、引言1.1 目的1.2 范围1.3 读者对象1.4 术语定义2、配置前准备2.1 负载均衡器选型2.2 网络拓扑准备2.3 硬件和软件准备2.4 许可证申请3、F5负载均衡器安装与初始化3.1 硬件安装3.2 系统初始化3.3 配置管理IP地质3.4 获取及安装许可证3.5 系统升级4、虚拟服务器配置4.1 创建虚拟服务器4.2 虚拟服务器属性配置4.3 负载均衡算法配置4.4 虚拟服务器监控配置4.5 虚拟服务器池配置4.6 虚拟服务器高级配置5、节点配置5.1 创建节点5.2 节点监控配置6、监控配置6.1 创建健康检查6.3 多节点监控配置7、池配置7.1 创建池7.2 添加节点到池7.3 负载均衡算法配置7.4 池健康检查配置7.5 池高级配置8、SSL证书与配置8.1 配置SSL证书8.2 SSL卸载与加速8.3 SSL握手优化9、流量控制与QoS配置9.1 流量控制策略配置9.2 QoS配置10、应用层协议优化10.1 HTTP优化配置10.2 TCP优化配置附件1、示例配置文件2、节点信息表法律名词及注释1、负载均衡器:指用于分配网络或应用程序负载的设备,用于提高系统的可用性和性能的中间件。

2、虚拟服务器:指用于将客户端请求转发到后端一组服务器的逻辑实体。

3、节点:指在负载均衡器上的后端服务器。

4、健康检查:指负载均衡器自动检测节点(server)是否可访问的机制,用于确保只有正常运行的节点接收请求。

5、池:指一组服务器实例的集合。

6、SSL证书:指用于加密和认证数据传输的数字证书。

7、QoS:指通过优先处理或限制网络流量来改善服务质量的技术。

F5命令行配置配置手册

F5命令行配置配置手册

bigstart Restarts the SNMP agent bigsnmpd. bigtop Displays real-time statistics.Config Configures the IP address, network mask, and gateway on the management (MGMT) port.Use this command at the BIG-IP system prompt prior to licensing the the BIG-IP system, and do not confuse it with the bigpipe config command or the BIG-IP Configuration utility.halt Shuts down the BIG-IP software application.hostname Displays the name you have given to the BIG-IP system.printdb Prints the values of one or more entries in the bigdbTM database. reboot Reboots the BIG-IP system.ssh and scp Access command line interfaces on other SSH-enabled devices, and copy files to or from a BIG-IP system.自定义Bigpipe shell名称bp> shell prompt <string>bp> shell prompt BIG-IP>系统Shell名称将变成:BIG-IP>此特性避开此限制,在Linux命令前加”!”.BIG-IP>!ls //查看目录BIG-IP>!ifconfig //查看接口配置•Routes•Self IP addresses•Packet Filters•Trunks (802.3ad Link Aggregation)•Spanning Tree Protocol (STP)•VLANs and VLAN groups•ARP配置Packet Filtering命令: bigpipe packet filter你可以定义一个包过滤规则来提供访问控制,速率shaping,审计. 配置路由命令:route (<route key list> | all | inet | inet6)F5的Show Tech[root@XXXX:Standby] config # qkviewGetting systemwide backup configuration files.Getting AOM information.Getting last 175 lines of log files.Getting last 175 lines of gzipped log files.Getting md5 sum information.Getting core file list.Getting Public Certificate information.Getting tmctl information.completed... 6 of 161 checks produced no dataDiagnostic information has been saved in file /var/tmp/-tech.out Please send this file to **************.bigtop - display real-time statistics-bytes display counts in bytes (vs bits)-pkts display counts in packets (vs bits)-reqs display counts in requests (vs connections)-vips <n> number of virtual servers to print-nodes <n> number of nodes to print-once print once and exit-delay <n> number of seconds between samples (default 4)-scroll disable full-screen mode-nosort disable sorting-conn sort by connection count (vs byte count)-delta sort by count since last sample (vs total)-n print IP address and services in numeric format-vname display virtual servers by name (vs IP address)-help, -h print this message日志文件系统1. Access the BIG-IP system prompt.2. Stop the BIG-IP system or put the system into a safe condition such as standby mode using the bigstart stop command.3. Type the following command:resize-logFSThis command prompts you for the desired file size in gigabytes.4. At the prompt, type an integer.The minimum allowed value is 1, and the maximum allowed value is 10.A prompt appears that allows you to confirm the specified file size.5. Type Y.A message appears, notifying you of the need for the BIG-IP system to perform a reboot, followed by a prompt, which allows you to permit the reboot operation. Note: Prior to rebooting, the BIG-IP system verifies that the integer you typed in step 3 is within the allowed range, and checks to ensure that enough disk space exists for the specified size.6. Type Y.A confirmation prompt appears.7. Type Y.The system displays messages indicating that the reboot operation is about to occur.8. Wait for the reboot operation to finish.When the system becomes available again, the newly-specified disk space for the log file will be in effect.WARNINGDo not delete the files: /shared/.LoopbackLogFS and /shared/LogFS_README, because this action deletes all of your log files.启用/禁用虚拟服务或虚拟地To enable or disable a virtual server, use the appropriate command syntax:bp> virtual <virtual addr>:<virtual port> enable | disableTo enable or disable a virtual address, use the appropriate command syntax:bp> virtual address <virtual addr> enable | disable从服务中移出单个的NodeYou can remove an individual node from service, or return an individual node to service from the bigpipe shell command line.To remove an individual node from service, use the following command:bp> node <node addr>:<node port> downTo return an individual node to service, use this command:bp> node <node addr>:<node port> up查看修改F5系统配置文件器来编辑或者查看这些文件,当你没有条件使用浏览器时,有时候修改配置文件很有必要.这就需要F5的无浏览器配置模式和命令行配置模式Important:在你编辑完bigip.conf or bigip_base.conf 重启MCPD service之前, 你必须运行bigpipe load 确保MCPD service 使用的是当前的配置数据alert.conf Stores definitions of SNMP traps (system default alerts).user_alert.conf Stores definitions of SNMP traps (user-defined alerts)./config/bigip.conf Stores all configuration objects for managing local application traffic, such as virtual servers, load balancing pools, profiles, and SNATs.Note that after you edit bigip.conf, and before you restart the MCPD service, you must run the bigpipe load command./config/bigip_base.conf Stores BIG-IP self IP addresses and VLAN and interface configurations. Note that after you edit bigip_base.conf, and before you restart the MCPD service, you must run the bigpipe load command./config/bigip.license Stores authorization information for the BIG-IP system./etc/bigconf.conf Stores the user preferences for the Configuration utility./config/bigconfig/openssl.conf Holds the configuration information for how the SSL library interacts with browsers, and how key information is generated./config/user.db Holds various configuration information. This file is known as the bigdb database. /config/bigconfig/httpd.conf Holds configuration information for the web server./config/bigconfig/users The web server password file. Contains the user names and passwords of the people permitted to access whatever is provided by the webserver./etc/hosts Stores the hosts table for the BIG-IP system./etc/hosts.allow Stores the IP addresses of workstations that are allowed to make administrative shell connections to the BIG-IP system./etc/hosts.deny Stores the IP addresses of workstations that are not allowed to make administrative shell connections to the BIG-IP system./etc/rateclass.conf Stores rate class definitions./etc/ipfwrate.conf Stores IP filter settings for filters that also use rate classes. /etc/snmpd.conf Stores SNMP configuration settings./etc/snmptrap.conf Stores SNMP trap configuration settings./config/ssh Contains the SSH configuration and key files./etc/sshd_config This is the configuration file for the secure shell server (SSH). It contains all the access information for people trying to get into the system by using SSH./config/routes Contains static route information.[root@ISAG-2:Standby] config # find_keysISAG-2 koradsatn. omtitra eodISAG-2 junl trig Cmi nevl5scnsdt md.6koradsatn. omtitra eodFound license key JTPBO-CHRSX-DGBIO-HOAHJ-MOZJEVALicense file location is: /sda.1/config/bigip.licenseFound license key JTPBO-CHRSX-DGBIO-HOAHJ-MOZJEVAUnmounting unneeded partitions... ISAG-2 junl trig Cmi nevl5scnsn Cmi nevl5scnsree aamd.<>junl trig Cmi nevl5scns<6>EXT3-fs: mounted filesystem with ordered data mode.ISAG-2 junl trig Cmi nevl5scns<6>kjournald starting. Commit interval 5 secondscompleteAbove information can be found in /tmp/keys.outManaging Local Application Traffic•Setting up load balancing•Controlling HTTP traffic•Implementing HTTP and TCP optimization profiles•Authenticating application traffic•Implementing persistence•Enhancing the performance of the BIG-IP system•Managing health and performance monitors•Implementing iRules设置VirtualServer负载均衡1. Decide what types of traffic you want the BIG-IP system to manage, as well as whether you want to implement session persistence, connection persistence, and remote authentication.2. For each decision in step 1, decide whether you want to use the corresponding default profile that the BIG-IP system provides, or whether you want to create a custom profile.3. Access the bigpipe shell.4. If you want to create custom profiles, use the profile command, specifying the appropriate type of profile as an argument. If you do not want to create custom profiles, skip this step.5. Create one or more load balancing pools, using the pool command.6. Create a virtual server, using the virtual command, and assign to it any profiles and pools that you created. If you are using default profiles, some of those profiles might already be assigned to the virtual server by default.配置克隆Pool克隆Pool设计是用于入侵检测,你可以针对一个VS设置一个克隆Pool,这个克隆的VS接收世的流量和普通Pool一样,你就可以复制流量到入侵检测系统中.1. Access the bigpipe shell.2. Use the virtual command, to create or modify a virtual server, specifying a value for the clone pool argument.配置最后一跳Pool默认,BIG-IP系统自动启用最后一跳特性是,如果你想禁用这个特性.然后自己手工定义一个最后一跳路由器,你可以建立一个最后一跳pool并且指定其属于某个VS当中.1. Access the bigpipe shell.2. Use the pool command to create a last hop pool that contains the router inside addresses.3. Use the lasthop pool argument with the virtual command to assign the last hop pool to a virtual server.If you have not assigned an SSL profile to the virtual server, use the profile argument with the virtual command to assign the profile to the virtual server.配置SNATs这里有两种基础方法来建议一个SNAT,你可以直接将一个转换地址委派给一个或多个源IP地址,或者你可以配置一个SNAT pool,然后委派这个SNAT pool到某个源IP地址,在较新的版本中,BIG-IP自动从SNAT Pool中选择一个转换地址Note that you can assign these types of mappings from within an iRule.To map a single translation address to an original address1. Access the bigpipe shell.2. Designate an IP address as a translation address, using the snat translation command.3. Map the translation address to one or more original IP addresses, using the snat command or the rule command.To map a SNAT pool to an original address1. Access the bigpipe shell.2. Create a pool of translation addresses (that is, SNAT pool), using the snatpool command.3. Map the SNAT pool to one or more original IP addresses, using either the snat command or the rule command.配置HTTP traffic你可以配置BIG-IP来控制HTTP流量:配置HTTP压缩,HTTP请求重定向,HTTP请求重写,插入和插除HTTP头,启用或者禁用cookie加密和SYN cookie支持,配置HTTP 类Profile, HTTP响应数据组块控制.Configuring HTTP compression配置BIG-IP系统压缩HTTP 服务响应1. Access the bigpipe shell.2. Configure the compression-related settings of an HTTP profile,using the profile http command.3. Assign the HTTP profile to a virtual server, using the virtual command.Redirecting HTTP requests你可以配置HTTP Profile来重定向HTTP请求,并且在这个Profile中定义一个Fallback主机1. Access the bigpipe shell.2. Using the profile http command, create or modify an HTTP profile, specifying a value for the fallback argument. You can specify either a URI or the default fallback host, or you can specify that you want no HTTP redirection.3. Verify that the HTTP profile you created or modified is assigned to a virtual server.Rewriting HTTP redirections你可以配置HTTP Profile来重写HTTP的重定向规则1. Access the bigpipe shell.2. Using the profile http command, create or modify an HTTP profile, specifying a value for the redirect rewrite argument.For example, to create a profile that only rewrites URIs matching the originally requested URI (minus an optional training slash), use the following syntax:profile http myHTTPprofile { redirect rewrite matching }3. Verify that the HTTP profile you created or modified is assigned to a virtual server.Inserting and erasing HTTP headers你可以配置HTTP Profile来插入一个头文件到HTTP请求,或者从HTTP请求中移出一个头文件1. Access the bigpipe shell.2. Using the profile http command, create or modify an HTTP profile, specifying a value for either the header insert, header erase, or insert xforwarded for options.3. Verify that the HTTP or Fast HTTP profile you created or modified is assigned to a virtual server.Enabling or disabling cookie encryption你可以使用Profile http中的两个选项来启用或者禁用cookie加密1. Access the bigpipe shell.2. Using the profile http command, create or modify an HTTP profile, specifying a value for the encrypt cookie and cookie secret options.3. Verify that the HTTP profile you created or modified is assigned to a virtual server.Enabling or disabling SYN cookie support为了管理DOS攻击,你可以在一个Fast L4 Profile中配置SYN Cookie选项启用或者禁用SYN Cookie支持功能◆如果BIG-IP系统包含了Packet Velocity ASIC (PVA)技术,使用profile fastl4命令,定义一个hardware syncookie(enable | disable | default)选项,同样,你可以根据需求设置以下的变量通过db命令.•pva.SynCookies.Full.ConnectionThreshold (default: 500000)•pva.SynCookies.Assist.ConnectionThreshold (default: 500000)•pva.SynCookies.ClientWindow (default: 0)值得注意的是这个hardware syncookie 特性目前只可用于D84和D88平台.在其实平台设备这个特性无效.所以如果你在D84和D88上设置software syncookie 特性,SYN Cookie只通过软件处理◆如果BIG-IP系统不包含Packet Velocity ASIC(PVA)技术,使用profile fastl4 命令,指定为software syncookie (enable | disable | default) option.Configuring the HTTP Class profileBIG-IP系统包含一种Profile叫做HTTP Class Profile,你可以使用你定义的标准来用分类HTTP流量,当你分类流量的时候,你转地流量的原则是根据审查目标流量的头文件或者内容来定.如果BIG-IP系统包含Application Security Manager (ASM)或者WebAcclerator模块,你可以配置系统来先发送HTTP流量到那个模块,然后再发送到最终目标,例如,你可以使用HTTP Class Profile来对Virtual Server下命令,要求它发送流量先经过ASM然后再转发到负载均衡Pool.Unchunking and rechunking HTTP response data如果你想要监控内容你可以取消或者重新对HTTP响应进行组块操作,只需要配置HTTP Profile来启用unchunking功能.1. Access the bigpipe shell.2. Using the profile http command, create or modify an HTTP profile and specify the response argument.3. Make sure that you have assigned the HTTP profile to a virtual server, using the virtual command.你能够设备的保持有以下几种:实施Session保持•Cookie•Destination Address Affinity•Microsoft Remote Desktop Protocol (MSRDP)•Hash•Session Initiation Protocol (SIP)•Source Address Affinity•SSL•Universal具体操作:1. Access the bigpipe shell.2. Create a persistence profile, using the profile command, that corresponds to the type of persistence you want to implement.3. Assign the persistence profile to a virtual server, using the persist and fallback persist arguments with the virtual command.实施连接保持为了实施连接保持,你可以添加一个Keep-Alive头文件到HTTP /1.0头文件里(如果不存在).(默认HTTP/1.1连接包含Keep-Alive支持),你同样可以启用connection pooling特性,它可以保持服务器端的连接打开,重新用来供其它客户端请求所使用.你可以通过修改HTTP或者Fast HTTP Profile文件来启用keep-alive支持和Connection pools.同样可以修改OncConnect Profile来实现.To add Keep-Alive headers into HTTP requests1. Access the bigpipe shell.2. To ensure that HTTP connections stay open, use the profile http command and specify the oneconnect transformations argument. This ensures that the BIG-IP system inserts aConnection:Keep-Alive header into any HTTP /1.0 request that does not already contain one.3. Make sure that you have assigned the HTTP or Fast HTTP profile to a virtual server, using the virtual command.To enable connection pooling1. Access the bigpipe shell.2. Using the profile oneconnect command, configure a profile for connection pooling.3. Assign the profile to a virtual server, using the profile argument with the virtual command.小提示:你同样可以通过配置Fast HTTP Profile来配置连接保持,在BIGPIPE SHEEL中使用fasthttp命令.加强BIG-IP性能BIG-IP系统.设置连接Qos和数据包TOS等级你可以使用bigpipe工具来设置QoS和TOS等级,你不仅可以对所有具有目标负载均衡Pool的流量做,同时你也可以对自定义的流量做,例如:Layer 4 ,TCP 和UDP流量.1. Decide whether you want to set QoS and ToS levels for traffic targeted for an entire pool or for specific types of traffic, or both.•If you want to set the QoS and ToS levels for an entire pool, access the bigpipe shell and use the pool command with one or more of the following arguments: link qos to client, link qos toserver, ip tos to client, and ip tos to server.•If you want to set the QoS and ToS levels for certain types of traffic, access the bigpipe shell and use the profile command to create or modify a Fast L4, TCP, or UDP profile.2. Verify that the pool or the profile that you created or modified is assigned to a virtual server. To do this, use the following syntax:bp> virtual <virtual server name> list设置空闲超时时间(Idle timeout time)或者修改一个Fast L4,Fast HTTP,TCP,或者UDP Profile.1. Create or modify a Fast L4, Fast HTTP, TCP, or UDP profile, by accessing the bigpipe shell and using the profile command.2. Specify the idle timeout argument to set a timeout value.3. Verify that the profile you created or modified is assigned to a virtual server.实施速率整形Virtual Server或者Packet Filter规则中.1. Access the bigpipe shell.2. Create one or more rate classes, using the rate class command.3. Assign the rate classes to a virtual server or a packet filter rule, using either the virtual command or the packet filter command.Implementing iRulesiRule特性强大而灵活,值得注意的是它可以增强BIG-IP系统能力.一个iRule可以引用任意object,它不管这个被引用的object处理哪个分区里.例如;一个iRule属于分区A,但包含指定一个Pool属于分区B的语句.1. Access the bigpipe shell.2. Create an iRule using the rule command. You must include the name of the Tcl script and the script itself as arguments for the command.3. Assign the iRule to a virtual server, using the virtual command in one of the following ways:•To associate multiple iRules with a virtual server, use this syntax:bp> virtual <virtual_server_name> rule <iRule1_name> \ <iRule2_name> ...•To remove the assignment of an iRule from a virtual server, use this syntax:bp> virtual <virtual_server_name> rule none•To remove the iRule assignments from multiple virtual servers, use the following syntax. Note that you can remove the iRule assignments only from virtual servers that reside in the current Write partition or in partition Common.bp> virtual all rule none•To associate an existing iRule with multiple virtual servers, use the following syntax. Note that you can associate an iRule only with virtual servers that reside in the current Write partition or in partition Common. bp> virtual all rule <iRule_name>Important: In this case, the iRule becomes the only iRule that is associated with each virtual server in the current Write partition. Because this command overwrites all previous iRuleassignments, we do not recommend use of this command.。

F5BIGIP配置文档

F5BIGIP配置文档

F5BIGIP配置⽂档BIGIP标准配置⽂档⽬录1. 连接BIGIP (4)1.1 Console⽅式 (4)1.2 ⽹络连接⽅式 (4)1.2.1 基于WEB⽅式 (4)1.2.2 基于SSH⽅式 (7)2.⽹络配置 (9)2.1 ⽹络配置步骤及流程 (9)2.1.1 L2 Vlan 配置 (10)2.1.2 L3 self ip 配置 (11)2.2 服务器直连模式⽹络配置 (12)2.2.1 ⽹络连接拓扑图 (12)2.2.2 VLAN划分 (12)2.2.3 IP地址划分 (13)2.3 服务器⾮直连模式⽹络配置 (14)2.3.1 ⽹络拓扑结构 (14)2.3.2 VLAN划分 (14)2.3.3 IP地址划分 (15)2.4 透明模式⽹络配置 (16)2.4.1 ⽹络拓扑结构 (16)2.4.2 VLAN划分 (16)2.4.3 IP地址划分 (16)2.5 静态路由的添加 (17)3.负载均衡配置 (17)3.2 Pool配置 (19)3.3 Virtual Server配置 (22)3.4 会话保持配置 (24)3.4.1 会话保持的概念 (24)3.4.2 Simple会话保持 (25)3.4.3 Cookie 会话保持 (26)3.5 iRules配置 (27)3.6 Monitor配置 (30)3.6.1 Monitor的添加 (30)3.6.2 Node Address Monitor配置 (33) 3.6.3 Node Association Monitor配置 (35)3.6.4 Monitor 的验证 (36)4. SNAT配置 (37)4.1 SNAT的概念 (37)4.2 NAT配置 (38)4.3 SNAT配置 (39)4.3.1 SNAT IP配置 (39)4.3.2 SNAT AutoMap配置 (41)5. Redundent配置 (42)6. 系统维护部分配置 (46)6.1 SNMP配置 (46)6.2 Syslog配置 (47)6.3 NTP配置 (47)6.4 ⽤户管理 (50)7. BIGIP命令⾏常⽤命令解释 (57)7.1 系统配置相关命令 (57)7.2 系统维护相关命令 (57)1.连接BIGIP1.1Console⽅式基于Console终端配置BIG-IP 的准备安装Windows操作系统的PC⼀台(装有超级终端)BIGIP设备⾃带的Console电缆⼀条使⽤超级终端建⽴⼀个连接,通过Console电缆⼀端连接BIGIP,⼀端连接COM,COM的参数设置如图:1.2⽹络连接⽅式1.2.1基于WEB⽅式在浏览器地址栏键⼊https://(BIGIP 设备IP地址),如下图:回车后,出现以下界⾯:此对话框为浏览器与BIGIP通讯交换的证书提⽰,点击“是”继续输⼊⽤户名和密码点击确定继续点击Configure your BIGIP Using Configration Utility进⼊BIGIP配置主界⾯。

F5负载均衡运维配置手册V1.0

F5负载均衡运维配置手册V1.0

F5负载均衡运维配置手册V1.0一、前言F5负载均衡设备是一款企业级的负载均衡器,可以实现对Web服务器负载均衡的管理。

本手册主要介绍了F5负载均衡设备的运维配置,包括设备的基础配置、虚拟服务的创建、健康检查和命令行配置等。

二、设备的基础配置设备的基础配置可参考以下步骤:1.连接设备管理口,使用默认IP地址和管理员密码登录设备管理界面;2.进入系统管理 > 网络,修改网络配置,设置设备IP地址;3.进入系统管理 > 设备名,修改设备名;4.进入系统 > DNS,配置DNS服务器地址;5.进入系统 > NTP,配置NTP服务器地址;6.进入系统 > License,安装所需的授权文件。

三、虚拟服务器的创建虚拟服务器是负载均衡设备上的一个逻辑实体,可以将多个Web服务器关联在一起,实现负载均衡的目的。

虚拟服务器的创建可参考以下步骤:1.进入本地交通管理 > 虚拟服务器,点击创建;2.配置虚拟服务器的名称、IP地址、监听端口等基本信息;3.配置默认池,即关联的服务器池;4.配置健康检查,可以设置ping、http、tcp等多种检查方式。

四、服务器池的配置服务器池是虚拟服务器中实际执行Web请求工作的服务器集合,服务器池的创建可参考以下步骤:1.进入本地交通管理 > 服务器池,点击创建;2.配置服务器池的名称、协议、端口等基本信息;3.配置服务器列表,即真正执行Web请求工作的服务器地址。

五、健康检查健康检查是负载均衡设备监控服务器状态的一种方式,通过健康检查可以及时发现问题服务器,并进行故障切换。

健康检查的配置可参考以下步骤:1.进入本地交通管理 > 健康检查;2.添加健康检查,设置健康检查名称、方式、地址、端口、命令等;3.配置两个备份服务器,即故障转移时可用的备份服务器。

六、命令行配置F5负载均衡设备支持命令行方式进行配置,通过命令行可以实现复杂的配置操作,包括基础配置、虚拟服务器的创建、服务器池的配置、健康检查的配置等。

F5配置手册(简要流程)

F5配置手册(简要流程)

F5配置手册(简要流程)F5配置手册(简要流程)负载均衡器通常称为四层交换机或七层交换机。

四层交换机主要分析IP层及TCP/UDP层,实现四层流量负载均衡。

七层交换机除了支持四层负载均衡以外,还有分析应用层的信息,如HTTP协议URI 或Cookie 信息。

一、F5配置步骤:1、F5组网规划(1)组网拓朴图(具体到网络设备物理端口的分配和连接,服务器网卡的分配与连接)(2)IP地址的分配(具体到网络设备和服务器网卡的IP地址的分配)(3)F5上业务的VIP、成员池、节点、负载均衡算法、策略保持方法的确定2、F5配置前的准备工作(1)版本检查f5-portal-1:~# b versionKernel:BIG-IP Kernel 4.5PTF-07 Build18(2)时间检查--如不正确,请到单用户模式下进行修改f5-portal-1:~# dateThu May 20 15:05:10 CST 2004(3)申请license--现场用的F5都需要自己到F5网站上申请license3、F5的通用配置(1)在安全要求允许的情况下,在setup菜单中可以打开telnet及ftp功能,便于以后方便维护(2)配置vlan unique_mac选项,此选项是保证F5上不同的vlan 的MAC地址不一样。

在缺省情况下,F5的各个vlan的MAC地址是一样的,建议在配置时,把此项统一选择上。

可用命令ifconfig –a来较验具体是system/Advanced Properties/vlan unique_mac(3)配置snat any_ip选项选项,此选项为了保证内网的机器做了snat后,可以对ping的数据流作转换。

Ping是第三层的数据包,缺省情况下F5是不对ping的数据包作转换,也就是internal vlan的主机无法ping external vlan的机器。

(注意:还可以采用telnet来验证。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

目前,许多厂商推出了专用于平衡服务器负载的负载均衡器,如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:①、如图,假设域名被解析到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演示页面:/book/f5/vlan_create.htm★VLAN列表演示页面:/book/f5/vlan_list.htm1、创建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演示页面:/book/f5/selfip_create.htm1、创建自身内网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(默认值)四、创建默认网关路由★创建默认网关路由演示页面:/book/f5/routes_create.htm1、创建默认网关路由在“Network→Routes”页面点击“create”按钮:①、Type栏选择:Default Gateway(默认值)②、Resource栏选择:Use Gateeay...,在其后的输入框填写网关IP地址:61.1.1.1(这里假设此IP 为外网网关地址)五、创建服务器自定义健康检查★创建服务器自定义健康检查演示页面:/book/f5/monitors_create.htm1、创建自定义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)★创建服务器池演示页面:/book/f5/pools_create.htm1、创建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以及它们的端口802、创建第一组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以及它们的端口803、创建第二组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演示页面:/book/f5/profiles_create.htm1、创建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规则演示页面:/book/f5/irules_create.htm1、创建iRules规则:irules_apache在“Local Traffic→Profiles”页面点击“create”按钮:①、Name栏填写:irules_apache(填一个英文名称)②、Definition栏填写以下脚本,将访问的域名为“”,访问的网址以“.htm”结尾,或者以“/read.php”开头的请求全部转到服务器池“pool_apache_irules”:view plaincopy to clipboardprint?1.when HTTP_REQUEST {2.if{[HTTP::host] equals ""and [HTTP::uri] ends_with ".htm"}{3.pool pool_apache_irules4.}5.elseif {[HTTP::host] equals "" and [HTTP::uri] starts_with"/read.php"} {6.pool pool_apache_irules7.}8.}九、创建虚拟服务器(Virtual Servers)★创建虚拟服务器演示页面:/book/f5/vs_create.htm1、以“四层”负载均衡模式创建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资源,能够处理更大的访问量。

相关文档
最新文档