【案例分享】F5实验LTM+DNS环境
本帖最后由 wo1261450762 于 2025-5-24 11:30 编辑<h1>1、实验环境拓扑</h1>
<p>更新前:<img src="data/attachment/forum/202505/22/163004o50hrs6sror8sxu0.png" alt="F5实验环境.png" title="F5实验环境.png" /></p>
<p>更新后:</p>
<p><img src="data/attachment/forum/202505/24/111958warreroner6n61no.png" alt="LAB.png" title="LAB.png" /></p>
<p><a href="forum.php?mod=attachment&aid=2815" title="attachment"><img src="/source/plugin/zhanmishu_markdown/template/editor/images/upload.svg" alt="upload" /> 附件:F5-LAB.zip</a></p>
<p>=================================================================</p>
<p>2025-05-24更新如下:</p>
<p>1、增加LAB文件,通过最新懒人版导出的lab文件。</p>
<p>2、拓扑图更新,新增加windows server,运行在ISP网络环境中,windows server主要为了实现dns解析和证书的颁发,现在已经实现DC2中心通过ISP网络访问DC2的http服务,LTM实现http重定向https,实现SSL卸载功能,win主机其中一个网卡与windows server一个网络环境,为了实现dns解析,并加载windows server颁发的证书(win未加入域),后续支持测试win是否还需要增加网卡到另外的ISP网络,后续实现通过不同运营商地址实现F5全局DNS解析。</p>
<p>=================================================================</p>
<h2>1.1、镜像文件说明</h2>
<table>
<thead>
<tr>
<th>区域</th>
<th>设备类型</th>
<th>镜像</th>
<th>镜像</th>
</tr>
</thead>
<tbody>
<tr>
<td>DC1</td>
<td>Server1、2、3</td>
<td>Linux</td>
<td>linux-ubuntu-18.04-server</td>
</tr>
<tr>
<td>DC1</td>
<td>ACC-Switch</td>
<td>cisco-vios-switch</td>
<td>默认镜像</td>
</tr>
<tr>
<td>DC1</td>
<td>H3C-VFW(做堆叠模拟核心)</td>
<td>h3cvfw</td>
<td>h3cvfw1k-7.1.064-E1260P45</td>
</tr>
<tr>
<td>DC1</td>
<td>LTM</td>
<td>F5 BIG-IP LTM VE</td>
<td>bigip-15.1.10.6-0.0.0.6_BAM3.1</td>
</tr>
<tr>
<td>DC1</td>
<td>HX-Switch</td>
<td>cisco-vios-switch</td>
<td>默认镜像</td>
</tr>
<tr>
<td>DC1</td>
<td>ISP(所有路由器设备)</td>
<td>cisco-vios-router</td>
<td>vios-adventerprisek9-m.spa159.3.m9</td>
</tr>
<tr>
<td>管理网</td>
<td>管理PC</td>
<td>winows</td>
<td>win-10-x64-21H1v1</td>
</tr>
<tr>
<td>管理网</td>
<td>sw</td>
<td>cisco IOL</td>
<td>l2-adventerprisek9-ms-17.15.01.bin</td>
</tr>
<tr>
<td>DC2</td>
<td>DC2设备同DC1相同</td>
<td>DC2设备同DC1相同</td>
<td>DC2设备同DC1相同</td>
</tr>
</tbody>
</table>
<h2>1.2、环境介绍</h2>
<p>模拟2个数据中心通过2个ISP不同网络,外网PC访问www服务,通过F5的全局DNS,实现分流。<br />
DC环境内部介绍:<br />
以DC2为例(DC1同理):<br />
1、出口不同运营商接入到DC2,ISP网络公网地址段通过不同vlan区分二层到核心交换机,vlan100-电信、vlan200联通,二层交换机通过vlan100和vlan200接入到旁挂DNS。核心交换机G1/1和DNS1.1接口接入电信;核心交换机G1/2和DNS1.2接口接入联通;核心交换机G1/3和DNS1.3互联,DNS到LTM一路也是vlan4000透传。<br />
2、接入交换机互联接口通过不同vlan实现交互。上联VLAN到DNS,也透传到旁挂LTM,LTM的1.2端口和DNS交互;LTM的1.1端口和下方业务同网段。<br />
3、server都是GUI界面的ubuntu系统,通过部署nginx去搭建对外http服务。(目前只能实现访问html,后续研究如何实现简单的cookie)</p>
<h2>1.3、详细介绍</h2>
<p>1、server端部署http服务,server端的网关地址指向LTM。</p>
<p>server端配置:</p>
<pre><code>账户:eve/eve
su - 切换root用户,密码eve
apt install nginx
apt install vim
注意:上述需要联网下载
vim /var/www/html/index.html创建并编辑
输入i进行编辑
#
<!DOCTYPE html>
<html>
<head>
<title>Welcome To WWW</title>
</head>
<body>
<H1>Hello,Word! This is ServerX</H1>
<p>This is a Simple HTML Page Served By Nginx.</p>
</body>
</html>
#
输入esc,并:wq进行保存退出,说明其中X是序号,标识serverID用的。
systemctl restart nginx
systemctl enable nginx
</code></pre>
<p>2、ACC-Switch只用于不同vlan透传</p>
<pre><code>DC2-AGG-Swith#show run
Building configuration...
Current configuration : 3166 bytes
!
! Last configuration change at 15:49:25 UTC Wed May 21 2025
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname DC2-AGG-Swith
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
!
ip cef
no ipv6 cef
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
vlan 4000
!
!
!
interface GigabitEthernet0/0
switchport access vlan 1000
negotiation auto
!
interface GigabitEthernet0/1
switchport access vlan 1000
negotiation auto
!
interface GigabitEthernet0/2
switchport access vlan 1000
negotiation auto
!
interface GigabitEthernet0/3
switchport access vlan 4000
negotiation auto
!
interface GigabitEthernet1/0
switchport access vlan 1000
negotiation auto
!
interface GigabitEthernet1/1
switchport access vlan 1000
negotiation auto
!
interface GigabitEthernet1/2
switchport access vlan 4000
negotiation auto
!
interface GigabitEthernet1/3
switchport access vlan 4000
negotiation auto
!
interface Vlan1000
ip address 10.100.20.254 255.255.255.0
!
ip forward-protocol nd
!
ip http server
ip http secure-server
!
ip route 0.0.0.0 0.0.0.0 10.100.20.200
ip ssh server algorithm encryption aes128-ctr aes192-ctr aes256-ctr
ip ssh client algorithm encryption aes128-ctr aes192-ctr aes256-ctr
!
</code></pre>
<p>3.F5-LTM,实现对http的负载</p>
<pre><code>该F5镜像默认集成Lic,如果无lic,
参考:https://pd.qq.com/g/emulatedlab/post/B_05102c681bb50d001441152188987052670X60?subc=684139305
通过命令行界面执行如下操作:账户root/default
设置自己常用密码需要符合密码强度。
登陆后执行,等待一段时间加载观察no lic是否还在,如还在执行bam
然后执行config通过图形化界面配置管理地址。
配置完成后,通过win去登陆F5的LTM,win配置与F5的LTM同网段,首次登陆需要修改密码。
登陆进入后按照向导操作即可,向导操作完成后。
1、network-vlans-vlan list 创建对应的Extermal vlan和向下的intermalvlan。
2、network-self IPs-self ip list 配置对应的IP地址和vlan做关联。
3、network-routes 创建一条默认到DNS的路由。
4、local traffic-nodes-default monitor 勾选一个默认的监控方式选择icmp。
5、local traffic-notes-nodes list 分别创建对应的主机名和地址,health monitors默认监控 node default,即上述我们选择的icmp,因为我当前环境默认有3个server所有创建3个nodes list。
6、local traffic-pools-pools list,创建一个http别名的pool地址池,默认负载方式轮询,在new member模块选择 nodes list,现在显示我们通过nodes list创建的节点,在service port我们选择80 http,其余都默认。
7、在virtual Servers-virtual Server list 创建一个针对3台http服务的虚拟地址,别名为vs-http-1、tpye选择标准standard、destomatopm address为10.100.200.100、service port为80 http、default pool选择上述创建的地址池。
简单的VS服务创建完成,通过win接入到10.100.200.x/24网络测试,通过浏览器进行访问http://10.100.200.100:80,由于环境都是虚拟的所有轮询的结果无法立马实现,多等待一段时间进行刷新效果就出来了。
===============================================================================================
测试通过客户端访问http做会话保持,http profile需要virtual Servers-virtual Server list点击刚刚穿创建的vs服务,在http profile(Client)选择http,选择resources-default persistence cookie或source_addr。
当前环境没有cookie,但f5回主动向客户端发送cookie进行会话保持。原地址负载因为当前环境只有一台所有也会进行保持。
</code></pre>
<h2>1.4、后续待补充</h2>
<p>持续关注一波</p>
持续关注一波,请持续更新。 楼主厉害!
页:
[1]