龙空技术网

华为大型园区出口综合案例(防火墙旁路)

鸿鹄论坛 1944

前言:

现在姐妹们对“华为css交换机配置”大致比较看重,各位老铁们都需要学习一些“华为css交换机配置”的相关文章。那么小编在网摘上汇集了一些有关“华为css交换机配置””的相关知识,希望看官们能喜欢,你们一起来学习一下吧!

1.2 组网需求

在大型园区出口,核心交换机上行通过路由器访问外网。防火墙旁挂于核心交换机,对业务流量提供安全过滤功能。

为了简化网络并提高可靠性,在核心层交换机通常部署集群。

在防火墙上部署双机热备(主备模式),当其中一台故障时,业务可以平滑切换到另一台。

核心交换机双归接入2台出口路由器,路由器之间部署VRRP确保可靠性。

为提高链路可靠性,在核心交换机与出口路由器之间,核心交换机与防火墙之间,2台防火墙之间均通过Eth-Trunk互连。

如下图所示。

图1-1 园区出口组网图(防火墙旁挂,双机热备)

在一般的三层转发环境下,园区内外部之间的流量将直接通过交换机转发,不会经过FW1或FW2。当流量需要从交换机转发至FW,经FW检测后再转发回交换机,就需要在交换机上配置VRF功能,将交换机隔离成两个相互独立的虚拟交换机VRF-A和根交换机Public。

Public作为连接出口路由器的交换机。对于下行流量,它将外网进来的流量转发给FW进行检测;对于上行流量,它接收经FW检测后的流量,并转发到路由器。

VRF-A作为连接内网侧的交换机。对于下行流量,它接收经FW检测后的流量,并转发到内网;对于上行流量,它将内网的流量转发到FW去检测。

根据上图中的流量转发路径可以将上图转换成如下所示的更容易理解的逻辑组网图。

图1-2 交换机与路由器、防火墙之间物理接口连接示意图

本例所示核心交换机工作在三层模式,上图所示的逻辑组网图可以理解为防火墙上下行连接三层交换机的双机热备组网。这种组网的特点是需要在防火墙的上下行业务接口上部署VRRP备份组,如下所示。

图1-3 交换机与路由器、防火墙之间三层口连接示意图

如上图所示,内部用户访问外网的流量转发路径如下(上图中蓝色路径):

1. 当内部用户访问外网的流量到达VRF-A时,流量根据VRF-A上的静态路由(下一跳设置为防火墙下行VRRP的虚拟IP地址)被转发到防火墙。

2. 防火墙完成对流量的安全检测后,会根据静态路由(下一跳设置为CSS的VLANIF20)将流量转发到Public上。

3. 最后,Public通过到路由器的静态路由(下一跳设置为路由器VRRP的虚拟IP地址)将流量转发到路由器。

外部用户访问内网的流量转发路径如下(上图中红色路径):

1. 当外部用户访问内网的流量到路由器时,流量根据OSPF路由表被转发到Public上。

2. 流量到达Public后,先根据Public上的静态路由(下一跳设置为防火墙上行VRRP的虚拟IP地址)被转发到防火墙。

3. 防火墙完成对流量的安全检测后,会根据静态路由(下一跳设置为CSS的VLANIF30)将流量转发到VRF-A上。

4. VRF-A通过OSPF路由表将流量转发汇聚交换机,最后由汇聚交换机将流量转发到业务网络。

1.3 数据规划

表1-1 链路聚合接口规划

1.4 配置思路

采用如下思路配置园区出口举例:

1. 配置核心交换机集群CSS。

2. 配置交换机与防火墙、路由器之间的接口及IP地址。

为提高链路可靠性,在交换机与防火墙、交换机与路由器之间配置跨框Eth-Trunk接口。

在防火墙的接口上配置安全区域。

3. 在出口路由器上部署VRRP。

为了保证核心交换机与两个出口路由器之间的可靠性,在两个出口路由器之间部署VRRP,VRRP的心跳报文经过核心交换机进行交互。Router1为Master设备,Router2为Backup设备。

4. 部署路由。

交换机上配置VRF功能,将交换机隔离成两个相互独立的虚拟交换机VRF-A和根交换机Public,以隔离业务网段路由与公网路由。

为了引导各设备的上行流量,在核心交换机上配置一条缺省路由,下一跳指向出口路由器VRRP的虚地址。

为了引导园区两个出口路由器的回程流量,在两个出口路由器和核心交换机之间部署OSPF,核心交换机上将所有用户网段发布到OSPF里面,通告给两个出口路由器。

为了将业务网络的上行流量引导至防火墙,在交换机上配置一条缺省路由,下一跳指向防火墙VRRP VRID2的虚拟IP。

为了将到业务网络1的下行流量引导至防火墙,在交换机上配置一条缺省路由,下一跳指向防火墙VRRP VRID1的虚拟IP。

为了将到业务网络2的下行流量引导至防火墙,在交换机上配置一条缺省路由,下一跳指向防火墙VRRP VRID1的虚拟IP。

为了将业务网络的上行流量引导至交换机,在防火墙上配置一条缺省路由,下一跳指向交换机VLANIF20的IP地址。

为了将到业务网络1的下行流量引导至交换机,在防火墙上配置一条缺省路由,下一跳指向交换机VLANIF30的IP地址。

为了将到业务网络2的下行流量引导至交换机,在防火墙上配置一条缺省路由,下一跳指向交换机VLANIF30的IP地址。

5. 配置防火墙双机热备。

1.5 操作步骤

