F5负载均衡器配置指导书v1.02 - 图文

更新时间:2024-05-07 12:19:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

华为技术有限公司 Huawei Technologies Co. Ltd. 密级: 使用对象: 产品名称: 内部公开 工程师、合作方、用户 F5配置指导书

F5负载均衡器配置指导书

拟制: Prepared by 审核: Reviewed by

审核: Reviewed by

批准: Granted by

林浩泓 日期:Date 何韬 日期:Date 日期:Date

日期:Date

华为技术有限公司

Huawei Technologies Co., Ltd.版权所有 侵权必究 All rights reserved

2004-2-16 2004-2-17 yyyy-mm-dd yyyy-mm-dd

F5负载均衡器配置指导书 内部公开

修订记录Revision record

日期 Date 修订版本Revision version 创建文档 初稿完成 1.00 1.01 描述Description 作者Author 2004-01-11 0.01 2004-2-16 2004-2-17 林浩泓 林浩泓 根据何韬意见,添加vlan tag、pools、virtual 林浩泓 servers、node、session persistent、monitor概念解释,勘误 根据付洪磊意见,对创建虚拟服务器添加注意事项 林浩泓 2004-12-28 1.02 2004-12-28

内部资料,请勿扩散 第2页, 共62页

F5负载均衡器配置指导书 内部公开

目 录

1

F5负载均衡器简介 ................................................................................................................. 7 1.1 1.2 1.3 2

负载均衡技术简介 ......................................................................................................... 7 F5负载均衡产品介绍 ..................................................................................................... 7 几个常用术语说明 ......................................................................................................... 8

BIG-IP配置步骤与规划准备工作 ....................................................................................... 11 2.1 2.2 2.3 2.4

BIG-IP配置步骤 ........................................................................................................... 11 准备要点 ....................................................................................................................... 11 组网和IP地址规划 ........................................................................................................ 12 BIG-IP接口编号说明 ................................................................................................... 13

3 命令行进行SETUP配置....................................................................................................... 14 3.1 3.2 3.3 3.4 3.5

配置终端 ....................................................................................................................... 14 启动F5 ........................................................................................................................... 14 输入用户名口令 ........................................................................................................... 15 设置终端类型 ............................................................................................................... 15 SETUP初始化配置 ......................................................................................................... 16

3.5.1 提示系统License不存在 ........................................................................................... 16 3.5.2 设置键盘类型 ........................................................................................................... 17 3.5.3 设置root密码 ............................................................................................................ 17 3.5.4 设置主机名 ............................................................................................................... 18 3.5.5 双机系统设置 ........................................................................................................... 19 3.5.6 设置接口速率和双工类型 ....................................................................................... 21 3.5.7 配置VLAN和IP地址 ................................................................................................. 21 3.5.8 添加接口到VLAN中 ................................................................................................. 24 3.5.9 选择VLAN IP地址与主机名关联............................................................................. 24 3.5.10

2004-12-28

配置默认网关 ....................................................................................................... 25

内部资料,请勿扩散

第3页, 共62页

F5负载均衡器配置指导书 内部公开

3.5.11 3.5.12 3.5.13 3.5.14 3.5.15 3.5.16 3.5.17 3.5.18 4

配置WEB访问 ...................................................................................................... 26 配置SSH访问 ........................................................................................................ 28 配置F5支持访问 .................................................................................................. 29 设置时区 ............................................................................................................... 30 配置NTP支持 ....................................................................................................... 31 配置DNS代理转发 ............................................................................................... 31 用户认证配置 ....................................................................................................... 31

Setup配置完成 ...................................................................................................... 32

激活LICENSE ...................................................................................................................... 33 4.1 4.2

通过WEB访问BIG-IP ................................................................................................... 33 激活LICENSE步骤 ......................................................................................................... 33

5 6

系统时钟更改 ....................................................................................................................... 37 WEB CONFIGURATION UTILITY进行配置 ................................................................. 38 6.1 6.2 6.3 6.4

进入配置工具 ............................................................................................................... 38 配置VLAN和端口 ........................................................................................................ 39 配置VLAN IP地址 ........................................................................................................ 39 配置负载均衡池 ........................................................................................................... 40

6.4.1 配置池名、成员IP地址和负载均衡策略 ............................................................... 40 6.4.2 会话保持配置 ........................................................................................................... 41 6.5

配置节点状态监控 ....................................................................................................... 42

6.5.1 自定义节点状态监控 ............................................................................................... 43 6.5.2 监控与节点相关联 ................................................................................................... 44 6.6

配置虚拟服务器 ........................................................................................................... 45

6.6.1 创建虚拟服务器 ....................................................................................................... 45 6.6.2 虚拟服务器属性修改配置 ....................................................................................... 46 6.6.3 检查系统状态 ........................................................................................................... 48 6.7

配置SNAT ..................................................................................................................... 49

6.7.1 配置步骤 ................................................................................................................... 49

2004-12-28

内部资料,请勿扩散

第4页, 共62页

F5负载均衡器配置指导书 内部公开

6.7.2 验证SNAT配置.......................................................................................................... 51 7

双机配置 ............................................................................................................................... 54 7.1 7.2 7.3 8

注意事项 ....................................................................................................................... 54 初始化后配置步骤 ....................................................................................................... 55 上行连接的监控设置 ................................................................................................... 55

附录A 常见问题说明 .......................................................................................................... 57 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8

BIG-IP单机或两台双机系统处于STANDBY状态,为什么? .................................... 57 BIG-IP系统ROOT密码忘记了,如何恢复? ............................................................... 57 默认的用户名和口令不安全,如何添加新用户或修改现有用户? ........................ 58 BIG-IP系统如何进行配置备份和恢复? .................................................................... 59 SSH访问具有密码加密传输的优点,请问从哪里获取SSH客户端? ..................... 59 网络设备通常有收集系统信息的宏命令,F5有没有相应命令? ........................... 60 如何使用TCPDUMP进行TROUBLESHOOTING? ......................................................... 60 如何实时监视BIG-IP的连接状态? ............................................................................ 62

