内 网 优 化

本文详细介绍了在一个网络环境中如何通过配置VRRP和MSTP来增强网关稳定性和冗余性,以及防止链路环路并优化转发路径。配置包括VRRP的设置,使得SW5成为VLAN10和VLAN20的Master,SW6成为VLAN30的Master,同时配置MSTP以实现主根和备根的设定。此外,SW6被配置为DHCP中继,确保VLAN30的主机能通过它获取IP地址。最后,验证和测试了配置的有效性。
摘要由CSDN通过智能技术生成

拓扑

 

需求

    1)所有部门中都使用了网关冗余技术,为了增强网关稳定性和冗余性

    -配置VRRP

    -SW5是VLAN10和VLAN20的Master ,是VLAN30的Backup

    -SW6是VLAN10和VLAN20的Backup,是VLAN30的Master

    2)交换机之间存在很多冗余链路,必须防止环路的发生,并且能够提高链路的利用率,要求每个部门的主机访问其他主机时,使用的都是最优的转发路径

    -配置MSTP

    -SW5是VLAN10和VLAN20的主根 ,是VLAN30的备根

    -SW6是VLAN10和VLAN20的备根 ,是VLAN30的主根

    3)VLAN30的主机通过SW6与DHCP服务器通信,获取IP地址,所以SW6也是DHCP中继

配置步骤

第一步:SW6基础配置

      -创建vlan10/vlan20/vlan30/vlan50

      -配置vlanif虚接口地址:192.168.xx.252

      -与SW1/SW2/SW3互联的接口配置trunk,允许所有vlan通过

 第二步:配置VRRP

      -在SW5中将g0/0/6 口配置trunk 模式,允许所有vlan通过

      -在vlanif虚接口下配置VRRP

      -让SW5成为vlan10/vlan20的Master,vlan30的Backup

      -让SW6成为vlan30的Master,vlan10/vlan20的Backup

  第三步:配置MSTP

      -在所有的交换机中配置MSTP

      -让SW5成为vlan10/vlan20的主根,vlan30的备根

      -让SW6成为vlan30的主根、vlan10/vlan20的备根

第四步:配置SW6-DHCP中继

      -在系统视图下,开启dhcp 功能

      -在每个vlanif虚接口下开启dhcp中继,并配置DHCP服务器IP:192.168.50.1

配置命令
第一步:SW6基础配置
SW6配置:
[Huawei]sys SW6
[SW6]port-group group-member g0/0/1 to g0/0/3  g0/0/6
[SW6-port-group]port link-type trunk
[SW6-port-group]port trunk allow-pass vlan all
[SW6-port-group]quit 
[SW6]vlan batch 10 20 30 50
[SW6]int vlanif 10
[SW6-Vlanif10]ip address 192.168.10.252 24
[SW6-Vlanif10]int vlanif20
[SW6-Vlanif20]ip address 192.168.20.252 24
[SW6-Vlanif20]int vlanif30
[SW6-Vlanif30]ip address 192.168.30.252 24