步骤 1 交换机:配置交换机集群。

1. 连接集群卡的线缆。

下图以S12700交换机的EH1D2VS08000集群卡连线为例。本例连线示意图中,S12700主控板、交换网板和集群卡都是满配的情况。实际使用时,S12700每框至少配置一块主控板和一块交换网板即可。推荐每框配置两块交换网板并插上两块集群卡。

图1-1 集群卡连线示意图

l 两框之间至少要连接一根集群线缆。

l 一块集群卡只能与对框一块集群卡相连,不能连接到多块集群卡,且不能与本框集群卡相连。

l 集群卡上组1的任意接口只能与对框集群卡上组1的任意接口相连,组2的要求同组1。

l 每块集群卡上连接集群线缆的数量相同(如果不相同会影响总的集群带宽),且两端按照接口编号的顺序对接。

2. 在Switch 1上配置集群。

# 集群连接方式为集群卡(缺省值,不需配置)。集群ID采用缺省值1(不需配置)。优先级为100。

<HUAWEI> system-view

[HUAWEI] set css mode css-card //设备缺省值,不需再执行命令配置,此步骤仅用作示范命令。

[HUAWEI] set css id 1 //设备缺省值,不需再执行命令配置,此步骤仅用作示范命令。

[HUAWEI] set css priority 100 //集群优先级缺省为1,修改主交换机的优先级大于备交换机

[HUAWEI] css enable

Warning: The CSS configuration takes effect only after the system is rebooted. The next CSS mode is CSS-card. Reboot now? [Y/N]:y//重启交换机

3. 在Switch 2上配置集群。

集群连接方式为集群卡(缺省值,不需配置)。集群ID为2。优先级采用缺省值1(不需配置)。

<HUAWEI> system-view

[HUAWEI] set css id 2 //集群ID缺省为1,修改备交换机的ID为2

[HUAWEI] css enable

Warning: The CSS configuration takes effect only after the system is rebooted. The next CSS mode is CSS-card. Reboot now? [Y/N]:y//重启交换机

4. 交换机完成重启后,查看集群状态。

− 在集群系统的主交换机Switch 1上,主用主控板上的CSS MASTER灯绿色常亮。(图1)

− Switch 1的两块主控板上编号为1的CSS ID灯绿色常亮,Switch 2的两块主控板上编号为2的CSS ID灯绿色常亮。(图1)

− 集群卡上有集群线缆连接的端口LINK/ALM灯绿色常亮。(图2)

− 主框上所有集群卡的MASTER灯绿色常亮,备框上所有集群卡的MASTER灯常灭。(图2)

图1-2 CSS系统指示灯示意图

l 集群建立后,后续交换机的配置都在主交换机(Switch 1)上进行,数据会自动同步到备交换机(Switch 2)。

l 在集群系统中,接口编号会变为4维,例如,10GE1/4/0/0。其中左边第一位表示集群ID。

步骤 2 配置CSS与FW、路由器之间的跨框Eth-Trunk口,CSS上的VLANIF口以及IP地址。

1. 配置交换机与路由器之间的跨框Eth-Trunk,VLANIF以及IP地址。

# 在CSS上创建Eth-Trunk1,用于连接Router1,并加入Eth-Trunk成员接口。

<HUAWEI> system-view

[HUAWEI] sysname CSS //给集群系统重新命名。

[CSS] interface Eth-Trunk 1

[CSS-Eth-Trunk1] quit

[CSS] interface XGigabitethernet 1/4/0/0 //在Eth-Trunk1中加入主交换机上的成员接口

[CSS-XGigabitEthernet1/4/0/0] Eth-Trunk 1

[CSS-XGigabitEthernet1/4/0/0] quit

[CSS] interface XGigabitethernet 2/4/0/0 //在Eth-Trunk1中加入备交换机上的成员接口

[CSS-XGigabitEthernet2/4/0/0] Eth-Trunk 1

[CSS-XGigabitEthernet2/4/0/0] quit

# 在CSS上创建Eth-Trunk2,用于连接Router2,并加入Eth-Trunk成员接口。

[CSS] interface Eth-Trunk 2

[CSS-Eth-Trunk2] quit

[CSS] interface XGigabitethernet 1/4/0/1 //在Eth-Trunk2中加入主交换机上的成员接口

[CSS-XGigabitEthernet1/4/0/1] Eth-Trunk 2

[CSS-XGigabitEthernet1/4/0/1] quit

[CSS] interface XGigabitethernet 2/4/0/1 //在Eth-Trunk2中加入备交换机上的成员接口

[CSS-XGigabitEthernet2/4/0/1] Eth-Trunk 2

[CSS-XGigabitEthernet2/4/0/1] quit

# 创建VLANIF,并配置IP地址。

[CSS] vlan batch 10

[CSS] interface Eth-Trunk 1 //将Eth-Trunk1加入VLAN10

[CSS-Eth-Trunk1] port link-type trunk

[CSS-Eth-Trunk1] port trunk allow-pass vlan 10

[CSS-Eth-Trunk1] quit

[CSS] interface Eth-Trunk 2 //将Eth-Trunk2加入VLAN10

[CSS-Eth-Trunk2] port link-type trunk

[CSS-Eth-Trunk2] port trunk allow-pass vlan 10

[CSS-Eth-Trunk2] quit

[CSS] interface Vlanif 10 //创建VLANIF10,用于CSS与Router1、Router2通信

[CSS-Vlanif10] ip address 10.10.4.1 24

[CSS-Vlanif10] quit

