A-A+

网络升级VRRP实例

2019年06月04日 技术分享, 电脑网络 评论 2 条 阅读 18,990 次

本次主要是为宜化化工万州分支机构七层办公大楼及厂区组件网络,当然本次实施还考验一些体力活儿,毕竟园区还是有那么大嘛,主要的工作重点是把五台华为S5720交换机和四台华为S5700交换机和两台S6720一台USG6390E全部上架,配置管理VLAN和管理地址,另外所有的业务网关都全部做在S6720,然后在S6720上配置静态路由,防火墙上配置回程路由。

对于这种交换网络,我想最核心的技术问题在于VRRP的规划和STP的规划,稍不注意极可能使其整个网络变得非常脆弱,此次实施完成后运行状态正常稳定,涂涂小窝特此分享方便自己方便他人。

组网所选配的设备如下图:(图中全是新设备,客户原来再用的一些交换机也还会用上)

具体需求如下:

1.SUG6390E作为外网出口,两台S6720做为分支机构局域网的三层网关设备,S5720只作为二层设备使用。

2.设备的管理地址要单独划分在一个VLAN内,并且只能从分支机构内部局域网进行访问,企业总部无法直接使用管理地址登陆到该分支机构的任何一台交换机。

为了保证网络的健壮性和高可用性,要求两台华为S6720之间必须配置 VRRP (虚拟路由冗余协议 )。并且为防止二层广播风暴,要求必须配置STP生成树协议,并将华为S5720的 Access 接口全部配置为边缘端口。

根据需求,大致得出该分支机构的网络拓扑图如下:

网络设备连线

为了保证分支机构局域网的出口带宽,两台S6720使用千兆光纤与S5720和S5700互联,同时并保证每一台S5720和S5700都要和两台S6720各有一条连接线。

分支机构局域网出口互联地址规划:

 

连接线缆与管理地址配置

交换机与交换机之间应该首选光纤进行连接确保每一台S5720都与S6720之间有连接线缆,这样才能保证冗余性。S6720之间需要一条心跳线,这条心跳线也应该首选光纤。由于该案例是局域网网络建设光纤的传输距比较远所以选用单模光纤。

设备的管理地址要求不能通过骨干网络访问所以这个管理地址就只能是私有地址了 。 由于骨干网络的地址都是 10.0.0.0/8 的子网,所以局域网这11台设备的管理地址不能是 10.0.0.0/8 的子网。可以选择 172.16.0.0/16 的子网或者是192.168.2.0/24 192.168.255.0 /24 这些地址作为设备的管理地址。

温馨提示

为什么不选择192.168.0.0/24 和 192.168.1.0/24 呢?因为这两段地址会和无线路由器的LAN端的默认地址冲突。 在工程实施过程中不管如何规划地址多么宽松的场合也不能使用这两段地址 。

我模拟为了方便,加之我这是真实实例我的管理IP自然与上图IP地址规划表中不同,且也不在10.0.0.0子网下。

我模拟本案例选择 10.149..0.0/24 为设备配置管理地址 ,选择 V LAN 10 作为管理VLAN 。

另外启用了管理地址以后需要为设备设置一个用于远程管理的用户名和密码 。考虑到远程管理的安全性远程管理协议应该使用 SSH 协议,我这里还是选择了telnet。

在S6720A上配置如下,其实最好是先配置完二层交换机

注意:交换机与交换机之间的接口都配置trunk并允许相应vlan通过,三层交换机与防火墙连接的端口不应是trunk并允许vlan透传。

[S6720A]vlan batch 10 to 18

[S6720A]undo info-center enable

[S6720A]interface vlan 10

[S6720A-Vlanif10]ip address 10.149.0.254 24 配置管理地址

[S6720A-Vlanif10]quit

配置telnet远程认证登录管理

[S6720A]user-interface vty 0 4

[S6720A-ui-vty0-4]authentication-mode aaa

[S6720A-aaa]local-user moni password cipher moni@2019

Info: Add a new user.

[S6720A-aaa]local-user moni service-type telnet

[S6720A-aaa]local-user moni privilege level 3

[S6720A-aaa]quit

配置所有交换机相连的接口为trunk模式

[S6720A]interface GigabitEthernet 0/0/24

[S6720A-GigabitEthernet0/0/1]port link-type trunk

[S6720A-GigabitEthernet0/0/1]port trunk allow-pass vlan all

[S6720A-GigabitEthernet0/0/1]description TO S6720B 增加接口描述

[S6720A-GigabitEthernet0/0/1]quit

配置完vlan及接口描述管理ip 远程登录后全局模式下配置生成树

[S6720A]stp enable

[S6720A]stp mode mstp 都使用多生成树

[S6720A]stp region-configuration

[S6720A-mst-region]region-name yihua 命名yihua

[S6720A-mst-region]instance 1 vlan 10 to 18 我这里一个根桥

[S6720A-mst-region]active region-configuration 激活