第二步:配置VRRP
SW5配置:
[SW5]int g0/0/6
[SW5-GigabitEthernet0/0/6]port link-type trunk
[SW5-GigabitEthernet0/0/6]port trunk allow-pass vlan all
[SW5-GigabitEthernet0/0/6]quit
[SW5]int vlanif 10
[SW5-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.254
[SW5-Vlanif10]vrrp vrid 10 priority 130
[SW5-Vlanif10]int vlanif 20
[SW5-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.254
[SW5-Vlanif20]vrrp vrid 20 priority 130
[SW5-Vlanif20]int vlanif 30
[SW5-Vlanif30]vrrp vrid 30 virtual-ip 192.168.30.254

SW6配置:
[SW6]int vlanif 10
[SW6-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.254
[SW6-Vlanif10]int vlanif 20
[SW6-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.254
[SW6-Vlanif20]int vlanif 30
[SW6-Vlanif30]vrrp vrid 30 virtual-ip 192.168.30.254
[SW6-Vlanif30]vrrp vrid 30 priority 130

第三步:配置MSTP
SW1配置:
[SW1]stp region-configuration
[SW1-mst-region] region-name ntd
[SW1-mst-region] instance 10 vlan 10
[SW1-mst-region] instance 20 vlan 20
[SW1-mst-region] instance 30 vlan 30
[SW1-mst-region] active region-configuration
[SW1-mst-region] quit
[SW1]int g0/0/3
[SW1-G0/0/3]port link-type trunk
[SW1-G0/0/3]port trunk allow-pass vlan all


SW2配置:
[SW2]stp region-configuration
[SW2-mst-region] region-name ntd
[SW2-mst-region] instance 10 vlan 10
[SW2-mst-region] instance 20 vlan 20
[SW2-mst-region] instance 30 vlan 30
[SW2-mst-region] active region-configuration
[SW2-mst-region] quit
[SW2]int g0/0/3
[SW2-G0/0/3]port link-type trunk
[SW2-G0/0/3]port trunk allow-pass vlan all

SW3配置:
[SW3]stp region-configuration
[SW3-mst-region] region-name ntd
[SW3-mst-region] instance 10 vlan 10
[SW3-mst-region] instance 20 vlan 20
[SW3-mst-region] instance 30 vlan 30
[SW3-mst-region] active region-configuration
[SW3-mst-region] quit
[SW3]int g0/0/3
[SW3-G0/0/3]port link-type trunk
[SW3-G0/0/3]port trunk allow-pass vlan all

SW5配置:
[SW5]stp region-configuration 
[SW5-mst-region]region-name ntd
[SW5-mst-region]instance 10 vlan 10
[SW5-mst-region]instance 20 vlan 20
[SW5-mst-region]instance 30 vlan 30
[SW5-mst-region]active region-configuration 

[SW5]stp instance 10 priority 4096
[SW5]stp instance 20 priority 4096
[SW5]stp instance 30 priority 8192

SW6配置:
[SW6]stp region-configuration
[SW6-mst-region] region-name ntd
[SW6-mst-region] instance 10 vlan 10
[SW6-mst-region] instance 20 vlan 20
[SW6-mst-region] instance 30 vlan 30
[SW6-mst-region] active region-configuration

[SW6]stp instance 10 priority 8192
[SW6]stp instance 20 priority 8192
[SW6]stp instance 30 priority 4096

第四步:配置SW6-DHCP中继
SW6配置:
[SW6]int vlanif 50
[SW6-Vlanif50]ip address 192.168.50.252 24
[SW6-Vlanif50]quit
[SW6]dhcp enable
[SW6]int vlanif 10
[SW6-Vlanif10]dhcp select relay
[SW6-Vlanif10]dhcp relay server-ip 192.168.50.1
[SW6-Vlanif10]int vlanif 20
[SW6-Vlanif20]dhcp select relay
[SW6-Vlanif20]dhcp relay server-ip 192.168.50.1
[SW6-Vlanif20]int vlanif30
[SW6-Vlanif30]dhcp select relay
[SW6-Vlanif30]dhcp relay server-ip 192.168.50.1

备注:sw1/sw2/sw3的g0/0/3口也做成trunk接口

备注:实现vlan50的最优转发路径:
1)vlan50的流量默认走实例0 -instance 0 
2) 所以我们把SW5设置位instance 0 的主根, 把SW6设置位instance 0 的备根
   就可以实现SW6 到DHCP服务器的数据转发路径是通过g0/0/6转发,实现最优转发路径
3)配置命令:
   SW5:
       stp  instance 0 priority  4096
   
   SW6:
       stp  instance 0  priority  8192
       
  第五步:验证与测试:
  
  vlan10/vlan20的PC 通过SW5-中继和DHCP,获取IP地址
  vlan30的PC 通过SW6-中继和DHCP,获取IP地址
  所有的PC都互联互通
  
  
  验证命令:
  <SW5>display stp instance 10
  <SW5>display stp instance 20
  <SW5>display stp instance 30
  <SW5>display stp instance 0
  <SW5>display vrrp brief
  
  
  <SW6>display stp instance 10
  <SW6>display stp instance 20
  <SW6>display stp instance 30
  <SW6>display stp instance 0
  <SW6>display vrrp brief

  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值