CLI举例:上行连接路由器(业务引流),下行连接交换机(VRRP引流)

发布于:2024-04-09 ⋅ 阅读:(100) ⋅ 点赞:(0)

CLI举例:上行连接路由器(业务引流),下行连接交换机(VRRP引流)

介绍了设备上行连接路由器,下行连接交换机的集群配置举例。

组网需求

图1所示,FW与路由器之间运行OSPF协议。

希望本数据中心的流量优先由本数据中心FW承担。当某台FW故障时,流量能切换到其他FW上进行。

图1 上行连接路由器,下行连接交换机组网图

数据规划

项目

数据

说明

FW_A

  • GE1/0/1:10.1.2.1/24
  • GE1/0/2:10.1.1.1/24
  • Eth-Trunk1:10.1.5.1/24,加入接口:GE1/0/3和GE1/0/4
  • Eth-Trunk2:10.1.6.1/24,加入接口:GE1/0/5和GE1/0/6
  • Eth-Trunk3:10.1.7.1/24,加入接口:GE1/0/7和GE1/0/8
  • 业务组1:优先级100;绑定VRRP备份组1。
  • 业务组2:优先级80;绑定VRRP备份组2。
  • 业务组3:优先级90;绑定VRRP备份组3。
  • 本数据中心使用的NAT地址池:100.1.1.1~100.1.1.10
  • Eth-Trunk1:作为集群协商通道
  • Eth-Trunk2:作为集群备份通道
  • Eth-Trunk3:作为集群转发通道
  • 业务组1:对应DC1的业务
  • 业务组2:对应DC2的业务
  • 业务组3:对应DC3的业务
  • 本数据中心使用的NAT地址池:需要将其地址发布给出口路由器

FW_B

  • GE1/0/1:10.1.3.1/24
  • GE1/0/2:10.1.1.2/24
  • Eth-Trunk1:10.1.5.2/24,加入接口:GE1/0/3和GE1/0/4
  • Eth-Trunk2:10.1.6.2/24,加入接口:GE1/0/5和GE1/0/6
  • Eth-Trunk3:10.1.7.2/24,加入接口:GE1/0/7和GE1/0/8
  • 业务组1:优先级90;绑定VRRP备份组1。
  • 业务组2:优先级100;绑定VRRP备份组2。
  • 业务组3:优先级80;绑定VRRP备份组3。
  • 本数据中心使用的NAT地址池:100.1.1.11~100.1.1.20
  • Eth-Trunk1:作为集群协商通道
  • Eth-Trunk2:作为集群备份通道
  • Eth-Trunk3:作为集群转发通道
  • 业务组1:对应DC1的业务
  • 业务组2:对应DC2的业务
  • 业务组3:对应DC3的业务
  • 本数据中心使用的NAT地址池:需要将其地址发布给出口路由器

FW_C

  • GE1/0/1:10.1.4.1/24
  • GE1/0/2:10.1.1.3/24
  • Eth-Trunk1:10.1.5.3/24,加入接口:GE1/0/3和GE1/0/4
  • Eth-Trunk2:10.1.6.3/24,加入接口:GE1/0/5和GE1/0/6
  • Eth-Trunk3:10.1.7.3/24,加入接口:GE1/0/7和GE1/0/8
  • 业务组1:优先级80;绑定VRRP备份组1。
  • 业务组2:优先级90;绑定VRRP备份组2。
  • 业务组3:优先级100;绑定VRRP备份组3。
  • 本数据中心使用的NAT地址池:100.1.1.21~100.1.1.29
  • Eth-Trunk1:作为集群协商通道
  • Eth-Trunk2:作为集群备份通道
  • Eth-Trunk3:作为集群转发通道
  • 业务组1:对应DC1的业务
  • 业务组2:对应DC2的业务
  • 业务组3:对应DC3的业务
  • 本数据中心使用的NAT地址池:需要将其地址发布给出口路由器