2. 配置交换机与FW之间的跨框Eth-Trunk,CSS上的VLANIF口以及IP地址。

# 在CSS上创建Eth-Trunk4,用于将Pubilc与FW1连接,并加入Eth-Trunk成员接口。

[CSS] interface Eth-Trunk 4

[CSS-Eth-Trunk4] quit

[CSS] interface Gigabitethernet 1/1/0/7 //在Eth-Trunk4中加入主交换机上的成员接口

[CSS-Gigabitethernet1/1/0/7] Eth-Trunk 4

[CSS-Gigabitethernet1/1/0/7] quit

[CSS] interface Gigabitethernet 2/1/0/7 //在Eth-Trunk4中加入备交换机上的成员接口

[CSS-Gigabitethernet2/1/0/7] Eth-Trunk 4

[CSS-Gigabitethernet2/1/0/7] quit

# 在CSS上创建Eth-Trunk5,用于将VRF-A与FW1连接,并加入Eth-Trunk成员接口。

[CSS] interface Eth-Trunk 5

[CSS-Eth-Trunk5] quit

[CSS] interface Gigabitethernet 1/1/0/8 //在Eth-Trunk5中加入主交换机上的成员接口

[CSS-Gigabitethernet1/1/0/8] Eth-Trunk 5

[CSS-Gigabitethernet1/1/0/8] quit

[CSS] interface Gigabitethernet 2/1/0/8 //在Eth-Trunk5中加入备交换机上的成员接口

[CSS-Gigabitethernet2/1/0/8] Eth-Trunk 5

[CSS-Gigabitethernet2/1/0/8] quit

# 在CSS上创建Eth-Trunk6,用于将Pubilc与FW2连接,并加入Eth-Trunk成员接口。

[CSS] interface Eth-Trunk 6

[CSS-Eth-Trunk6] quit

[CSS] interface Gigabitethernet 1/2/0/7 //在Eth-Trunk6中加入主交换机上的成员接口

[CSS-Gigabitethernet1/2/0/7] Eth-Trunk 6

[CSS-Gigabitethernet1/2/0/7] quit

[CSS] interface Gigabitethernet 2/2/0/7 //在Eth-Trunk6中加入备交换机上的成员接口

[CSS-Gigabitethernet2/2/0/7] Eth-Trunk 6

[CSS-Gigabitethernet2/2/0/7] quit

# 在CSS上创建Eth-Trunk7,用于将VRF-A与FW2连接,并加入Eth-Trunk成员接口。

[CSS] interface Eth-Trunk 7

[CSS-Eth-Trunk7] quit

[CSS] interface Gigabitethernet 1/2/0/8 //在Eth-Trunk7中加入主交换机上的成员接口

[CSS-Gigabitethernet1/2/0/8] Eth-Trunk 7

[CSS-Gigabitethernet1/2/0/8] quit

[CSS] interface Gigabitethernet 2/2/0/8 //在Eth-Trunk7中加入备交换机上的成员接口

[CSS-Gigabitethernet2/2/0/8] Eth-Trunk 7

[CSS-Gigabitethernet2/2/0/8] quit

# 创建VLANIF,并配置IP地址。

[CSS] vlan batch 20 30

[CSS] interface Eth-Trunk 4 //将Eth-Trunk4加入VLAN20

[CSS-Eth-Trunk4] port link-type trunk

[CSS-Eth-Trunk4] port trunk allow-pass vlan 20

[CSS-Eth-Trunk4] quit

[CSS] interface Eth-Trunk 6 //将Eth-Trunk6加入VLAN20

[CSS-Eth-Trunk6] port link-type trunk

[CSS-Eth-Trunk6] port trunk allow-pass vlan 20

[CSS-Eth-Trunk6] quit

[CSS] interface Vlanif 20 //创建VLANIF20,用于CSS的Public连接FW1、FW2

[CSS-Vlanif20] ip address 10.10.2.1 24

[CSS-Vlanif20] quit

[CSS] interface Eth-Trunk 5 //将Eth-Trunk5加入VLAN30

[CSS-Eth-Trunk5] port link-type trunk

[CSS-Eth-Trunk5] port trunk allow-pass vlan 30

[CSS-Eth-Trunk5] quit

[CSS] interface Eth-Trunk 7 //将Eth-Trunk7加入VLAN30

[CSS-Eth-Trunk7] port link-type trunk

[CSS-Eth-Trunk7] port trunk allow-pass vlan 30

[CSS-Eth-Trunk7] quit

[CSS] interface Vlanif 30 //创建VLANIF30,用于CSS的VRF-A连接FW1、FW2

[CSS-Vlanif30] ip address 10.10.3.1 24

[CSS-Vlanif30] quit

3. 配置交换机与业务网络之间的跨框Eth-Trunk,VLANIF以及IP地址。

# 在CSS上创建Eth-Trunk8,用于连接业务网络1,并加入Eth-Trunk成员接口。

[CSS] interface Eth-Trunk 8

[CSS-Eth-Trunk8] quit

[CSS] interface Gigabitethernet 1/3/0/1 //在Eth-Trunk8中加入主交换机上的成员接口

[CSS-Gigabitethernet1/3/0/1] Eth-Trunk 8

[CSS-Gigabitethernet1/3/0/1] quit

[CSS] interface Gigabitethernet 2/3/0/1 //在Eth-Trunk8中加入备交换机上的成员接口

[CSS-Gigabitethernet2/3/0/1] Eth-Trunk 8

[CSS-Gigabitethernet2/3/0/1] quit