2004-12-28

内部资料,请勿扩散 第5页, 共62页

F5负载均衡器配置指导书 内部公开

关键词Key words:负载均衡池、虚拟服务器,节点、会话保持、监控、ECV、EAV、SNAT

摘 要Abstract:按照常见的配置步骤,本文对F5 BIG-IP负载均衡器设备配置进行说明,

并对负载均衡器的基本概念和F5设备使用过程中遇到的常见问题进行解答。

缩略语清单List of abbreviations:. ECV EAV SNAT

Extended Content Verification Extended Application Verification secure network address translation

? 可扩展的内容验证

可扩展的应用验证 安全网络地址转换

2004-12-28

内部资料,请勿扩散 第6页, 共62页

F5负载均衡器配置指导书 内部公开

1 F5负载均衡器简介

1.1 负载均衡技术简介

随着业务与软件产品与IP网络关系愈加密切,业务平台提供的性能以及可靠性是电信级应用的关键因素。业务与软件产品中Portal、WAP网关、彩铃和MMS等业务直接通过Internet提供网络服务。由于Internet对业务服务访问具有不可预知性,传统的服务器提供大量并发服务已经面临处理能力和I/O性能的瓶颈,当业务超过已经界限将会出现“Server Too Busy”乃至服务器宕机等问题。

针对单台服务器有限的性能存在瓶颈的情况,负载均衡器通过负载均衡机制将所有请求平均分配到多台节点服务器,使得系统业务处理能力大大提升。此外,负载均衡器还能监控服务器节点的可用性,其中某一台服务器故障时,能将访问请求转移到其它可以正常工作的服务器。

负载均衡器通常称为四层交换机或七层交换机。四层交换机主要分析IP层及TCP/UDP层,实现四层流量负载均衡。七层交换机除了支持四层负载均衡以外,还有分析应用层的信息,如HTTP协议URI或Cookie信息。

1.2 F5负载均衡产品介绍

目前F5负载均衡器有BIG-IP 1000、 BIG-IP 2400、BIG-IP 5000三个型号。

2004-12-28

内部资料,请勿扩散 第7页, 共62页

F5负载均衡器配置指导书 内部公开

BIG-IP 5000

BIG-IP 1000

BIG-IP 2400

1000

D39 Platform 8 10/100 1 Gb

1 x 1 GHz

512 MB Memory 512 Flash

1 SSL Chip (up to 2000 TPS)

0 TPS @ factory

2400

D44 Platform MRA II 16 10/100 2 Fiber GB

1 x 1.26 GHz PIII 512 MB Memory 512 Flash

1 SSL Chip (up to 2000 TPS)

PMC slot for FIPS SSL

5100

D51 Platform 2Gb/s

2x 1.26 Ghz PIII 24 10/100 4 Fiber GB 1 GB Memory 512 Flash

1 SSL Chips* (up to 4,000 TPS) PMC slot for FIPS 5110

Everything the 5100 has except 4 Copper GB

三个型号的配置如下: 最大连接数 空间占用 冗余电源 网络接口 BigIP 1000 BigIP 2400 4,000,000 2U 支持 2x1000 BASE-SX 16x10/100 BASE-TX PIII 1.26 GHz x 1 512 M/2G 512 MB Compact Flash 1x SSL chip 100 TPS 支持 BigIP 5000 (5100/5110) 4,000,000 2U 支持 4x1000 BASE-SX 24x10/100 BASE-TX PIII 1.26 GHz x 2 1G/2G 512 MB Compact Flash 2x SSL chip 100TPS 支持 4,000,000 2U 支持 1x1000 BASE-SX 8x10/100 BASE-TX CPU PIII 1.0 GHz x 1 MEM (STD/MAX) 512 M/2G Storage 512 MB Compact Flash 1x SSL chip SSL 芯片 免费SSL hand-shakes per 100 TPS second 软件模块升级 支持

1.3 几个常用术语说明

在使用F5 BIG-IP负载均衡器时,大家经常对设备配置和维护觉得无从下手干着急。为了让大家对BIG-IP负载均衡器有更深入的了解,本文对BIG-IP负载均衡器常用术语进行介

2004-12-28

内部资料,请勿扩散

第8页, 共62页

F5负载均衡器配置指导书 内部公开

绍。

? 负载均衡池(Pool) ——负载均衡池是根据负载均衡策略接收数据流量的一组设

备。池与特定虚拟服务器相关联,流向虚拟服务器的流量通常会转给相关联的负载均衡池中的成员节点。池可以执行负载均衡操作,比如发送流量到池中的指定节点或定义会话保持方式。

? 虚拟服务器(Virtual Server) —— 虚拟服务器是一个可PING的虚拟IP地址和服

务端口的组合(比如192.168.200.30:http),虚拟服务器与负载均衡池(Pool)相对应,负载均衡池由一或多个节点(Node)组成。

? 节点状态监控(Monitor)—— 节点状态监控用于检验负载均衡池中成员节点的

连接和服务信息,包括节点健康监控和性能监控,当池中成员节点性能下降时BIG-IP系统将会把流量重定向到其它节点。

? 节点(Node) —— 节点是处理负载均衡器发送流量的设备,通常是业务服务器。

当服务器加入负载均衡池成为池成员时,服务器就称为节点。

? 会话保持(Persistence) ——会话保持就是指在负载均衡器可以识别做客户与服务

器之间交互过程的关联性的机制。在对会话实现负载均衡的同时,负载均衡器还确保一系列相关联的访问请求会保持分配到一台服务器上。

? SNAT(安全网络地址转换,secure network address translation) —— SNAT与

跟Cisco/NetScreen PAT(端口地址转换)方式类似,多个节点共享同一IP地址实现对外部网络的访问。

? ECV(可扩展的内容验证,Extended Content Verification)—— ECV用于节点状