操作步骤
  1. 完成网络基本配置。包括配置接口IP地址、接口加入安全区域和路由。

    以下配置需要在每个集群成员上执行。下面给出FW_A上的配置,FW_B/C的配置请参考。

    # 配置各接口的IP地址。

    <FW_A> system-view 
    [FW_A] interface GigabitEthernet 1/0/1
    [FW_A-GigabitEthernet1/0/1] ip address 10.1.2.1 24
    [FW_A-GigabitEthernet1/0/1] quit 
    [FW_A] interface GigabitEthernet 1/0/2
    [FW_A-GigabitEthernet1/0/2] ip address 10.1.1.1 24
    [FW_A-GigabitEthernet1/0/2] quit
    [FW_A] interface Eth-Trunk 1
    [FW_A-Eth-Trunk1] ip address 10.1.5.1 24
    [FW_A-Eth-Trunk1] trunkport GigabitEthernet 1/0/3 to 1/0/4
    [FW_A-Eth-Trunk1] quit
    [FW_A] interface Eth-Trunk 2
    [FW_A-Eth-Trunk2] ip address 10.1.6.1 24
    [FW_A-Eth-Trunk2] trunkport GigabitEthernet 1/0/5 to 1/0/6
    [FW_A-Eth-Trunk2] quit
    [FW_A] interface Eth-Trunk 3
    [FW_A-Eth-Trunk3] ip address 10.1.7.1 24
    [FW_A-Eth-Trunk3] trunkport GigabitEthernet 1/0/7 to 1/0/8
    [FW_A-Eth-Trunk3] quit
    # 将各接口加入相应的安全区域。
    
    [FW_A] firewall zone trust
    [FW_A-zone-trust] add interface GigabitEthernet 1/0/2
    [FW_A-zone-trust] quit
    [FW_A] firewall zone dmz
    [FW_A-zone-dmz] add interface Eth-Trunk 1
    [FW_A-zone-dmz] add interface Eth-Trunk 2
    [FW_A-zone-dmz] add interface Eth-Trunk 3
    [FW_A-zone-dmz] quit
    [FW_A] firewall zone untrust
    [FW_A-zone-untrust] add interface GigabitEthernet 1/0/1
    [FW_A-zone-untrust] quit

    # 配置OSPF,保证路由可达。
    
    [FW_A] ospf 10
    [FW_A-ospf-10] area 0
    [FW_A-ospf-10-area-0.0.0.0] network 10.1.2.0 0.0.0.255
    [FW_A-ospf-10-area-0.0.0.0] quit
    [FW_A-ospf-10] quit

  2. 开启集群功能。

    以下配置需要在每个集群成员上执行。
    
    # 配置集群协商参数。
    
    [FW_A] cluster id 1000
    [FW_A] cluster detect-interval 2
    [FW_A] cluster timer holding-multiplier 4
    [FW_A] cluster timer hello 2
    [FW_A] cluster backup node-num 2
    [FW_A] cluster preempt delay 70
    [FW_A] cluster ip-list node 1 negotiation 10.1.5.1 backup 10.1.6.1 forward 10.1.7.1
    [FW_A] cluster ip-list node 2 negotiation 10.1.5.2 backup 10.1.6.2 forward 10.1.7.2
    [FW_A] cluster ip-list node 3 negotiation 10.1.5.3 backup 10.1.6.3 forward 10.1.7.3
    [FW_A] cluster node bind 1
    [FW_A] cluster standby config enable
    [FW_A] cluster session fast-sync enable
    [FW_A] cluster enable

  3. 配置业务组,将NAT地址池加入到待发布的UNR路由。

    以下配置请在集群管理主上配置,会自动同步到集群其他成员。
    
    C_No1_M[FW_A] business-group 1
    C_No1_M[FW_A-business-group-1] node 1 priority 100
    C_No1_M[FW_A-business-group-1] node 2 priority 90
    C_No1_M[FW_A-business-group-1] node 3 priority 80
    C_No1_M[FW_A-business-group-1] ip-section 100.1.1.1 100.1.1.10
    C_No1_M[FW_A-business-group-1] quit
    C_No1_M[FW_A] business-group 2
    C_No1_M[FW_A-business-group-2] node 1 priority 80
    C_No1_M[FW_A-business-group-2] node 2 priority 100
    C_No1_M[FW_A-business-group-2] node 3 priority 90
    C_No1_M[FW_A-business-group-2] ip-section 100.1.1.11 100.1.1.20
    C_No1_M[FW_A-business-group-2] quit
    C_No1_M[FW_A] business-group 3
    C_No1_M[FW_A-business-group-3] node 1 priority 90
    C_No1_M[FW_A-business-group-3] node 2 priority 80
    C_No1_M[FW_A-business-group-3] node 3 priority 100
    C_No1_M[FW_A-business-group-3] ip-section 100.1.1.21 100.1.1.29
    C_No1_M[FW_A-business-group-3] quit

  4. 配置上下行引流。

    以下配置需要在每台集群成员上配置。
    
    # 配置集群监控上行接口。
    
    C_No1_M[FW_A] cluster track interface GigabitEthernet 1/0/1
    # 在下行业务接口上配置VRRP备份组1。
    
    C_No1_M[FW_A] interface GigabitEthernet 1/0/2
    C_No1_M[FW_A-GigabitEthernet1/0/2] vrrp vrid 1 virtual-ip 10.1.1.10 active
    C_No1_M[FW_A-GigabitEthernet1/0/2] vrrp vrid 2 virtual-ip 10.1.1.11 active
    C_No1_M[FW_A-GigabitEthernet1/0/2] vrrp vrid 3 virtual-ip 10.1.1.12 active
    # 绑定VRRP备份组和业务组。
    
    C_No1_M[FW_A-GigabitEthernet1/0/2] vrrp vrid 1 track business-group 1
    C_No1_M[FW_A-GigabitEthernet1/0/2] vrrp vrid 2 track business-group 2
    C_No1_M[FW_A-GigabitEthernet1/0/2] vrrp vrid 3 track business-group 3
    C_No1_M[FW_A-GigabitEthernet1/0/2] quit
    # 在OSPF中引入UNR路由。路由策略cluster_rt,在开启集群功能后,由系统自动生成。
    
    C_No1_M[FW_A] ospf 10
    C_No1_M[FW_A-ospf-10] import-route unr route-policy cluster_rt
    C_No1_M[FW_A-ospf-10] quit

  5. 配置安全策略。

    以下配置请在集群管理主上配置,会自动同步到集群其他成员。
    
    # 配置安全策略,允许内网用户访问外网。
    
    C_No1_M[FW_A] security-policy
    C_No1_M[FW_A-policy-security] rule name policy_sec1 
    C_No1_M[FW_A-policy-security-rule-policy_sec1] source-zone trust
    C_No1_M[FW_A-policy-security-rule-policy_sec1] destination-zone untrust
    C_No1_M[FW_A-policy-security-rule-policy_sec1] source-address 10.1.1.0 24
    C_No1_M[FW_A-policy-security-rule-policy_sec1] action permit
    C_No1_M[FW_A-policy-security-rule-policy_sec1] quit
    # 配置安全策略,允许FW与上行路由器(部署在untrust区域)交互OSPF报文。
    
    C_No1_M[FW_A-policy-security] rule name policy_sec2
    C_No1_M[FW_A-policy-security-rule-policy_sec2] source-zone local untrust
    C_No1_M[FW_A-policy-security-rule-policy_sec2] destination-zone local untrust
    C_No1_M[FW_A-policy-security-rule-policy_sec2] action permit
    C_No1_M[FW_A-policy-security-rule-policy_sec2] quit

  6. 配置NAT策略。

    以下配置请在集群管理主上配置,会自动同步到集群其他成员。
    
    # 配置NAT地址池,配置时开启允许端口地址转换,实现公网地址复用。
    
    C_No1_M[FW_A] nat address-group addressgroup1
    C_No1_M[FW_A-address-group-addressgroup1] section 0 100.1.1.1 100.1.1.29
    C_No1_M[FW_A-address-group-addressgroup1] quit
    # 配置源NAT策略,实现私网指定网段访问Internet时自动进行源地址转换。
    
    C_No1_M[FW_A] nat-policy
    C_No1_M[FW_A-policy-nat] rule name policy_nat1
    C_No1_M[FW_A-policy-nat-rule-policy_nat1] source-zone trust
    C_No1_M[FW_A-policy-nat-rule-policy_nat1] destination-zone untrust
    C_No1_M[FW_A-policy-nat-rule-policy_nat1] source-address 10.1.1.0 24
    C_No1_M[FW_A-policy-nat-rule-policy_nat1] action source-nat address-group addressgroup1 
    C_No1_M[FW_A-policy-nat-rule-policy_nat1] quit
    C_No1_M[FW_A-policy-nat] quit

  7. 配置路由器和交换机。

    # 在路由器上配置OSPF,发布相邻网段,具体配置命令请参考路由器的相关文档。

    # 在交换机上将三个接口加入同一个VLAN,具体配置命令请参考交换机的相关文档。