# 在CSS上创建Eth-Trunk9,用于连接业务网络2,并加入Eth-Trunk成员接口。

[CSS] interface Eth-Trunk 9

[CSS-Eth-Trunk9] quit

[CSS] interface Gigabitethernet 1/3/0/2 //在Eth-Trunk9中加入主交换机上的成员接口

[CSS-Gigabitethernet1/3/0/2] Eth-Trunk 9

[CSS-Gigabitethernet1/3/0/2] quit

[CSS] interface Gigabitethernet 2/3/0/2 //在Eth-Trunk9中加入备交换机上的成员接口

[CSS-Gigabitethernet2/3/0/2] Eth-Trunk 9

[CSS-Gigabitethernet2/3/0/2] quit

# 创建VLANIF,并配置IP地址。

[CSS] vlan batch 100 200

[CSS] interface Eth-Trunk 8 //将Eth-Trunk8加入VLAN100

[CSS-Eth-Trunk8] port link-type trunk

[CSS-Eth-Trunk8] port trunk allow-pass vlan 100

[CSS-Eth-Trunk8] quit

[CSS] interface Vlanif 100 //创建VLANIF100,用于CSS连接业务网络1

[CSS-Vlanif100] ip address 10.10.100.1 24

[CSS-Vlanif100] quit

[CSS] interface Eth-Trunk 9 //将Eth-Trunk9加入VLAN200

[CSS-Eth-Trunk9] port link-type trunk

[CSS-Eth-Trunk9] port trunk allow-pass vlan 200

[CSS-Eth-Trunk9] quit

[CSS] interface Vlanif 200 //创建VLANIF200,用于CSS连接业务网络2

[CSS-Vlanif200] ip address 10.10.200.1 24

[CSS-Vlanif200] quit

步骤 3 路由器:配置路由器与CSS之间的接口

# 配置Router1,在Router1上创建Eth-Trunk1,并加入成员接口。

<Huawei> system-view

[Huawei] sysname Router1

[Router1] interface Eth-Trunk 1

[Router1-Eth-Trunk1] quit

[Router1] interface XGigabitethernet 1/0/1

[Router1-XGigabitEthernet1/0/1] undo shutdown

[Router1-XGigabitEthernet1/0/1] Eth-Trunk 1

[Router1-XGigabitEthernet1/0/1] quit

[Router1] interface XGigabitethernet 1/0/2

[Router1-XGigabitEthernet1/0/2] undo shutdown

[Router1-XGigabitEthernet1/0/2] Eth-Trunk 1

[Router1-XGigabitEthernet1/0/2] quit

# 配置Dot1q终结子接口,终结VLAN10。并配置IP地址。

[Router1] interface Eth-Trunk 1.100

[Router1-Eth-Trunk1.100] ip address 10.10.4.2 24

[Router1-Eth-Trunk1.100] dot1q termination vid 10

[Router1-Eth-Trunk1.100] quit

# Router2上的配置步骤与Router1相同,仅接口IP地址有差别,请参照Router1完成Router2的配置。

步骤 4 防火墙:配置防火墙的接口与安全区

# 配置FW1的接口与安全区。

<USG> system-view

[USG] sysname FW1

[FW1] interface Eth-Trunk 4 //配置与CSS连接的接口及IP地址

[FW1-Eth-Trunk4] ip address 10.10.2.2 24

[FW1-Eth-Trunk4] quit

[FW1] interface Gigabitethernet 1/0/0 //在Eth-Trunk4中加入成员接口

[FW1-GigabitEthernet1/0/0] Eth-Trunk 4

[FW1-GigabitEthernet1/0/0] quit

[FW1] interface Gigabitethernet 1/0/1 //在Eth-Trunk4中加入成员接口

[FW1-GigabitEthernet1/0/1] Eth-Trunk 4

[FW1-GigabitEthernet1/0/1] quit

[FW1] interface Eth-Trunk 5 //配置与CSS连接的接口及IP地址

[FW1-Eth-Trunk5] ip address 10.10.3.2 24

[FW1-Eth-Trunk5] quit

[FW1] interface Gigabitethernet 1/1/0 //在Eth-Trunk5中加入成员接口

[FW1-GigabitEthernet1/1/0] Eth-Trunk 5

[FW1-GigabitEthernet1/1/0] quit

[FW1] interface Gigabitethernet 1/1/1 //在Eth-Trunk5中加入成员接口

[FW1-GigabitEthernet1/1/1] Eth-Trunk 5

[FW1-GigabitEthernet1/1/1] quit

[FW1] interface Eth-Trunk 1 //配置FW1与FW2连接的接口

[FW1-Eth-Trunk1] ip address 10.1.1.1 24

[FW1-Eth-Trunk1] quit

[FW1] interface Gigabitethernet 2/0/0 //在Eth-Trunk1中加入成员接口

[FW1-GigabitEthernet2/0/0] Eth-Trunk 1

[FW1-GigabitEthernet2/0/0] quit

[FW1] interface Gigabitethernet 2/0/1 //在Eth-Trunk1中加入成员接口

[FW1-GigabitEthernet2/0/1] Eth-Trunk 1

[FW1-GigabitEthernet2/0/1] quit

[FW1] firewall zone trust

[FW1-zone-trust] add interface Eth-Trunk 5 //将连接内网的Eth-Trunk5加入安全区域

[FW1-zone-trust] quit

[FW1] firewall zone untrust

[FW1-zone-untrust] add interface Eth-Trunk 4 //将连接外网的Eth-Trunk4加入非安全区域

[FW1-zone-untrust] quit