态监控。ECV监控通过发送和接收协议指令来获取节点服务内容信息,从而实现对节点的监控。ECV监控服务包括HTTP、HTTPS和TCP,比如,ECV通过“GET /”操作来获取HTTP服务的主页面信息来验证节点服务的状态。

? EAV(可扩展的应用验证,Extended Application Verification )—— EAV用于

节点状态监控。EAV监控通过运行服务检查程序来验证应用的状态。EAV监控服务包括FTP、POP3、SMTP、SQL、NNTP、IMAP、LDAP和RADIUS,比如,EAV通过指定用户名、口令和获取文件路径实现FTP监控。

? VLAN Tag ——在讲述VLAN Tag之前必须要了解IEEE 802.1Q。IEEE 802.1Q在以

太网帧头部插入4个字节,其中12位表示VLAN ID。接口配置为Untagged,接口发

2004-12-28

内部资料,请勿扩散

第9页, 共62页

F5负载均衡器配置指导书 内部公开

送帧时将802.1Q头部去掉,还原为标准以太网帧,这样帧就可以被不支持802.1Q的主机或交换机接收。Untagged接口只能支持一个VLAN。接口配置为Tagged,接口收发帧时包含802.1Q头部。Tagged接口支持多个VLAN,帧中Tag标识所属VLAN。

2004-12-28

内部资料,请勿扩散 第10页, 共62页

F5负载均衡器配置指导书 内部公开

2 BIG-IP配置步骤与规划准备工作

2.1 BIG-IP配置步骤

BIG-IP主要配置步骤如下: 1. 组网和IP地址/命名规划 2. 命令行进行Setup初始化配置 3. 激活License

4. 更改系统时钟(可选) 5. 配置网络VLAN和IP地址 6. 配置负载均衡池 7. 配置节点状态监控 8. 配置虚拟服务器 9. 配置SNAT 10. 配置双机

注:本配置步骤为常见配置顺序,并非为唯一配置方式,比如Setup初始化配置也可以通过Web界面进行配置。本文没有包括过滤和SSL Proxy等配置。主用BIG-IP系统要完成以上所有配置步骤,备用BIG-IP系统可以跳过5-9步,而通过主用BIG-IP系统将配置同步到备用BIG-IP系统中去。

2.2 准备要点

在安装BIG-IP系统之前,请检查如下准备工作是否做好: ? 设备物理连接规划。

? IP地址规划,根据实际需要划分网段和分配IP地址,通常网络设备IP地址为网络中

最大IP地址(默认网关使用最大IP地址),往下递推;主机设备从网络中最小IP地址往上递推进行分配。

? BIG-IP外部VLAN需要3个IP用于冗余BIG-IP配置。 ? 每一个VIP(虚拟IP地址)或NAT需要一个外部VLAN IP。 ? BIG-IP内部VLAN需要3个IP用于冗余BIG-IP配置。 ? BIG-IP内部每个节点需要一个内部VLAN IP。

2004-12-28

内部资料,请勿扩散

第11页, 共62页

F5负载均衡器配置指导书 内部公开

? 确定BIG-IP主机域名,并且确保BIG-IP双机主机名不一样。

2.3 组网和IP地址规划

本文主要给出BIG-IP系统配置使用的指南,具体配置说明不一定跟本实例有关,本例目的主要对实际组网归档交付提供参考。组网和IP地址规划举例如下图所示:

InternetUNTRUST211.139.1.101/30MIP: 211.139.1.1 <-> VIP172.168.96.1FirewallDMZ172.168.96..30/27IP:172.168.96..29/27SwitchVLAN: ExternalTag:200F5_1:172.168.96.26/27浮动IP:172.168.96.28VIP: 172.168.96.1POOL: 172.168.96.66172.168.96.65Port:80VLAN: ExternalTag:200F5_2:172.168.96.27/27浮动IP:172.168.96.28Tagged VLANF5-1VLAN: InternalTag:100F5_1:172.168.96.92/27浮动IP:172.168.96.94F5-2Failover CableVLAN: InternalTag:100F5_2:172.168.96.93/27浮动IP:172.168.96.94Web Server1172.168.96.65/27网关:172.168.96.94Web Server2172.168.96.66/27网关:172.168.96.94 IP地址和物理端口分配如下表所示: 单元号 主机名 VLAN 端口 端口对端描述 外部vlan交换机 级联备用F5 外部vlan交换机 级联主用F5 IP地址 172.16.96.26/27 172.16.96.92/27 - 172.16.96.26/27 172.16.96.92/27 - 浮动IP地址 172.16.96.28 172.16.96.94 172.16.96.28 172.16.96.94 第12页, 共62页

external 1.1 1 f5-1.colorring.net internal 1.3, 1.4 服务器主网卡 tagged 1.8 external 1.1 2 f5-2.colorring.net internal 1.3, 1.4 服务器备网卡 tagged 1.8 2004-12-28

内部资料,请勿扩散

F5负载均衡器配置指导书 内部公开

VIP1与成员信息表如下:

VIP号 1 VIP IP地址 172.16.96.1 VIP端口 80 成员池名 成员节点IP地址 web_pool 172.16.96.65 172.16.96.66 成员节点端口 80 映射方式 SNAT 2.4 BIG-IP接口编号说明 F5接口槽位号编号遵循由上到下,然后由左到右规则。BIG-IP第一槽位为8端口快速以太网接口,2槽位为1端口千兆网接口,3槽位为管理接口。具体编码如下图: 1.12.13.11.11.31.51.72.11.21.41.61.83.1 注:因为BIG-IP的接口与VLAN分配相关,网线连接接口位置不能随意更改,否则可能导致网络无法连接。

1

VIP即虚拟服务器(Virtual Server)IP地址

内部资料,请勿扩散

第13页, 共62页

2004-12-28

F5负载均衡器配置指导书 内部公开

3 命令行进行Setup配置