[S6720A-mst-region]display this 查看前一步所配置命令

[S6720A]stp instance 1 priority 0 优先级设置为0 三层交换B优先级4096

截止二层基本完成配置

[S6720A]display stp vlan 10 执行检查 状态应该是DESI 交换机2 24口应该是root 因为三层交换机1是根桥

接下来配置各vlan 网关(此处举例vlan11

[S6720A]interface vlan 11

[S6720A-Vlanif11]ip address 11.149.1.2 255.255.255.0 注意二号机接口地址不同,示:10.149.1.3/24

[S6720A-Vlanif11]vrrp vrid 11 virtual-ip 10.149.1.1 注意二号机虚拟地址必须相同

[S6720A-Vlanif11]vrrp vrid 11 preempt 默认抢占模式这条不用写

[S6720A-Vlanif11]vrrp vrid 11 priority 105 二号机设置100

[S6720A-Vlanif11]quit

[S6720A]interface GigabitEthernet0/0/1

[S6720A-GigabitEthernet0/0/1]description TO USG6390E-1/0/0

[S6720A-GigabitEthernet0/0/1]port link-type access

[S6720A-GigabitEthernet0/0/1]port default vlan 18

[S6720A-GigabitEthernet0/0/1]stp edged-port enable对access配置接口边缘化不参与生成树

[S6720A-GigabitEthernet0/0/1]quit

[S6720A]interface vlan 18

[S6720A-Vlanif18]ip address 10.149.18.1 255.255.255.0 接口与防火墙同vlan同网段互联

[S6720A-Vlanif18]quit

[S6720A]ip route-static 0.0.0.0 0.0.0.0 10.149.18.2

[S6720A-GigabitEthernet0/0/23]stp edged-port enable 对access配置接口边缘化不参与生成树

我这里23口是连接真机便于更好测试。

S6720B交换机与S6720A配置方式相同,不同的是vlan接口地址不同优先级不同,管理地址不同,这里我就不贴配置出来了。

先配置二层交换机

[Huawei]sysname SW1

[SW1]vlan batch 10 to 18 批量创建vlan

[SW1]undo info-center enable 关闭配置变更提示信息

[SW1]interface vlan 10

[SW1-Vlanif14]ip address 10.149.0.252 24配置管理地址

[SW1-Vlanif14]quit

[SW1]interface Ethernet0/0/1

[SW1-Ethernet0/0/1]description TO S67201 给接口添加描述

[SW1-Ethernet0/0/1]quit

[SW1]interface Ethernet0/0/2

[SW1-Ethernet0/0/2]description TO S67202

[SW1-Ethernet0/0/2]quit

[SW1]interface Ethernet0/0/1

[SW1-Ethernet0/0/1]port link-type trunk

[SW1-Ethernet0/0/1]port trunk allow-pass vlan 10 to 18

[SW1-Ethernet0/0/1]quit

#配置STP生成树,其他二层交换机配置均相同

stp enable

stp mode mstp

stp region-configuration

region-name yihua

instance 1 vlan 10 to 18

active region-configuration

[SW1]display stp vlan 10 确认到非根桥交换机接口状态是否为ALTE阻断,是则正确

ProcessId InstanceId Port Role State


0 1 Ethernet0/0/1 ROOT FORWARDING

0 1 Ethernet0/0/2 ALTE DISCARDING

#

interface Vlanif10

ip address 10.149.0.252 255.255.255.0

#

interface GigabitEthernet0/0/1

port link-type access

port default vlan 11

stp edged-port enable

#

interface GigabitEthernet0/0/2

port link-type access

port default vlan 11

stp edged-port enable

其他S5720与S5700配置均相同,不同的是所有access口所属vlan。

防火墙我启用了web界面管理方便客户,配置如下

<USG6000V1>sys

Enter system view, return user view with Ctrl+Z.

[USG6000V1]sysname USG6390E

[USG6390E]web-manager enable 开启web

Error: Web server has been enabled, please disable it first.

[USG6390E]interface GigabitEthernet 0/0/0

[USG6390E-GigabitEthernet0/0/0]service-manage ping permit

[USG6390E-GigabitEthernet0/0/0]service-manage enable

[USG6390E-GigabitEthernet0/0/0]service-manage https permit

[USG6390E-GigabitEthernet0/0/0]quit

[USG6390E]quit

防火墙与三层交换机内网互联配置

[USG6390E]interface Vlanif 18

[USG6390E-Vlanif18]quit

[USG6390E]interface GigabitEthernet 1/0/0

[USG6390E-GigabitEthernet1/0/0]portswitch 将三层接口转换为二层接口,undo portswitch就是取消转换

[USG6390E-GigabitEthernet1/0/0]port link-type access

[USG6390E-GigabitEthernet1/0/0]port default vlan 18

[USG6390E]interface vlan 18

[USG6390E-Vlanif18]description TO S6720A-GE0/0/1 GE1/0/1-S6720B-GE0/0/1

[USG6390E-Vlanif18]ip address 10.149.18.2 24

[USG6390E-Vlanif18]quit

防火墙telnet远程登录配置(最好是关闭远程配置undo service telnet),这里为了方便我更好测试。

[USG6390E]interface Vlanif 18

[USG6390E-Vlanif18]service-manage enable

[USG6390E-Vlanif18]service-manage telnet permit

[USG6390E-Vlanif18]quit

[USG6390E]user-interface vty 0 4

[USG6390E-ui-vty0-4]protocol inbound telnet

[USG6390E-ui-vty0-4]authentication-mode aaa

[USG6390E-ui-vty0-4]quit

[USG6390E]aaa

[USG6390E-aaa]manager-user moni

[USG6390E-aaa-manager-user-moni]password cipher moni@2019

[USG6390E-aaa-manager-user-moni]service-type telnet terminal ssh (我这里给的全哈,仅供参考)

[USG6390E-aaa-manager-user-moni]quit

[USG6390E-aaa]manager-user moni

[USG6390E-aaa-manager-user-moni]level 3

[USG6390E-aaa-manager-user-moni]access-limit 1

[USG6390E-aaa-manager-user-moni]quit

[USG6390E-aaa]quit

[USG6390E]

去向静态路由配置

[USG6390E]ip route-static 10.149.1.0 255.255.255.0 10.149.18.1

[USG6390E]ip route-static 10.149.2.0 255.255.255.0 10.149.18.1

[USG6390E]ip route-static 10.149.3.0 255.255.255.0 10.149.18.1

[USG6390E]ip route-static 10.149.4.0 255.255.255.0 10.149.18.1

[USG6390E]ip route-static 0.0.0.0 0.0.0.0 183.230.24.65公网出口同网段IP对端入口下一跳地址

[USG6390E-Vlanif18]service-manage ping permit

[USG6390E-Vlanif18]quit

安全策略配置

[USG6390E]security-policy

[USG6390E-policy-security]default action permit 全部放行

Warning:Setting the default packet filtering to permit poses security risks. You

are advised to configure the security policy based on the actual data flows. Ar

e you sure you want to continue?[Y/N]y

[USG6390E-policy-security]rule name vlan18

[USG6390E-policy-security-rule-vlan18]description TO S6720AB

[USG6390E-policy-security-rule-vlan18]source-zone trust

[USG6390E-policy-security-rule-vlan18]destination-zone untrust

[USG6390E-policy-security-rule-vlan18]action permit

[USG6390E-policy-security-rule-vlan18]quit

[USG6390E-policy-security]quit

[USG6390E]quit

<USG6390E>save

温馨提示:配置 生成树 协议与边缘端口配置生成树协议应该在配置业务网关之前完成在配置设备的时候应该先配置二层协议 、 再配置三成协议 。

由于所有业务 VLAN 的 Master 设备都在 S6720A上所以在配置生成树的时候也应该把所有 VLAN 的根桥配置在 S6720A 上 。 另外,为了防止连接终端的 Access接口在终端设备关机、开机的时候发送 BPDU 报文,应该把所有 Access 接口改为边缘端口 。

在 S6720A 上配置生成树协议指定它是所有 VLAN 的根桥。

#

stp region-configuration

region-name yihua

instance 1 vlan 10 to 18

active region-configuration

stp instance 1 priority 0

#

在 S6720B 上配置生成树协议指定它是所有 VLAN 的备用根桥。

#

stp region-configuration

region-name yihua

instance 1 vlan 10 to 18

active region-configuration

stp instance 1 priority 4096

#

在其他的 S5720 上只配置生成树实例不用调整任何优先级。

#

stp region-configuration

region-name yihua

instance 1 vlan 10 to 18

active region-configuration

#

这里二层交换机SWB,SWC,SWD我就不一一贴配置了,节省我个人网站空间。

经验总结

对于一个中型局域网的建设主要还是以体力活为主,真正需要配置的内容不多,而所用到的技术也是非常基础的网络技术 。 但是这毕竟是生产环境的现网一些必要的故障规避措施还是要有的,特别是在设计网络的时候要坚决避免二层环路 。

在设备上架的时候,必须每台设备都要保证完全正常的运转;在测试网络的时候,也可以在每台设备里面设置一个测试 VLAN 和测试 IP 地址,保证每台设备都能够相互访问,然后才能做其他的操作。

 

2 条留言  访客:0 条  博主:0 条

  1. 单纯的我

给我留言取消回复

icon_question icon_razz icon_sad icon_evil icon_exclaim icon_smile icon_redface icon_biggrin icon_surprised icon_eek icon_confused icon_cool icon_lol icon_mad icon_liuhan icon_rolleyes icon_wink icon_idea icon_arrow icon_neutral icon_cry icon_mrgreen icon_qinqin icon_bizui

×
订阅图标按钮