[FW1] firewall zone dmz

[FW1-zone-dmz] add interface Eth-Trunk 1 //将FW1、FW2之间的接口加入DMZ区域

[FW1-zone-dmz] quit

# 配置FW2的接口与安全区。

<USG> system-view

[USG] sysname FW2

[FW2] interface Eth-Trunk 6 //配置与CSS连接的接口及IP地址

[FW2-Eth-Trunk6] ip address 10.10.2.3 24

[FW2-Eth-Trunk6] quit

[FW2] interface Gigabitethernet 1/0/0 //在Eth-Trunk6中加入成员接口

[FW2-GigabitEthernet1/0/0] Eth-Trunk 6

[FW2-GigabitEthernet1/0/0] quit

[FW2] interface Gigabitethernet 1/0/1 //在Eth-Trunk6中加入成员接口

[FW2-GigabitEthernet1/0/1] Eth-Trunk 6

[FW2-GigabitEthernet1/0/1] quit

[FW2] interface Eth-Trunk 7 //配置与CSS连接的接口及IP地址

[FW2-Eth-Trunk7] ip address 10.10.3.3 24

[FW2-Eth-Trunk7] quit

[FW2] interface Gigabitethernet 1/1/0 //在Eth-Trunk7中加入成员接口

[FW2-GigabitEthernet1/1/0] Eth-Trunk 7

[FW2-GigabitEthernet1/1/0] quit

[FW2] interface Gigabitethernet 1/1/1 //在Eth-Trunk7中加入成员接口

[FW2-GigabitEthernet1/1/1] Eth-Trunk 7

[FW2-GigabitEthernet1/1/1] quit

[FW2] interface Eth-Trunk 1 //配置FW2与FW1连接的接口

[FW2-Eth-Trunk1] ip address 10.1.1.2 24

[FW2-Eth-Trunk1] quit

[FW2] interface Gigabitethernet 2/0/0 //在Eth-Trunk1中加入成员接口

[FW2-GigabitEthernet2/0/0] Eth-Trunk 1

[FW2-GigabitEthernet2/0/0] quit

[FW2] interface Gigabitethernet 2/0/1 //在Eth-Trunk1中加入成员接口

[FW2-GigabitEthernet2/0/1] Eth-Trunk 1

[FW2-GigabitEthernet2/0/1] quit

[FW2] firewall zone trust

[FW2-zone-trust] add interface Eth-Trunk 7 //将连接内网的Eth-Trunk7加入安全区域

[FW2-zone-trust] quit

[FW2] firewall zone untrust

[FW2-zone-untrust] add interface Eth-Trunk 6 //将连接外网的Eth-Trunk6加入非安全区域

[FW2-zone-untrust] quit

[FW2] firewall zone dmz

[FW2-zone-dmz] add interface Eth-Trunk 1 //将FW1、FW2之间的接口加入DMZ区域

[FW2-zone-dmz] quit

步骤 5 路由器:部署VRRP。Router1为VRRP的Master,Router2为VRRP的Backup

# 配置Router1。

[Router1] interface Eth-Trunk 1.100

[Router1-Eth-Trunk1.100] vrrp vrid 1 virtual-ip 10.10.4.100 //配置VRRP的虚拟IP地址

[Router1-Eth-Trunk1.100] vrrp vrid 1 priority 120 //提高Router1的优先级,使其成为Master

[Router1-Eth-Trunk1.100] quit

# 配置Router2。

[Router2] interface Eth-Trunk 1.100

[Router2-Eth-Trunk1.100] vrrp vrid 1 virtual-ip 10.10.4.100 //配置VRRP的虚拟IP地址

[Router2-Eth-Trunk1.100] quit

配置完成后,Router1和Router2之间应该能建立VRRP的主备份关系,执行display vrrp命令可以看到Router1和Router2的VRRP状态。

# 查看Router1的VRRP状态为Master。

[Router1] display vrrp

Eth-Trunk1.100 | Virtual Router 1

State : Master

Virtual IP : 10.10.4.100

Master IP : 10.10.4.2

PriorityRun : 120

PriorityConfig : 120

MasterPriority : 120

Preempt : YES Delay Time : 0 s

TimerRun : 1 s

TimerConfig : 1 s

Auth type : NONE

Virtual MAC : 0000-5e00-0101

Check TTL : YES

Config type : normal-vrrp

Create time : 2015-05-18 06:53:47 UTC-05:13

Last change time : 2015-05-18 06:54:14 UTC-05:13

# 查看Router2的VRRP状态为Backup。

[Router2] display vrrp

Eth-Trunk1.100 | Virtual Router 1

State : Backup

Virtual IP : 10.10.4.100

Master IP : 10.10.4.2

PriorityRun : 100

PriorityConfig : 100

MasterPriority : 120

Preempt : YES Delay Time : 0 s

TimerRun : 1 s

TimerConfig : 1 s

Auth type : NONE

Virtual MAC : 0000-5e00-0101

Check TTL : YES

Config type : normal-vrrp

Create time : 2015-05-18 06:53:52 UTC-05:13

Last change time : 2015-05-18 06:57:12 UTC-05:13

步骤 6 配置CSS与FW、路由器之间的路由。

1. 在交换机与路由器之间部署OSPF。

# 在CSS上创建VPN实例Public,将连接路由器的接口和连接防火墙上行口的接口绑定到Public。

[CSS] ip vpn-instance Public //创建Public

[CSS-vpn-instance-Public] ipv4-family

[CSS-vpn-instance-Public-af-ipv4] route-distinguisher 100:2