结果验证
在集群管理主上执行display cluster negotiation status命令,查看集群协商的状态信息。
C_No1_M<FW_A> display cluster negotiation status

ID    status   health   version   join                 leave                    
------------------------------------------------------------                    
3     slave    10000    A         2018/02/20 16:56:14  NA                       
2     slave    10000    A         2018/02/20 16:56:17  NA      
1*    master   10000    A         2018/02/20 16:55:32  NA
以上信息表示集群1000已经建立,存在3个成员,版本一致,健康度均是10000。

在管理主上执行display business-group brief命令,检查业务组信息。

C_No1_M<FW_A> display business-group brief
TotalBG:3   Master:1    Slave:2    Invalid:0   Init:0                           
BGID   State      TopThree         IP_num  Pre_Preempt  next_master             
------------------------------------------------------------------------------- 
  1   master      1 2 3               1        NO            -                   
  2   slave       2 3 1               1        NO            -                   
  3   slave       3 1 2               1        NO            -
以上信息表示:FW_A作为业务组1的主设备;作为业务组2、3的备设备;每个业务组的排序符合预期。

配置脚本

本例中,集群成员上的配置基本一致。主要差异在:接口IP和本设备对应集群节点ID。

下面配置文件以FW_A为例,差异部分会加粗显示,请注意替换。