本文以BIG-IP 1000为例讲解整个配置过程,基本上讲解了BIG-IP整个配置过程。

3.1 配置终端

使用超级终端建立一个连接,通过Console电缆一端连接BIGIP,一端连接COM,COM的参数设置:

串口设置:19200,8-N-1

设置串口的终端仿真为 VT100,如图:

3.2 启动F5

启动F5,超级终端显示如下:

System is booting, Please wait .........

loading /boot

press ESC to boot now, any other key to interrupt boot sequence 4 3 2 1 0

2

basemem = 636K, extmem = 523264K, total 524288K

Checking for ACPI PM SUPPORT...

2

设备内存信息

内部资料,请勿扩散

第14页, 共62页

2004-12-28

Not present

Checking for APM BIOS... APM V1.2 found. Copyright (c) 1996-2003

3

F5负载均衡器配置指导书 内部公开

F5 Networks, Inc. All rights reserved. BIG-IP Kernel 4.5PTF-07 Build18 CPU: Pentium III (Coppermine) (996 MHz)

Hardware Configuration: ....

4

Memory: 512 MB

Crypto Processors: 1 x BCM5822 Network Interfaces:

3.1 00:01:d7:21:c1:80 (exp0) ether 100BaseTX 10BaseT 2.1 00:01:d7:21:c1:ba (bsg2) ether 1000Mbps 1.1 - 1.8 (bs) ether 100BaseTX 10BaseT Other Devices: ..

Setup default configuration... Default configuration complete. ......

IP 192.168.1.245 configured on vlan admin port 3.1 default ....

*** PRODUCT IS UNLICENSED ***

sod bigstpd big3d bigd sfd slapd ipfw rateclass ratefilt ntpdate

6

5

3.3 输入用户名口令

BIG-IP 4.5PTF-07 (default) (console) login:

输入用户“root”和默认密码“default”,回车。

注:基于CLI访问F5的默认用户名为“root”,口令为“default”。基于HTTPS访问的默认用户名为“admin”,口令为“admin”。在业务系统中务必更改默认用户名和口令。

3.4 设置终端类型

Copyright 1992, 1993, 1994, 1995, 1996, 1997 Berkeley Software Design, Inc.

345

设备版本号

设备CPU、内存、网络接口等硬件信息

默认管理IP地址。为了允许远程连接使用Setup配置工具,BIG-IP定义两个预定义IP地址,优选默认IP

地址为192.168.1.245。如果优选地址存在地址冲突,BIG-IP将使用备选IP地址192.168.245.245。

6

第一次使用F5设备,License还没有被激活的提示消息。BIG-IP必须激活License后才能正常使用。

内部资料,请勿扩散

第15页, 共62页

2004-12-28

Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994

The Regents of the University of California. All rights reserved. [省略输出信息……] Terminal type? [vt100]

F5负载均衡器配置指导书 内部公开

缺省的终端类型为vt100,回车

3.5 Setup初始化配置

缺省的主机名字是:default,在提示符下面输入命令:config,回车:

说明:第一次运行config或setup命令将进入setup命令界面。Setup工具可以实现逐步配置root密码、BIG-IP主机名、接口和远程管理等。

default:~# config

3.5.1 提示系统License不存在

第一次运行,提示系统License不存在信息

B I G - I P L I C E N S E P R O B L E M There is no active license on this system. To activate your license, run the 'setup' command again after this configuration and choose the 'License Activation' menu item, or exit from this program now and run the 'license' command. Exit now? (Y/N): n 按“n”键进入License Agreement窗口,按回车键继续,并选择Yes, I Agree To This License。

根据系统提示,继续执行配置步骤直至正式进入Setup Utility。

2004-12-28

内部资料,请勿扩散 第16页, 共62页

F5负载均衡器配置指导书 内部公开

C O N F I G U R A T I O N Setup Utility Welcome to BIG-IP. Before using your BIG-IP, you will have to configure many services and values including: the root password, BIG-IP hostname, interface cards, shared interfaces (if any), and remote administration tools. This utility will take you through the process step-by-step. [ Press ctrl-E to exit and configure manually ] [ press any other key to continue ] 注意:进入BIG-IP Setup工具模式后,无法退出和配置回滚,必须一步一步配完。

3.5.2 设置键盘类型

进入Setup界面后,第一步工作是设置键盘类型,默认使用US - Standard 101 key,回车。

S E T K E Y B O A R D T Y P E Choose your keyboard type from the list below. Belgian Bulgarian MIK French German Japanese - 106 key Norwegian Spanish Swedish US + Cyrillic US - Standard 101 key United Kingdom 3.5.3 设置root密码

设置root密码。输入root密码后,BIG-IP重新提示输入密码。如果前后输入密码匹配,

2004-12-28

内部资料,请勿扩散

第17页, 共62页

F5负载均衡器配置指导书 内部公开

系统立即保存密码。如果密码不一致,Setup工具提供错误消息并提示重新输入密码。