[CSS-vpn-instance-Public-af-ipv4] vpn-target 222:2 both

[CSS-vpn-instance-Public-af-ipv4] quit

[CSS-vpn-instance-Public] quit

[CSS] interface Vlanif 10

[CSS-Vlanif10] ip binding vpn-instance Public //将CSS连接路由器的接口VLANIF10绑定至Public

[CSS-Vlanif10] ip address 10.10.4.1 24 //将接口绑定到Public时,接口上的IP地址会被删除,需要重新配置IP地址。

[CSS-Vlanif10] quit

[CSS] interface Vlanif 20

[CSS-Vlanif20] ip binding vpn-instance Public //将CSS连接防火墙上行口的接口VLANIF20绑定至Public

[CSS-Vlanif20] ip address 10.10.2.1 24 //将接口绑定到Public时,接口上的IP地址会被删除,需要重新配置IP地址。

[CSS-Vlanif20] quit

# 对于上行流量,在Public中配置静态路由,路由下一跳指向路由器VRRP虚拟IP。

[CSS] ip route-static vpn-instance Public 0.0.0.0 0.0.0.0 10.10.4.100 //Public中的缺省路由,下一跳指向路由器VRRP的虚拟IP

# 对于下行流量,在CSS与Router之间运行OSPF协议,用于Router学习到业务网段的回程路由信息。

[CSS] ospf 100 router-id 1.1.1.1

[CSS-ospf-100] area 0

[CSS-ospf-100-area-0.0.0.0] network 10.10.100.0 0.0.0.255 //将业务网络1所在网段发布到OSPF中

[CSS-ospf-100-area-0.0.0.0] network 10.10.200.0 0.0.0.255 //将业务网络2所在网段发布到OSPF中

[CSS-ospf-100-area-0.0.0.0] network 10.10.4.0 0.0.0.255 //将连接Router的网段发布到OSPF中

[CSS-ospf-100-area-0.0.0.0] quit

[CSS-ospf-100] import-route static //在OSPF中引入静态路由

[CSS-ospf-100] quit

在两个出口路由器Router1、Router2上部署OSPF。

# 配置Router1

[Router1] ospf 100 router-id 2.2.2.2

[Router1-ospf-100] area 0

[Router1-ospf-100-area-0.0.0.0] network 10.10.4.0 0.0.0.255 //将连接CSS的网段发布到OSPF中

[Router1-ospf-100-area-0.0.0.0] quit

[Router1-ospf-100] quit

# 配置Router2

[Router2] ospf 100 router-id 3.3.3.3

[Router2-ospf-100] area 0

[Router2-ospf-100-area-0.0.0.0] network 10.10.4.0 0.0.0.255 //将连接CSS的网段发布到OSPF中

[Router2-ospf-100-area-0.0.0.0] quit

[Router2-ospf-100] quit

# 配置完成后,CSS、Router1和Router2之间能建立邻居关系。以查看CSS上的OSPF邻居为例,能看到Router1和Router2,并且邻居状态是Full。

[CSS] display ospf peer

OSPF Process 100 with Router ID 1.1.1.1

Neighbors

Area 0.0.0.0 interface 10.10.4.1(Vlanif10)'s neighbors

Router ID: 2.2.2.2 Address: 10.10.4.2

State: Full Mode:Nbr is Master Priority: 1

DR: 10.10.4.1 BDR: 10.10.4.2 MTU: 0

Dead timer due in 31 sec

Retrans timer interval: 5

Neighbor is up for 00:13:23

Authentication Sequence: [ 0 ]

Router ID: 3.3.3.3 Address: 10.10.4.3

State: Full Mode:Nbr is Master Priority: 1

DR: 10.10.4.1 BDR: 10.10.4.2 MTU: 0

Dead timer due in 37 sec

Retrans timer interval: 5

Neighbor is up for 00:00:52

Authentication Sequence: [ 0 ]

2. 交换机:配置交换机与FW之间的静态路由。

# 对于上行流量,在CSS上创建VPN实例VRF-A,将连接业务网络的接口和连接防火墙下行的接口绑定到VRF-A,VRF-A的缺省路由下一跳指向防火墙下行VRRP虚拟IP(VRID2)。

[CSS] ip vpn-instance VRF-A //创建VRF-A

[CSS-vpn-instance-VRF-A] ipv4-family

[CSS-vpn-instance-VRF-A-af-ipv4] route-distinguisher 100:1

[CSS-vpn-instance-VRF-A-af-ipv4] vpn-target 111:1 both

[CSS-vpn-instance-VRF-A-af-ipv4] quit

[CSS-vpn-instance-VRF-A] quit

[CSS] interface Vlanif 100

[CSS-Vlanif100] ip binding vpn-instance VRF-A //将CSS连接业务网络1的接口VLANIF100绑定至VRF-A

[CSS-Vlanif100] ip address 10.10.100.1 24 //将接口绑定到VRF-A时,接口上的IP地址会被删除,需要重新配置IP地址。

[CSS-Vlanif100] quit

[CSS] interface Vlanif 200

[CSS-Vlanif200] ip binding vpn-instance VRF-A //将CSS连接业务网络2的接口VLANIF200绑定至VRF-A

[CSS-Vlanif200] ip address 10.10.200.1 24 //将接口绑定到VRF-A时,接口上的IP地址会被删除,需要重新配置IP地址。

[CSS-Vlanif200] quit

[CSS] interface Vlanif 30

