NSRP与NSRP-Lite的使用与配置详解
1. 解读get nsrp输出
在深入探索NSRP功能之前,我们有必要了解NetScreen针对NSRP配置所给出的反馈信息。在处理NSRP集群时,
get nsrp
命令会被频繁使用,熟悉其输出结果能提升我们对集群的控制效率。
除了
get nsrp
命令及其子命令外,还有一个实用的命令是
get config
过滤后仅显示NSRP设置的命令,例如
get config | include nsrp
或者缩写形式
get conf | i nsrp
。此命令会展示所有已输入到配置中的NSRP命令,相比
get nsrp
的输出,它可能更易阅读。不过,该命令不提供状态信息,所以不能替代
get nsrp
,但可作为其有力补充。
1.1 NSRP集群示例分析
以下是一个NS - 500防火墙参与NSRP集群时
get nsrp
命令的输出示例:
1. ns(B)-> get nsrp
2. nsrp version: 2.0
cluster info:
3. cluster id: 2, no name
4. local unit id: 2071408
active units discovered:
5. index: 0, unit id: 2071408, ctrl mac: 0010db1f9b75, data mac: 0010db1f9b76
6. index: 1, unit id: 2070976, ctrl mac: 0010db1f99c5, data mac: 0010db1f99c6
7. total number of units: 2
VSD group info:
8. init hold time: 5
9. heartbeat lost threshold: 3
10. heartbeat interval: 200(ms)
group priority preempt holddown inelig master PB other members
11. 0 50 no 3 no 2070976 myself
12. total number of vsd groups: 1
13. Total iteration=144,time=926517,max=16862,min=1355,average=6434
RTO mirror info:
14. run time object sync: enabled
15. ping session sync: enabled
16. nsrp data packet forwarding is enabled
nsrp link info:
17. control channel: ha1 (ifnum: 5) mac: 0010db1f9b75 state: up
18. data channel: ha2 (ifnum: 6) mac: 0010db1f9b76 state: up
19. ha secondary path link not available
20. NSRP encryption: disabled
21. NSRP authentication: disabled
22. device based nsrp monitoring threshold: 255, weighted sum: 0, not failed
23. device based nsrp monitor interface: ethernet1/1(weight 255, UP) ethernet3/1(weight 255, UP)
24. device based nsrp monitor zone:
25. device based nsrp track ip: (weight: 255, disabled)
26. number of gratuitous arps: 4 (default)
27. config sync: enabled
28. track ip: disabled
1.2 输出结果逐行解析
| 行号 | 解析 |
|---|---|
| 1 | 正在执行的命令,从提示符可推断是在备份防火墙执行。 |
| 2 | NSRP的版本。 |
| 3 | 此防火墙参与的NSRP集群ID为2,且未分配集群名称。 |
| 4 | 该防火墙的硬件ID号,可用于与集群其他成员关联。 |
| 5 | 此防火墙在NSRP集群中被发现,其单元ID与第4行一致,还显示了用于NSRP消息和转发数据的虚拟MAC地址。 |
| 6 | 集群中发现的另一个防火墙,其ID为2070976。 |
| 7 | 已发现的集群成员数量,若为1则表示可能有成员缺失。 |
| 8 | 初始化保持时间。 |
| 9 | 触发故障转移前允许丢失的心跳次数。 |
| 10 | 心跳间隔,此例中已降至最小值,但第8行的初始化保持时间未作相应调整。 |
| 11 | VSD组0的摘要信息,显示了此防火墙对此VSD的优先级、是否启用抢占、故障转移延迟等,还表明哪个防火墙是主VSD以及此防火墙为主要备份。 |
| 12 | 此防火墙定义的VSD组数量,这里仅存在一个VSD组。 |
| 13 | 仅供Juniper/NetScreen调试使用,可忽略。 |
| 14 | 显示RTO镜像已启用。 |
| 15 | 调试输出,可忽略。 |
| 16 | HA数据链路的数据转发已启用。 |
| 17 | HA控制链路已启动,使用接口ha1进行控制消息传输。 |
| 18 | HA数据链路已启动并可用,接口ha2为指定的HA数据链路。 |
| 19 | 此防火墙未配置NSRP二级路径。 |
| 20 | NSRP加密未启用,可能HA链路是两台防火墙间的直接交叉电缆。 |
| 21 | NSRP消息认证未启用。 |
| 22 | 设备级NSRP监控阈值及当前进展情况,对故障排除有重要价值。 |
| 23 | 设备级接口监控配置及链路权重和状态。 |
| 24 | 设备级区域监控,此例中未监控任何区域。 |
| 25 |
设备级IP跟踪是否启用及权重,若要查看具体跟踪的IP地址细节,需使用
get nsrp monitor track - ip
命令。
|
| 26 | 故障转移后将发送的免费ARP数量。 |
| 27 |
自动配置同步已启用,若不需要可使用
unset nsrp config sync
命令更改。
|
| 28 | 主要是旧版本遗留信息,可忽略。 |
1.3 流程总结
graph LR
A[执行get nsrp命令] --> B[获取NSRP版本信息]
B --> C[获取集群信息]
C --> D[获取VSD组信息]
D --> E[获取RTO镜像信息]
E --> F[获取NSRP链路信息]
F --> G[解析各部分信息进行故障排查和配置检查]
2. 中程设备使用NSRP - Lite
NSRP - Lite是NSRP的精简版本,虽不支持NSRP的全部功能集,但目前讨论的大部分特性都具备,是一项强大的功能。不过,NSRP - Lite有两个主要限制:无法实现Active/Active设置以及运行时对象(RTO)的同步。这意味着在故障转移时,现有会话和VPN会丢失,需重新建立。若使用NSRP - Lite搭配VPN,要启用带重新密钥选项的VPN监控,以确保故障转移后VPN能重新建立。
2.1 基本NSRP - Lite使用示例:提供高可用互联网访问
假设我们有一个办公室网络需要互联网接入,由第三方提供客户驻地设备(CPE)。公司高层要求互联网访问具备高可用性,我们拥有一些交换机和两台仅支持NSRP - Lite的中程NetScreen防火墙。
2.1.1 CLI配置
set zone name office
set zone name internet
set zone office vrouter trust - vr
set zone internet vrouter trust - vr
set interface ethernet1 zone office
set interface ethernet2 zone internet
set interface ethernet3 zone ha
set interface ethernet4 zone ha
set interface ethernet1 ip 192.168.83.1/24
set interface ethernet2 ip 1.1.1.1/29
# on firewall A, use these commands
set interface ethernet2 manage - ip 1.1.1.3
set hostname sme - fwA
# on firewall B, use these commands instead
set interface ethernet2 manage - ip 1.1.1.4
set hostname sme - fwB
#
set vrouter trust - vr route 0.0.0.0/0 interface ethernet2 gateway 1.1.1.2
set nsrp cluster id 1
set nsrp cluster name sme
set nsrp monitor interface ethernet1
set nsrp monitor interface ethernet2
# configure aggressive IP tracking
set nsrp monitor track - ip ip 1.1.1.2
set nsrp monitor track - ip ip 1.1.1.2 weight 255
set nsrp monitor track - ip ip 1.1.1.2 threshold 2
set nsrp monitor track - ip
# prefer to have firewall #1 as the master, but do not preempt
# on firewall A, use this command
set nsrp vsd - group id 0 priority 1
# on firewall B, use this instead
set nsrp vsd - group id 0 priority 2
#
# configure for sub - second failover on lost heart - beats
set nsrp vsd - group hb - interval 200
set nsrp vsd - group hb - threshold 4
set nsrp vsd - group init - hold 25
2.1.2 网页界面配置步骤
-
前往
Network | Zones | New创建新区域。 -
输入
office作为区域名称。 -
选择
trust - vr作为虚拟路由器名称。 -
点击
OK。 -
点击
New。 -
输入
internet作为区域名称。 -
选择
trust - vr作为虚拟路由器名称。 -
点击
OK。 -
前往
Network | Interfaces | ethernet1 | Edit。 -
输入
office作为区域名称。 -
输入
192.168.83.1作为IP地址,24作为子网掩码。 -
点击
OK。 -
前往
Network | Interfaces | ethernet2 | Edit。 -
输入
internet作为区域名称。 -
输入
1.1.1.1作为IP地址,29作为子网掩码。 -
点击
Apply。 -
在防火墙A上使用
1.1.1.3作为管理IP,在防火墙B上使用1.1.1.4。 -
选择
Route作为接口模式。 -
点击
OK。 -
前往
Network | Interfaces | ethernet3 | Edit。 -
选择
HA作为区域名称。 -
点击
OK。 -
前往
Network | Interfaces | ethernet4 | Edit。 -
选择
HA作为区域名称。 -
点击
OK。 -
前往
Network | DNS。 -
在防火墙A上输入
sme - fwA作为主机名,在防火墙B上输入sme - fwB。 -
点击
Apply。 -
前往
Network | Routing | Routing Entries。 -
选择
trust - vr作为虚拟路由器后点击New创建新路由条目。 -
输入
0.0.0.0作为IP地址,0.0.0.0作为子网掩码。 -
选择
Gateway而非Next Hop Virtual Router Name。 -
将接口设置为
ethernet2。 -
输入
1.1.1.2作为网关IP地址。 -
点击
OK。 -
前往
Network | NSRP | Cluster。 -
选择集群ID并输入
1。 -
点击
Apply。 -
前往
Network | NSRP | Monitor | Interface | VSD ID: Device | Edit Interface。 -
选择
ethernet1。 -
将权重设置为
255。 -
选择
ethernet2。 -
将权重设置为
255。 -
点击
Apply。 -
前往
Network | NSRP | Monitor | Track IP。 -
点击
New。 -
输入
1.1.1.2作为跟踪IP。 -
将权重设置为
255。 -
将阈值设置为
2。 -
点击
OK。 -
前往
Network | NSRP | Monitor | Track IP | VSD ID: Device | Edit。 -
选择
Enable Track IP。 -
点击
Apply。 -
前往
Network | NSRP | VSD Group | Group ID 0 | Edit。 -
在防火墙A上将优先级设置为
1,在防火墙B上设置为2。 -
点击
OK。
2.1.3 注意事项
默认情况下,NetScreen防火墙不检查TCP数据包是否属于现有TCP会话,仅匹配源和目标信息与策略。这对非对称路由或使用NSRP - Lite很有用,但也可能使攻击者更容易将数据包引入网络。若担心此问题,可使用
set flow tcp - syn - check
命令强制NetScreen验证每个TCP会话。
2.2 使用本地接口的NSRP - Lite设置示例:双提供商实现高可用互联网接入
当只有一个互联网链路时,情况会变得更有趣。若有两个独立的互联网链路,每个链路有自己的CPE且仅提供一个以太网端口,NetScreen的设置会有很大不同。此时,需使用本地接口,确保接口配置不会在防火墙间移动。
2.2.1 CLI配置
set zone name office
set zone name internet
set zone office vrouter trust - vr
set zone internet vrouter trust - vr
set interface ethernet1 zone office
set interface ethernet2 zone internet
set interface ethernet3 zone ha
set interface ethernet4 zone ha
set nsrp cluster id 1
set nsrp cluster name sme
set nsrp monitor interface ethernet1
set nsrp monitor interface ethernet2
unset nsrp vsd - group id 0
set nsrp vsd - group id 1
# only ethernet1:1 is a VSI now
set interface ethernet1:1 ip 192.168.83.1/24
# on firewall A, use these commands
set interface ethernet2 ip 1.1.1.1/30
set hostname sme - fwA
set vrouter trust - vr route 0.0.0.0/0 interface ethernet2 gateway 1.1.1.2
set nsrp monitor track - ip ip 1.1.1.2
set nsrp monitor track - ip ip 1.1.1.2 weight 255
set nsrp monitor track - ip
set nsrp vsd - group id 1 priority 1
# on firewall B, use these commands instead
set interface ethernet2 ip 2.2.2.1/30
set hostname sme - fwB
set vrouter trust - vr route 0.0.0.0/0 interface ethernet2 gateway 2.2.2.2
set nsrp monitor track - ip ip 2.2.2.2
set nsrp monitor track - ip ip 2.2.2.2 weight 255
set nsrp monitor track - ip
set nsrp vsd - group id 1 priority 2
#
2.2.2 网页界面配置
-
前往
Network | Zones。 -
点击
New创建新区域。 -
输入
office作为区域名称。 -
选择
trust - vr作为虚拟路由器名称。 -
点击
OK。 -
点击
New。 -
输入
internet作为区域名称。 -
选择
trust - vr作为虚拟路由器名称。 -
点击
OK。 -
前往
Network | Interfaces | ethernet1 | Edit。 -
输入
office作为区域名称。 -
点击
OK。 -
前往
Network | Interfaces | ethernet2 | Edit。 -
输入
internet作为区域名称。 -
点击
OK。 -
前往
Network | Interfaces | ethernet3 | Edit。 -
输入
HA作为区域名称。 -
点击
OK。 -
前往
Network | Interfaces | ethernet4 | Edit。 -
选择
HA作为区域名称。 -
点击
OK。 -
前往
Network | NSRP | Cluster。 -
选择集群ID并输入
1。 -
点击
Apply。 -
前往
Network | NSRP | Monitor | Interface | VSD ID: Device | Edit Interface。 -
选择
ethernet1。 -
将权重设置为
255。 -
选择
ethernet2。 -
将权重设置为
255。 -
点击
Apply。 -
前往
Network | NSRP | VSD Group。 -
点击
Remove移除组ID0。 - 确认删除提示。
-
点击
New。 -
将组ID设置为
1。 -
点击
OK。 -
前往
Network | Interfaces。 -
选择
VSI IF后点击New。 -
选择
ethernet1作为VSI基础。 -
选择VSD组
1。 -
分配IP地址和子网掩码
192.168.83.1/24。 -
点击
Apply。
2.2.3 防火墙A和B的额外配置
防火墙A
:
1. 前往
Network | Interfaces | ethernet2 | Edit
。
2. 输入
1.1.1.1
作为IP地址,
30
作为子网掩码。
3. 点击
OK
。
4. 前往
Network | DNS
。
5. 输入
sme - fwA
作为主机名。
6. 点击
Apply
。
7. 前往
Network | Routing | Routing Entries
。
8. 选择
trust - vr
作为虚拟路由器后点击
New
。
9. 输入
0.0.0.0/0.0.0.0
作为网络地址/子网掩码。
10. 选择
Gateway
而非
Next Hop Virtual Router Name
。
11. 选择
ethernet2
作为接口。
12. 输入
1.1.1.2
作为网关IP地址。
13. 点击
OK
。
14. 前往
Network | NSRP | Monitor | Track IP
。
15. 点击
New
。
16. 输入
1.1.1.2
作为跟踪IP。
17. 将权重设置为
255
。
18. 点击
OK
。
19. 前往
Network | NSRP | Monitor | Track IP | VSD ID: Device | Edit
。
20. 选择
Enable Track IP
。
21. 点击
Apply
。
22. 前往
Network | NSRP | VSD Group | Group ID 1 | Edit
。
23. 将优先级设置为
1
。
24. 点击
OK
。
防火墙B
:
1. 前往
Network | Interfaces | ethernet2 | Edit
。
2. 输入
2.2.2.1
作为IP地址,
30
作为子网掩码。
3. 点击
OK
。
4. 前往
Network | DNS
。
5. 输入
sme - fwB
作为主机名。
6. 点击
Apply
。
7. 前往
Network | Routing | Routing Entries
。
8. 点击
New
。
9. 选择
trust - vr
作为虚拟路由器名称。
10. 输入
0.0.0.0/0.0.0.0
作为网络地址/子网掩码。
11. 选择
Gateway
而非
Next Hop Virtual Router Name
。
12. 选择
ethernet2
。
13. 输入
2.2.2.2
作为网关IP地址。
14. 点击
OK
。
15. 前往
Network | NSRP | Monitor | Track IP
。
16. 点击
New
。
17. 输入
2.2.2.2
作为跟踪IP。
18. 将权重设置为
255
。
19. 点击
OK
。
20. 前往
Network | NSRP | Monitor | Track IP | VSD ID: Device | Edit
。
21. 选择
Enable Track IP
。
22. 点击
Apply
。
23. 前往
Network | NSRP | VSD Group | Group ID 1| Edit
。
24. 将优先级设置为
2
。
25. 点击
OK
。
2.3 强制备份防火墙链路关闭
在某些罕见情况下,备份防火墙上所有链路处于开启(但未激活)状态可能会引发问题。例如,NetScreen直接连接到路由器,路由器仅根据链路状态调整路由,会将数据包发送到未激活接口,导致数据包被丢弃。
若遇到这种情况,建议重新设计网络以避免此问题。若无法避免,可使用
unset nsrp link - up - on - backup
命令。该命令会使备份单元的链路关闭(HA接口和管理接口除外)。不过,此命令有诸多弊端,如无法通过流量接口进行管理、没有二级NSRP路径、故障转移时间大幅增加等,应尽量避免使用。
graph LR
A[确定网络需求] --> B[选择NSRP - Lite或NSRP配置方式]
B --> C{是否有多个互联网链路}
C -- 是 --> D[使用本地接口配置]
C -- 否 --> E[基本NSRP - Lite配置]
D --> F[按CLI和网页界面步骤配置防火墙A和B]
E --> G[按CLI和网页界面步骤配置防火墙A和B]
F --> H[完成配置进行测试和监控]
G --> H
通过以上内容,我们详细介绍了NSRP和NSRP - Lite的使用与配置,包括命令输出解析、不同场景下的配置示例以及特殊情况的处理方法,希望能帮助你更好地搭建和管理高可用网络。
3. NSRP与NSRP - Lite配置总结与对比
3.1 NSRP与NSRP - Lite功能对比
| 功能 | NSRP | NSRP - Lite |
|---|---|---|
| Active/Active设置 | 支持 | 不支持 |
| 运行时对象(RTO)同步 | 支持 | 不支持 |
| 基本高可用功能 | 支持 | 支持 |
| 配置同步 | 支持 | 支持 |
| 接口和区域监控 | 支持 | 支持 |
| IP跟踪 | 支持 | 支持 |
从对比表格可以看出,NSRP - Lite虽然在功能上有所精简,但对于一些对成本和功能需求不是特别高的中小企业场景,仍然能够提供较为可靠的高可用解决方案。
3.2 不同场景下的配置选择
| 场景 | 配置选择 | 原因 |
|---|---|---|
| 单一互联网链路,追求简单配置 | 基本NSRP - Lite配置 | 配置相对简单,能满足基本高可用需求 |
| 多个独立互联网链路,需冗余路径 | 使用本地接口的NSRP - Lite配置 | 可确保每个防火墙与各自连接的CPE进行本地配置,实现冗余 |
| 对功能要求全面,有复杂网络环境 | NSRP配置 | 具备完整功能集,能应对复杂网络场景 |
4. 故障排查与优化建议
4.1 常见故障及排查方法
| 故障现象 | 可能原因 | 排查方法 |
|---|---|---|
| 集群成员数量显示异常 | 防火墙通信故障、配置错误 |
检查HA链路状态、配置信息,使用
get nsrp
命令查看详细信息
|
| 故障转移未按预期触发 | 心跳丢失阈值设置不合理、监控接口故障 | 调整心跳丢失阈值,检查监控接口状态 |
| VPN在故障转移后未重新建立 | 未启用VPN监控或重新密钥选项 | 启用带重新密钥选项的VPN监控 |
4.2 优化建议
- 调整心跳参数 :根据网络环境和设备性能,合理调整心跳间隔和丢失阈值,以平衡故障转移的及时性和稳定性。
- 启用必要的监控 :对于VPN等关键服务,启用相应的监控功能,确保故障转移后能快速恢复。
- 定期检查配置 :定期检查防火墙的配置信息,确保其符合网络需求和安全策略。
4.3 故障排查流程
graph LR
A[出现故障现象] --> B[收集故障信息,如使用get nsrp命令]
B --> C{故障类型}
C -- 集群成员问题 --> D[检查HA链路和配置信息]
C -- 故障转移问题 --> E[检查心跳参数和监控接口]
C -- VPN问题 --> F[检查VPN监控配置]
D --> G[根据检查结果进行调整和修复]
E --> G
F --> G
G --> H[验证故障是否解决]
H -- 是 --> I[结束排查]
H -- 否 --> B
5. 总结与展望
5.1 总结
本文详细介绍了NSRP和NSRP - Lite的相关知识,包括
get nsrp
命令输出的解读、NSRP - Lite在不同场景下的配置方法、常见故障排查和优化建议等内容。NSRP - Lite作为NSRP的精简版本,为中小企业提供了一种经济有效的高可用解决方案,虽然存在一定的功能限制,但通过合理配置和管理,仍然能够满足大部分场景的需求。
5.2 展望
随着网络技术的不断发展,高可用网络的需求也在不断增加。未来,NSRP和NSRP - Lite可能会进一步优化和改进,以适应更复杂的网络环境和业务需求。例如,可能会增加更多的监控和管理功能,提高故障转移的速度和准确性,以及加强对新兴网络技术的支持等。同时,用户在使用过程中也需要不断学习和掌握新的知识和技能,以更好地利用这些技术来保障网络的稳定运行。
通过深入理解和掌握NSRP和NSRP - Lite的使用与配置,我们能够为企业构建更加可靠、高效的高可用网络,提升企业的竞争力和业务连续性。希望本文的内容能为读者在实际工作中提供有益的参考和帮助。
超级会员免费看
2

被折叠的 条评论
为什么被折叠?