S E T R O O T P A S S W O R D New Root Password: You need to set the root password on your BIG-IP. If you have purchased a redundant BIG-IP system, the root password on both boxes must be the same. Your input will not echo on this page. 注:root密码允许用户通过命令行访问BIG-IP系统。建议root密码长度大于6位,但不要超过32位字节。密码与大小写敏感,建议密码中包含大写/小写字母和特殊字节(比

如,!@#$%^&*)。如果BIG-IP系统为冗余系统,两台主备机的root密码必须保持一致。

3.5.4 设置主机名

S E T B I G - I P H O S T N A M E Enter BIG-IP FQDN : f5-1.colorring.net The FQDN (Fully Qualified Domain Name) identifies this BIG-IP controller. Example: mysystem.mydomain.com. 注:主机名用来标识BIG-IP系统自身。主机名必须符合DNS域名标准。主机部分必须以字母开始,并至少为2个字符。举例:f5-1.colorring.net。

警告:BIG-IP双机系统的主机名必须不一样,否则配置无法同步。

警告:必须通过Setup工具来更改主机名,不得直接编辑/etc/hosts或用hostname命令更改主机名,否则会导致系统不可访问。

2004-12-28

内部资料,请勿扩散 第18页, 共62页

F5负载均衡器配置指导书 内部公开

3.5.5 双机系统设置

配置完主机名之后,BIG-IP系统进入接口配置模式,包括VLAN、IP地址和双机配置。如果工程中配置F5双机系统unit ID(通常为1或2)、fail-over IP地址和fail-over类型。

如果BIG-IP系统为双机,选择Yes, it is a redundant BIG-IP system,否则选择No, it is not a redundant BIG-IP system。

C O N F I G U R E B I G - I P I N T E R F A C E S Is this a redundant BIG-IP system? Yes, it is a redundant BIG-IP system No, it is not a redundant BIG-IP system 若不选择为双机系统,则跳过下列步骤:

A. 设置Unit ID。通常主用系统Unit ID为1,备用系统Unit ID为2。

C O N F I G U R E B I G - I P I N T E R F A C E S Enter the unit identifying number for this BIG-IP. This must be a unique number for each BIG-IP. For example, if this is the second BIG-IP you have configured, enter a '2' below. If it is the first, enter a '1', which is the default. Unit Number: 1 B. 设置Failover IP。通常为备用BIG-IP系统内部接口Self-IP地址。本例中使用Portal VLAN的备用BIG-IP系统IP地址。

2004-12-28

内部资料,请勿扩散 第19页, 共62页

F5负载均衡器配置指导书 内部公开

C O N F I G U R E B I G - I P I N T E R F A C E S Enter the unit identifying number for this BIG-IP. This must be a unique number for each BIG-IP. For example, if this is the second BIG-IP you have configured, enter a '2' below. If it is the first, enter a '1', which is the default. Unit Number: 2 What is the IP address of the failover system? This will typically be the IP of an internal interface on the redundant controller. Failover IP: 172.16.96.93 C. 设置Fail-over类型。本例中选择Hardwired,Fail-over通过双机系统连接Failover线缆来实现,请确保双机之间有Failover线缆。我们还可以选择Network作为Fail-over类型,这时Failover心跳和同步方式将通过网络实现。BIG-IP系统支持MDI/MDI-X自适应,BIG-IP系统之间接口既可以通过直连网线也可以通过交叉网线对接。

C O N F I G U R E B I G - I P I N T E R F A C E S Enter the unit identifying number for this BIG-IP. This must be a unique number for each BIG-IP. For example, if this is the second BIG-IP you have configured, enter a '2' below. If it is the first, enter a '1', which is the default. Unit Number: 2 What is the IP address of the failover system? This will typically be the IP of an internal interface on the redundant controller. Failover IP: 172.16.96.93 Will hardwired or network failover be used for these systems? Hardwired Network 2004-12-28

内部资料,请勿扩散

第20页, 共62页

F5负载均衡器配置指导书 内部公开

3.5.6 设置接口速率和双工类型

本例中一般采用auto默认值按“c”继续。

C O N F I G U R E I N T E R F A C E S Use the arrow keys to navigate. Press to choose an interface and configure its media settings. Press C to continue. NOTE: For best results, choose the Auto media setting. In some cases, x devices configured for Auto media are incompatible and the proper duple x setting will not be negotiated between these devices. In these cases you may need to set the media settings to the same speed and duplex on both this device and the corresponding switch or host. 1.1 auto 1.2 auto 1.3 auto 1.4 auto 1.5 auto 3.5.7 配置VLAN和IP地址

系统默认有3个VLAN:admin、external和internal。按“A”键添加新的VLAN,按“D”键删除一个VLAN,按“C”键继续下一步配置。

2004-12-28

内部资料,请勿扩散 第21页, 共62页

F5负载均衡器配置指导书 内部公开

D E F I N E V L A N S A N D I P A D D R E S S E S Use the arrow keys to navigate. Press to choose a VLAN to configure or modify. Press 'A' to add a new VLAN name. Press 'D' to delete a configuration. Press 'C' to continue. admin external internal Failover IP: 172.16.96.93 Redundant controller is not accessible. No addresses defined. 本例中删除默认admin VLAN。

D E F I N E V L A N S A N D I P A D D R E S S E S Use the arrow keys to navigate. Press to choose a VLAN to configure or modify. Press 'A' to add a new VLAN name. Press 'D' to delete a configuration. Press 'C' to continue. external internal Failover IP: 172.16.96.93 Redundant controller is not accessible. No addresses defined. VLAN配置还包括Port Lockdown 配置、IP地址/掩码/广播和浮动IP地址/掩码/广播。如果启用Port Lockdown,将无法通过该VLAN访问BIG-IP系统,即无法通过HTTPS或SSH对BIG-IP进行配置管理。通常建议对VLAN external启用Port Lockdown。本文以external为例介绍VLAN配置。

A. VLAN external启用Port Lockdown:

2004-12-28

内部资料,请勿扩散 第22页, 共62页

F5负载均衡器配置指导书 内部公开

C O N F I G U R E V L A N [ e x t e r n a l ] You will now specify the attributes and IP addresses of this VLAN. Port lockdown enabled for this vlan Port lockdown disabled for this vlan Enabling port lockdown will block traffic to services running on BIG-IP itself. However, individual ports can be opened for administrative and monitoring purposes using the global open port commands. The appropriate globals will be automatically set by this utility when services are configured. B. 配置VLAN external IP地址/掩码/广播

C O N F I G U R E V L A N [ e x t e r n a l ] You will now specify the attributes and IP addresses of this VLAN. Port lockdown disabled for this vlan Enter IP Address: 172.16.96.26 Enter Netmask : 255.255.255.224 Enter Broadcast Address : 172.16.96.31 Enter Shared IP Alias: 172.16.96.28 Enter Shared IP Alias Netmask : 255.255.255.224

然后对internal VLAN进行配置,最终VLAN和IP地址配置如下:

D E F I N E V L A N S A N D I P A D D R E S S E S Use the arrow keys to navigate. Press to choose a VLAN to configure or modify. Press 'A' to add a new VLAN name. Press 'D' to delete a configuration. Press 'C' to continue. external 172.16.96.26 (Port lockdown: on) internal 172.16.96.92 (Port lockdown: off) Failover IP: 172.16.96.93 Redundant controller is accessible. 2004-12-28

内部资料,请勿扩散

第23页, 共62页

F5负载均衡器配置指导书 内部公开

3.5.8 添加接口到VLAN中

根据安装前规划和设备物理连线,将接口添加到相应VLAN中。本例中,接口1.1添加到external VLAN中,接口1.3和1.4添加到internal VLAN中。此外,接口1.8用于主备BIG-IP双机系统级连,目前先不加入vlan web,将在WEB界面中进行配置。

A S S I G N I N T E R F A C E S T O V L A N S Use the arrow keys to navigate. Press to choose a VLAN and modify the list of interfaces. You must configure at least one VLAN. Press C to continue. external 1.1 internal 1.3 1.4 3.5.9 选择VLAN IP地址与主机名关联

分配接口到指定VLAN后,如果系统有多个定义VLAN。我们必须指定一个VLAN IP地址作为与系统主机名关联的主IP地址。本例中,我们选择external VLAN IP地址作为主IP地址。

S E L E C T H O S T I P A D D R E S S Select the IP address that will be associated with the host name in /etc/hosts. Press to select an address. Use the arrow keys to navigate. Enter 'C' to continue. Hostname: f5-2.colorring.net external 172.16.96.26 (X) web 172.16.96.92

指定主IP地址后,系统将保存网络配置:

2004-12-28

内部资料,请勿扩散 第24页, 共62页

F5负载均衡器配置指导书 内部公开

N E T W O R K I N G C O N F I G U R E D Wrote /etc/hosts Write /config/bigip_base.conf Update /config/bigip.conf Write bigdb fields Update /etc/snmpd.conf Shutdown all services... Startup all services... bigstart: startup inetd bigstart: startup named bigstart: startup sod bigstart: startup sshd bigstart: startup bigstpd bigstart: startup big3d bigstart: startup bigd bigstart: startup sfd bigstart: startup slapd

注:如果双机系统另外一台已经完成配置,终端可能会出现如下告警:

Jan 10 19:13:15 default kernel: duplicate IP address 172.16.96.28!! sent from a ddress: 00:01:d7:21:ab:01

解决方法:将串口心跳线连好,重新启动另一台,或者将用b failover standby命令另一台手动设成Standby。

3.5.10 配置默认网关

如果BIG-IP系统没有定义指定网络路由,BIG-IP将把数据发到默认网关池(gateway pool)。默认网关池可以认为是默认路由的组合,通常默认网关池由2个或多个网关IP地址组成,第一个地址作为默认路由,其它网关地址作为默认备用路由。默认网关池在系统激活后才能生效。

本例中只输入一个网关地址,这时系统不会生成默认网关池。

2004-12-28

内部资料,请勿扩散 第25页, 共62页

F5负载均衡器配置指导书 内部公开

C O N F I G U R E D E F A U L T G A T E W A Y The default gateway route determines where the BIG-IP should send network traffic for which there is no more specific route. To set up a single default route, type one default gateway IP address. If you type more than one address, the BIG-IP creates a default gateway pool. The first address in the list is entered as a traditional default route. Each IP address in the list must be on the same IP network as the BIG-IP. NOTE: Only a default route, no default gateway pool, will be set up on unlicensed systems. Enter default route addresses separated by a space. If you do not want a default route, leave this option blank. IPs: 172.16.96.30

3.5.11 配置WEB访问

为了启用指定VLAN的WEB访问,必须在VLAN中指定域名。

C O N F I G U R E W E B U T I L I T Y I N T E R F A C E S You will now configure the BIG-IP webserver for use with the Configuration Utility. The webserver may listen on any or all of the VLANS below. For each VLAN, you will be asked for the name by which the server will be known on the network associated with that VLAN. It is valid to assign the same name to more than one entry. Use the arrow keys to navigate. Press to choose an entry to configure, modify, or replace keys. Press 'C' to continue to next stage. external f5-1. colorring.net internal f5-1. colorring.net 配置完WEB管理接口后,系统提示输入WEB管理接口admin用户帐号口令。F5默认帐号

2004-12-28

内部资料,请勿扩散

第26页, 共62页

F5负载均衡器配置指导书 内部公开

口令为admin。

C O N F I G U R E W E B S E R V E R A C C E S S Password: The \ account, allowing webserver access, remote login (ssh), and local login. If this is a redundant BIG-IP system, and the \ the configsync user, the password MUST be the same on the two systems. 配置完admin用户帐号口令后,系统提示输入允许WEB接口连接的IP地址。本处采用系统默认允许所有IP地址。

S E T A D M I N I P A D D R E S S F O R H T T P D Administrative IP Address for httpd: *.*.*.* The Administrative IP Address is the IP address from which all remote administration, configuration and monitoring of your BIG-IP will be conducted using httpd. You may enter a '*' to specify a range of IP addresses - for instance, 192.168.2.* would allow all hosts on the 192.168.2 network. 随后系统提示输入国家(country)、省(state)、市(city)、公司(company)和部门(division),用于生成SSL证书。BIG-IP双机这部分配置信息要一致。

2004-12-28

内部资料,请勿扩散 第27页, 共62页

F5负载均衡器配置指导书 内部公开

E N T E R W E B S E R V E R C E R T I F I C A T I O N Country: CN State/Province: Guangdong City: Shenzhen Company: Huawei Company Division: Services and Software Enter the information to generate a self-signed SSL certificate. This will enable SSL on your webserver and should be sufficient for internal use. You will be asked for your country, state, city, company, and company division. The entered data is not validated, but keep in mind that it will be displayed with the certificate. It is valid to leave the 'Division' field blank. 最后保存WEB服务配置文件。

W R I T I N G W E B S E R V E R C O N F I G U R A T I O N F I L E S Generating key for f5-2.fzaip.net Added Administrative Host Address Added Self Address Added Failover Address Built Webserver Configuration File. Logging Directory Already Exists. Secure Logging Directory Already Exists. bigstart: restart httpd 警告:如果更改BIG-IP系统接口或主机名,必须重新配置BIG-IP Web服务以反映新的配置。只能通过Configuration工具添加用户或更改密码,否则某些配置信息(如httpd.conf和openssl.conf)将会丢失。

3.5.12 配置SSH访问

本例中允许SSH访问。由于SSH访问具有更高的安全性,建议对BIG-IP系统启用SSH访问,关闭Telnet访问。

2004-12-28

内部资料,请勿扩散 第28页, 共62页

F5负载均衡器配置指导书 内部公开

C O N F I G U R E S S H SSH access configuration utility SSH provides remote access and file transfer capabilities to the BIG-IP system from a remote administrative workstation. If you plan to use command-line utilities such as bigpipe and bigtop for configuration and monitoring, you need to set up an administrative workstation with the SSH client Allow SSH access to BIG-IP unit? Configure SSH access Do not allow SSH access 本例采用默认配置,允许所有IP地址通过SSH访问:

S E T A D M I N I P A D D R E S S F O R S S H Administrative IP Address for SSH: *.*.*.* The Administrative IP Address is the IP address from which all remote administration, configuration and monitoring of your BIG-IP will be conducted using SSH. You may enter a '*' to specify a range of IP addresses - for instance, 192.168.2.* would allow all hosts on the 192.168.2 network. 回车后,系统保存配置。

3.5.13 配置F5支持访问

本例不启用F5支持访问,回车继续。

2004-12-28

内部资料,请勿扩散 第29页, 共62页

F5负载均衡器配置指导书 内部公开

E N A B L E S U P P O R T A C C E S S If you would like F5 Networks to have access to your BIG-IP for support, you should supply and retain a support password here. If you do not want support, leave this field empty. Support Password [ for none ]: 3.5.14 设置时区

F5采用BSD Unix时区设置,其中没有北京时区信息,可以就近选择如下时区:Asia/Chungking(重庆)、Asia/Harbin(哈尔滨)、Asia/Hong_Kong(香港)、Asia/Macao(澳门)、Asia/Shanghai(上海)和Asia/Urumqi(乌鲁木齐)。

S E T T I M E Z O N E Choose your timezone from the list below. Many timezones have multiple listings. Choose the one that most clearly represents your zone. Asia/Gaza Asia/Harbin Asia/Hong_Kong Asia/Irkutsk Asia/Istanbul Asia/Jakarta Asia/Jayapura Asia/Jerusalem Asia/Kabul Asia/Kamchatka Asia/Karachi Asia/Kashgar Asia/Katmandu Asia/Krasnoyarsk

2004-12-28

内部资料,请勿扩散 第30页, 共62页

F5负载均衡器配置指导书 内部公开

3.5.15 配置NTP支持

本例中不启用NTP服务。

D E F I N E T I M E S E R V E R S NTP support configuration utility The Network Time Protocol (NTP) utility provides time synchronization to public Stratum 2 time servers across the Internet. This utility configures xntp on this machine. If you are behind a firewall, be sure that UDP port 123 is open in both directions through the firewall. Configure NTP support Disable NTP support Do not change NTP settings 3.5.16 配置DNS代理转发

本例中不使用DNS代理转发。

C O N F I G U R E D N S P R O X Y ? You can configure the BIG-IP as a DNS proxy. This is useful for providing DNS resolution for servers or other equipment behind the BIG-IP that might want to look up a domain name or IP address. Do you want to configure the DNS proxy? Yes, configure DNS proxy No, do not configure 3.5.17 用户认证配置

本例中不启用LDAP或RADIUS用户认证。输入N,回车继续。

2004-12-28

内部资料,请勿扩散 第31页, 共62页

F5负载均衡器配置指导书 内部公开

B I G - I P U S E R A U T H E N T I C A T I O N User authentication is typically performed on the host system, but can optionally be performed on remote systems using LDAP or RADIUS. If you have remote authentication capability in place, you can configure BIG-IP to use these systems. Do you wish to configure remote authentication? [Y/N]: N 3.5.18 Setup配置完成

系统提示基本配置完成,按任何键退出。

B A S I C C O N F I G U R A T I O N C O M P L E T E Complete your BIG-IP configuration using the 'bigpipe' command or using the Configuration Utility to add nodes, services, and virtual servers See the on-line documentation for more details. The Configuration Utility can be accessed at: https://f5-2.fzaip.net/index.html F5 Networks, Inc. Technical Support information is in file: /CONTACTS [ press any key to exit ] 2004-12-28

内部资料,请勿扩散 第32页, 共62页

F5负载均衡器配置指导书 内部公开

4 激活License

F5 BIG-IP系统必须激活License后才能正常使用。完成第一次Setup配置后,接下来需要激活BIG-IP License。

4.1 通过Web访问BIG-IP

启动Web浏览器,输入https://,回车。浏览器显示安全证书警报, 提示“是否继续”,点击“是”按钮继续。

BIG-IP系统提示输入用户名和密码。输入用户名和密码,点击“确认”按钮确定进入BIG-IP系统主页面。

注:BIG-IP Web用户界面默认用户名和默认密码为admin和admin。

4.2 激活License步骤

1、在Configuration Utility主页面中点击“License Utility”链接,进入“License Administration”页面。

2、在“License Administration”页面中,点击“Manual Authorization”按钮选择手动激动License方式。

2004-12-28

内部资料,请勿扩散

第33页, 共62页

F5负载均衡器配置指导书 内部公开

3、在“Manual Authorization”页面,点击“Download Product Dossier”按钮下载产品文档“dossier.do”到指定位置。

4、点击“Manual Authorization”页面下方的“License Server”链接进入F5 License服务器。通常F5负载均衡器所处网络不能够直接上Internet,请将“dossier.do”拷贝到可以上Internet的计算机中,并在计算机浏览器上输入https://activate.f5.com/F5/index.jsp进入F5 License服务器。

5、F5 License服务器主页面中点击“浏览?”按钮选择文件“dossier.do” ,然后点击“Activate”按钮。

2004-12-28

内部资料,请勿扩散 第34页, 共62页

F5负载均衡器配置指导书 内部公开

6、获取“bigip.license”文件后拷贝到连接F5负载均衡器的Web浏览器客户端指定位置。在“Manual Authorization”页面,点击“Continue >>”按钮进入“Install License”页面。

7、在“Install License”页面中“浏览?”按钮选择文件“bigip.license” ,然后点击“Install License”按钮。

8、安装License文件后,Web页面提示License安装状态,完成后提示点击观看License条款,点击“License Terms”继续。在“License Terms”页面中点击“Continue”按钮继续,系统显示“Reboot Prompt”提示重启页面,点击“Reboot Now”重启BIG-IP系统。至此,BIG-IP系统License激活工作完成。

2004-12-28

内部资料,请勿扩散

第35页, 共62页

F5负载均衡器配置指导书 内部公开

注:bigstart restart命令可以手工重启BIG-IP服务进程。

2004-12-28

内部资料,请勿扩散 第36页, 共62页

F5负载均衡器配置指导书 内部公开

5 系统时钟更改

如果BIG-IP系统时钟与实际时间不符,需要进行更改。 BIG-IP系统需要reboot进入单用户模式更改时间。

注意:

1、对于临时License的设备,不要轻易改系统时间,后果是License失效。 2、更改时间完后,务必退出单用户模式,以免破坏文件系统。

3、由于修改系统时钟需要重启动两次,对于正在运行系统而言,要千万小心。

4、对于在运行的冗余系统,建议先修改Standby,修改完毕,观察一段时间,再把Active设备切换为Standby后再修改,以保证系统的不间断。 5、系统时钟主要用于 F5 日志文件的计时时间。

步骤: 1、重启系统。 f5-1:~#reboot

2、在出现 4 3 2 1 期间,敲击任意键终止正常启动,进入单用户模式 然后输入bsd -s进入单用户模式。

System is booting, Please wait ......... loading /boot

press ESC to boot now, any other key to interrupt boot sequence 4 3 Boot: bsd -s

3、在单用户模式中,然后输入命令date yymmddhhmm.ss(年年月月日日时时分分.秒秒)修改时间。

例如:要把时间修改为 2004年1月15日10:14:59 可以输入 date 0401151014.59

4、输入时间完毕,然后输入reboot 重新启动。 5、重新启动后,输入命令date 验证时间是否设备正确。

2004-12-28

内部资料,请勿扩散 第37页, 共62页

F5负载均衡器配置指导书 内部公开

6 Web Configuration Utility进行配置

6.1 进入配置工具

通过HTTPS访问BIG-IP系统Web主页面如下:

配置工具 (Configuration Utility) 文档链接

点击Configuration Utility链接进入配置工具,配置工具页面如下图。

BIG-IP系统需要Jave虚拟机,请到http://java.sun.com/下载

2004-12-28

内部资料,请勿扩散

第38页, 共62页

F5负载均衡器配置指导书 内部公开

6.2 配置VLAN和端口

配置步骤:

1、在配置工具Web页面的导航面板中选择“Network”中的“VLANs”标签,点击“ADD”按钮打开“Add VLAN”窗口添加VLAN或者选择对现有VLAN进行更改。

2、在“VLAN Name”中输入VLAN名字,如“internal”。

3、在“Tag”中输入VLAN号,如果不填,系统将自动分配一个VLAN号。

4、在“Resources”表格中,选中指定“Internface Number”,选择适当接口号后点击“untagged >>”将端口添加到VLAN中。如果对选定接口号点击“tagged >>”,则该端口为Trunk端口。

5、如果选中“Port Lockdown”复选框,则不允许通过该VLAN进行管理。如果没有选中,该VLAN可以进行访问管理。

6、配置完毕后,点击“Done”完成配置。

配置示意图如下图: 6.3 配置VLAN IP地址 配置步骤: 1、在配置工具Web页面的导航面板中选择“Network”中的“Self IP Address”标签,点击“ADD”按钮添加Self IP Address。

2004-12-28

内部资料,请勿扩散

第39页, 共62页

F5负载均衡器配置指导书 内部公开

2、在“IP Address”中输入IP地址。 3、在“Netmask”中输入网络掩码。

4、在“Broadcast”中输入广播IP地址(可选)。

5、如果IP地址是BIG-IP双机的浮动IP地址,选中“Floating”复选框。 6、在“VLAN”组合框中选择分配IP地址的VLAN名。 7、配置完毕后,点击“Done”完成配置。

6.4 配置负载均衡池

负载均衡池是负载均衡器中重要的属性,是根据负载均衡策略接收数据流量的一组设备。池与特定虚拟服务器相关联,流向虚拟服务器的流量通常会转给相关联的负载均衡池的成员节点。池可以执行负载均衡操作,比如发送流量到池中的指定节点或定义会话保持方式。

当配置池时,必须配置池名、成员IP地址和负载均衡策略(BIG-IP系统默认策略为循环方式),根据BIG-IP系统在业务与软件产品线应用的特点经常还要配置会话保持方式。

6.4.1 配置池名、成员IP地址和负载均衡策略

配置步骤:

1、在配置工具Web页面的导航面板中选择“Pools”中的“Pools”标签,点击“ADD”按钮添加服务器池(Pool)。

2004-12-28 内部资料,请勿扩散 第40页, 共62页

本文来源:https://www.bwwdw.com/article/zexg.html

Top