[CSS-Vlanif30] ip binding vpn-instance VRF-A //将CSS连接防火墙下行的接口VLANIF30绑定至VRF-A

[CSS-Vlanif30] ip address 10.10.3.1 24 //将接口绑定到VRF-A时,接口上的IP地址会被删除,需要重新配置IP地址。

[CSS-Vlanif30] quit

# 在VRF-A中的配置缺省路由,下一跳指向防火墙下行VRRP 2的虚拟IP(VRID2)。

[CSS] ip route-static vpn-instance VRF-A 0.0.0.0 0.0.0.0 10.10.3.5

# 在Public中配置静态路由,对于下行流量,路由下一跳指向防火墙上行VRRP 1的虚拟IP(VRID1)。

[CSS] ip route-static vpn-instance Public 10.10.100.0 255.255.255.0 10.10.2.5 //目的地址是业务网段1的报文,下一跳指向2台FW VRID2的虚拟地址。

[CSS] ip route-static vpn-instance Public 10.10.200.0 255.255.255.0 10.10.2.5 //目的地址是业务网段2的报文,下一跳指向2台FW VRID2的虚拟地址。

3. 防火墙:配置防火墙的静态路由

# 在FW1上配置静态路由。

[FW1] ip route-static 0.0.0.0 0.0.0.0 10.10.2.1 //对于上行流量,缺省路由下一跳为交换机的Public接口VLANIF20的IP地址

[FW1] ip route-static 10.10.100.0 255.255.255.0 10.10.3.1 //对于下行流量,目的地址为业务网络1,下一跳为交换机上VRF-A接口VLANIF30的IP地址

[FW1] ip route-static 10.10.200.0 255.255.255.0 10.10.3.1 //对于下行流量,目的地址为业务网络2,下一跳为交换机上VRF-A接口VLANIF30的IP地址

# 在FW2上配置静态路由。

[FW2] ip route-static 0.0.0.0 0.0.0.0 10.10.2.1 //对于上行流量,缺省路由下一跳为交换机的Public接口VLANIF20的IP地址

[FW2] ip route-static 10.10.100.0 255.255.255.0 10.10.3.1 //对于下行流量,目的地址为业务网络1,下一跳为交换机上VRF-A接口VLANIF30的IP地址

[FW2] ip route-static 10.10.200.0 255.255.255.0 10.10.3.1 //对于下行流量,目的地址为业务网络2,下一跳为交换机上VRF-A接口VLANIF30的IP地址

# 配置完成后,Router1、Router1和CSS之间应该建立OSPF邻居关系,执行display ospf peer命令可以查看OSPF邻居状态为Full,以CSS为例,OSPF邻居状态如下。

4. 检查路由配置结果

# 查看CSS上的路由表。

[CSS] display ip routing-table vpn-instance VRF-A

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Tables: VRF-A

Destinations : 7 Routes : 7

Destination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0 Static 60 0 RD 10.10.3.5 Vlanif30

10.10.3.0/24 Direct 0 0 D 10.10.3.1 Vlanif30

10.10.3.1/32 Direct 0 0 D 127.0.0.1 Vlanif30

10.10.100.0/24 Direct 0 0 D 10.10.100.1 Vlanif100

10.10.100.1/32 Direct 0 0 D 127.0.0.1 Vlanif100

10.10.200.0/24 Direct 0 0 D 10.10.200.1 Vlanif200

10.10.200.1/32 Direct 0 0 D 127.0.0.1 Vlanif200

可以看到在VRF-A的路由表中,第1行表示访问外网流量的下一跳是防火墙VRRP VRID 2的虚拟地址10.10.3.5,说明上行流量被强制转发到防火墙进行检测。

[CSS] display ip routing-table vpn-instance Public

Route Flags: R - relay, D - download to fib

------------------------------------------------------------------------------

Routing Tables: Public

Destinations : 7 Routes : 7

Destination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0 Static 60 0 RD 10.10.4.100 Vlanif10

10.10.2.0/24 Direct 0 0 D 10.10.2.1 Vlanif20

10.10.2.1/32 Direct 0 0 D 127.0.0.1 Vlanif20

10.10.4.0/24 Direct 0 0 D 10.10.4.1 Vlanif10

10.10.4.1/32 Direct 0 0 D 127.0.0.1 Vlanif10

10.10.100.0/24 Static 60 0 RD 10.10.2.5 Vlanif20

10.10.200.0/24 Static 60 0 RD 10.10.2.5 Vlanif20

可以看到在Public的路由表中,第1行表示访问外网流量的下一跳是路由器VRRP VRID 1的虚拟地址10.10.4.100。

第5、6行表示访问业务网络的流量的下一跳是防火墙VRRP VRID 1的虚拟地址10.10.3.5,说明下行流量被强制转发到防火墙进行检测。

步骤 7 防火墙:配置双机热备

# 在FW1上配置双机热备,FW1在备份组中作为master。

[FW1] interface Eth-Trunk 4

[FW1-Eth-Trunk4] vrrp vrid 1 virtual-ip 10.10.2.5 24 master //在上行接口配置备份组1,并设置状态为master

[FW1-Eth-Trunk4] quit

[FW1] interface Eth-Trunk 5

[FW1-Eth-Trunk5] vrrp vrid 2 virtual-ip 10.10.3.5 24 master //在下行接口配置备份组2,并设置状态为master

[FW1-Eth-Trunk5] quit

[FW1] hrp interface Eth-Trunk 1 remote 10.1.1.2 //配置心跳口,并启用双机热备

[FW1] firewall packet-filter default permit interzone local dmz