#
cluster id 1000
cluster detect-interval 2
cluster timer holding-multiplier 4
cluster timer hello 2
cluster backup node-num 2
cluster preempt delay 70
cluster standby config enable
cluster preempt
cluster session fast-sync enable
cluster ip-list node 1 negotiation 10.1.5.1 backup 10.1.6.1 forward 10.1.7.1
cluster ip-list node 2 negotiation 10.1.5.2 backup 10.1.6.2 forward 10.1.7.2
cluster ip-list node 3 negotiation 10.1.5.3 backup 10.1.6.3 forward 10.1.7.3
cluster node bind 1
cluster enable
#
 business-group 1
  node 1 priority 100
  node 2 priority 90
  node 3 priority 80
  ip-section 100.1.1.1 100.1.1.10
 business-group 2
  node 1 priority 80
  node 2 priority 100
  node 3 priority 90
  ip-section 100.1.1.11 100.1.1.20
 business-group 3
  node 1 priority 90
  node 2 priority 80
  node 3 priority 100
  ip-section 100.1.1.21 100.1.1.29
#
 cluster track interface GigabitEthernet 1/0/1
#
ospf 10
 import-route unr route-policy cluster_rt
 area 0.0.0.0
  network 10.1.2.0 0.0.0.255
#
firewall zone trust
 set priority 85
 add interface GigabitEthernet 1/0/2
# 
firewall zone untrust
 set priority 5
 add interface GigabitEthernet 1/0/1
# 
firewall zone dmz
 set priority 50
 add interface Eth-Trunk1
 add interface Eth-Trunk2
 add interface Eth-Trunk3
#
interface GigabitEthernet 1/0/1
 ip address 10.1.2.1 255.255.255.0
#
interface GigabitEthernet 1/0/2
 ip address 10.1.1.1 255.255.255.0
 vrrp vrid 1 virtual-ip 10.1.1.10 active
 vrrp vrid 2 virtual-ip 10.1.1.11 active
 vrrp vrid 3 virtual-ip 10.1.1.12 active
 vrrp vrid 1 track business-group 1
 vrrp vrid 2 track business-group 2
 vrrp vrid 3 track business-group 3
#
interface GigabitEthernet 1/0/3
 eth-trunk 1
#
interface GigabitEthernet 1/0/4
 eth-trunk 1
#
interface GigabitEthernet 1/0/5
 eth-trunk 2
#
interface GigabitEthernet 1/0/6
 eth-trunk 2
#
interface GigabitEthernet 1/0/7
 eth-trunk 3
#
interface GigabitEthernet 1/0/8
 eth-trunk 3
#
interface Eth-Trunk1
 ip address 10.1.5.1 255.255.255.0
#
interface Eth-Trunk2
 ip address 10.1.6.1 255.255.255.0
#
interface Eth-Trunk3
 ip address 10.1.7.1 255.255.255.0
#
security-policy
 rule name policy_sec1
  source-zone trust
  destination-zone untrust
  source-address 10.1.1.0 24
  action permit
 rule name policy_sec2
  source-zone local
  source-zone untrust
  destination-zone local
  destination-zone untrust
  action permit    
#
nat-policy
 rule name policy_nat1
  source-zone trust
  destination-zone untrust
  source-address 10.1.1.0 255.255.255.0
  action source-nat address-group addressgroup1
#


网站公告

今日签到

点亮在社区的每一天
去签到