[FW1] hrp enable

HRP_M[FW1]

# 在FW2上配置双机热备,FW2在备份组中作为slave。

[FW2] interface Eth-Trunk 6

[FW2-Eth-Trunk6] vrrp vrid 1 virtual-ip 10.10.2.5 24 slave //在上行接口配置备份组1,并设置状态为slave

[FW2-Eth-Trunk6] quit

[FW2] interface Eth-Trunk 7

[FW2-Eth-Trunk7] vrrp vrid 2 virtual-ip 10.10.3.5 24 slave //在下行接口配置备份组2,并设置状态为slave

[FW2-Eth-Trunk7] quit

[FW2] hrp interface Eth-Trunk 1 remote 10.1.1.1 //配置心跳口,并启用双机热备

[FW2] firewall packet-filter default permit interzone local dmz

[FW2] hrp enable

HRP_M[FW2]

# 查看VRRP状态,FW1为Master,FW2为slave。

HRP_M[FW1] display vrrp

Eth-Trunk4 | Virtual Router 1

VRRP Group : Master

State : Master

Virtual IP : 10.10.2.5

Virtual MAC : 0000-5e00-0101

Primary IP : 10.10.2.2

PriorityRun : 120

PriorityConfig : 100

MasterPriority : 120

Preempt : YES Delay Time : 0 s

Advertisement Timer : 1

Auth type : NONE

Check TTL : YES

Eth-Trunk5 | Virtual Router 2

VRRP Group : Master

State : Master

Virtual IP : 10.10.3.5

Virtual MAC : 0000-5e00-0102

Primary IP : 10.10.3.2

PriorityRun : 120

PriorityConfig : 100

MasterPriority : 120

Preempt : YES Delay Time : 0 s

Advertisement Timer : 1

Auth type : NONE

Check TTL : YES

HRP_M[FW2] display vrrp

Eth-Trunk7 | Virtual Router 2

VRRP Group : Slave

State : Backup

Virtual IP : 10.10.3.5

Virtual MAC : 0000-5e00-0102

Primary IP : 10.10.3.3

PriorityRun : 100

PriorityConfig : 100

MasterPriority : 120

Preempt : YES Delay Time : 0 s

Advertisement Timer : 1

Auth type : NONE

Check TTL : YES

Eth-Trunk6 | Virtual Router 1

VRRP Group : Slave

State : Backup

Virtual IP : 10.10.2.5

Virtual MAC : 0000-5e00-0101

Primary IP : 10.10.2.3

PriorityRun : 120

PriorityConfig : 100

MasterPriority : 120

Preempt : YES Delay Time : 0 s

Advertisement Timer : 1

Auth type : NONE

Check TTL : YES

# 查看双机热备状态。

HRP_M[FW1] display hrp state

The firewall's config state is: MASTER

Current state of virtual routers configured as master:

Eth-Trunk4 vrid 1 : master

(gigabitEthernet1/0/0) : up

(gigabitEthernet1/0/1) : up

Eth-Trunk5 vrid 2 : master

(gigabitEthernet1/1/0) : up

(gigabitEthernet1/1/1) : up

双机热备功能配置完成后,主用设备的配置和会话会自动备份到备用设备上,因此以下功能只需在主用防火墙FW1上配置即可。

步骤 8 防火墙:配置安全策略

本例仅涉及防火墙与交换机的对接配置以及防火墙的双机热备配置。防火墙上的安全业务规划及园区安全策略、攻击防范、带宽管理、IPSec等功能的配置示例请参见《防火墙配置案例集》。

步骤 9 检查配置结果

完成上述配置后,检查CSS与Router是否能相互Ping通。

# 以CSS Ping Router1 的Eth-Trunk1.100为例,检查上行通路是否连通。

<CSS> ping 10.10.4.2

Ping 10.10.4.2: 32 data bytes, Press Ctrl_C to break

Reply From 10.10.4.2: bytes=32 seq=1 ttl=126 time=140 ms

Reply From 10.10.4.2: bytes=32 seq=2 ttl=126 time=235 ms

Reply From 10.10.4.2: bytes=32 seq=3 ttl=126 time=266 ms

Reply From 10.10.4.2: bytes=32 seq=4 ttl=126 time=140 ms

Reply From 10.10.4.2: bytes=32 seq=5 ttl=126 time=141 ms

--- 10.10.200.2 ping statistics ---

5 packet(s) transmitted

5 packet(s) received

0.00% packet loss

round-trip min/avg/max = 140/184/266 ms

可以看到,CSS和Router1之间上行链路是可以互通的。

# 以Router1 Ping CSS内网侧VRF-A的接口VLANIF100为例,检查下行通路是否连通。

<Router1> Ping 10.10.100.1

Ping 10.10.100.1: 32 data bytes, Press Ctrl_C to break

Reply From 10.10.100.1: bytes=32 seq=1 ttl=253 time=235 ms

Reply From 10.10.100.1: bytes=32 seq=2 ttl=253 time=109 ms

Reply From 10.10.100.1: bytes=32 seq=3 ttl=253 time=79 ms

Reply From 10.10.100.1: bytes=32 seq=4 ttl=253 time=63 ms

Reply From 10.10.100.1: bytes=32 seq=5 ttl=253 time=63 ms

--- 202.10.1.1 ping statistics ---

5 packet(s) transmitted

5 packet(s) received

0.00% packet loss

round-trip min/avg/max = 63/109/235 ms

可以看到,Router1和CSS的VLANIF100之间下行链路是可以互通的

标签: #华为css交换机配置