基于 STP 的可靠网络配置
Jan16 公司为提高网络的可靠性,使用了两台高性能交换机作为核心交换机,接入层交换机与核心层交换机互联,形成冗余结构,拓扑如图 1 所示,具体要求如下:
(1)为避免交换环路问题,需配置交换机的 STP 功能,要求核心交换机有较高优先级,SW1 为根交换机,SW2 为备用根交换机,SW1-SW3 和 SW1-SW4 为主链路;
(2)技术部使用 VLAN10,网络地址为 10.0.1/24,PC1 和 PC2 分别接入到 SW3 和 SW4。
图 1 网络拓扑图
根据拓扑图 1可知,SW1 和 SW2 为核心交换机,其中将 SW1 配置为根交换机,SW2 为备用根交换机;SW3 和 SW4 作为接入交换机,其中 SW1-SW3 及 SW1-SW4 的链路由主链路,SW2-SW4 及 SW2-SW3 的 2 条链路作为备用链路。
因此在 STP 配置中可将 SW1 的优先级设为最高,SW2 的优先级为次高,如:SW1 的优先级为 0,SW2 的优先级为 4096。
同时,考虑到技术部的计算机划分在 VLAN10 的网段内,且计算机连接在不同的交换机上,故交换机之间的链路需配置为 Trunk 模式。
具体配置步骤如下:
(1)创建 VLAN
(2)将交换机端口划分至相应 VLAN
(3)开启 STP
(4)配置 STP 优先级
(5)配置各部门计算机的 IP 地址
具体规划如下表:
表 1 VLAN 规划表
VLAN ID |
VLAN 描述信息 |
IP 地址段 |
用途 |
Vlan10 |
Technical |
192.168.1.1-5/24 |
技术部 |
表 2 端口规划表
本端设备 |
端口号 |
端口类型 |
对端设备 |
对端接口 |
SW1 |
GE0/0/1 |
Trunk |
SW3 |
GE0/0/1 |
SW1 |
GE0/0/2 |
Trunk |
SW4 |
GE 0/0/1 |
SW1 |
GE0/0/3 |
Trunk |
SW2 |
GE 0/0/3 |
SW2 |
GE0/0/1 |
Trunk |
SW3 |
GE0/0/2 |
SW2 |
GE0/0/2 |
Trunk |
SW4 |
GE0/0/2 |
SW2 |
GE0/0/3 |
Trunk |
SW1 |
GE0/0/3 |
SW3 |
GE0/0/1 |
Trunk |
SW1 |
GE0/0/1 |
SW3 |
GE0/0/2 |
Trunk |
SW2 |
GE0/0/1 |
SW3 |
Eth0/0/1 |
Access |
技术部 PC1 |
Eth0/0/1 |
SW4 |
GE0/0/1 |
Trunk |
SW1 |
GE0/0/2 |
SW4 |
GE0/0/2 |
Trunk |
SW2 |
GE0/0/2 |
SW4 |
Eth0/0/1 |
Access |
技术部 PC1 |
Eth0/0/1 |
PC1 |
GE0/0/1 |
Null |
SW3 |
Eth0/0/1 |
PC2 |
GE0/0/1 |
Null |
SW4 |
Eth0/0/1 |
表 3 IP 地址规划表
计算机 |
IP 地址 |
技术部 PC1 |
192.168.1.1/24 |
技术部 PC2 |
192.168.1.2/24 |
为各部门创建相应的 VLAN。
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW1
[SW1]vlan 10
[SW1-vlan10]description Technical
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW2
[SW2]vlan 10
[SW2-vlan10]description Technical
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW3
[SW3]vlan 10
[SW3-vlan10]description Technical
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW4
[SW4]vlan 10
[SW4-vlan10]description Technical
[SW1]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/3
[SW1-port-group]port link-type trunk
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/2]port link-type trunk
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-port-group]port trunk allow-pass vlan 10
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 10
[SW1-port-group]
[SW2]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/3
[SW2-port-group]port link-type trunk
[SW2-GigabitEthernet0/0/1]port link-type trunk
[SW2-GigabitEthernet0/0/2]port link-type trunk
[SW2-GigabitEthernet0/0/3]port link-type trunk
[SW2-port-group]port trunk allow-pass vlan 10
[SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[SW2-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[SW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 10
[SW2-port-group]
[SW3]interface Ethernet 0/0/1
[SW3-Ethernet0/0/1]port link-type access
[SW3-Ethernet0/0/1]port default vlan 10
[SW3-Ethernet0/0/1]port-group group-member GigabitEthernet 0/0/1 to GigabitEther
net 0/0/2
[SW3-port-group]port link-type trunk
[SW3-GigabitEthernet0/0/1]port link-type trunk
[SW3-GigabitEthernet0/0/2]port link-type trunk
[SW3-port-group]port trunk allow-pass vlan 10
[SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[SW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[SW3-port-group]
[SW4]interface Ethernet 0/0/1
[SW4-Ethernet0/0/1]port link-type access
[SW4-Ethernet0/0/1]port default vlan 10
[SW4-Ethernet0/0/1]port-group group-member GigabitEthernet 0/0/1 to GigabitEther
net 0/0/2
[SW4-port-group]port link-type trunk
[SW4-GigabitEthernet0/0/1]port link-type trunk
[SW4-GigabitEthernet0/0/2]port link-type trunk
[SW4-port-group]port trunk allow-pass vlan 10
[SW4-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[SW4-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[SW4-port-group]
[SW1]stp enable
[SW1]stp mode stp
[SW2]stp enable
[SW2]stp mode stp
[SW3]stp enable
[SW3]stp mode stp
[SW4]stp enable
[SW4]stp mode stp
将 SW1 配置为主根交换机,SW2 为备份根交换机。
方法 1:SW1 的优先级改为 0,SW2 的优先级改为 4096
[SW1]stp priority 0
[SW2]stp priority 4096
首先删除在SW1 上所配置的优先级,使用 stp root primary 命令配置主根交
换机。
[SW1]undo stp priority
[SW1]stp root primary
删除在 SW2 上所配置的优先级,使用 stp root secondary 命令配置备份根交换机
[SW2]undo stp priority
[SW2] stp root secondary
图 2 技术部PC1 IP 配置图
图 3技术部PC2 IP 配置图
[SW1]display vlan
The total number of vlans is : 2
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
1 common UT:GE0/0/1(U) GE0/0/2(U) GE0/0/3(U) GE0/0/4(D)
GE0/0/5(D) GE0/0/6(D) GE0/0/7(D) GE0/0/8(D)
GE0/0/9(D) GE0/0/10(D) GE0/0/11(D) GE0/0/12(D)
GE0/0/13(D) GE0/0/14(D) GE0/0/15(D) GE0/0/16(D)
GE0/0/17(D) GE0/0/18(D) GE0/0/19(D) GE0/0/20(D)
GE0/0/21(D) GE0/0/22(D) GE0/0/23(D) GE0/0/24(D)
10 common TG:GE0/0/1(U) GE0/0/2(U) GE0/0/3(U)
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
1 enable default enable disable VLAN 0001
10 enable default enable disable Technical
[SW1]
[SW2]display vlan
The total number of vlans is : 2
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
1 common UT:GE0/0/1(U) GE0/0/2(U) GE0/0/3(U) GE0/0/4(D)
GE0/0/5(D) GE0/0/6(D) GE0/0/7(D) GE0/0/8(D)
GE0/0/9(D) GE0/0/10(D) GE0/0/11(D) GE0/0/12(D)
GE0/0/13(D) GE0/0/14(D) GE0/0/15(D) GE0/0/16(D)
GE0/0/17(D) GE0/0/18(D) GE0/0/19(D) GE0/0/20(D)
GE0/0/21(D) GE0/0/22(D) GE0/0/23(D) GE0/0/24(D)
10 common TG:GE0/0/1(U) GE0/0/2(U) GE0/0/3(U)
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
1 enable default enable disable VLAN 0001
10 enable default enable disable Technical
[SW2]
[SW3]display vlan
The total number of vlans is : 2
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
1 common UT:Eth0/0/2(D) Eth0/0/3(D) Eth0/0/4(D) Eth0/0/5(D)
Eth0/0/6(D) Eth0/0/7(D) Eth0/0/8(D) Eth0/0/9(D)
Eth0/0/10(D) Eth0/0/11(D) Eth0/0/12(D) Eth0/0/13(D)
Eth0/0/14(D) Eth0/0/15(D) Eth0/0/16(D) Eth0/0/17(D)
Eth0/0/18(D) Eth0/0/19(D) Eth0/0/20(D) Eth0/0/21(D)
Eth0/0/22(D) GE0/0/1(U) GE0/0/2(U)
10 common UT:Eth0/0/1(U)
TG:GE0/0/1(U) GE0/0/2(U)
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
1 enable default enable disable VLAN 0001
10 enable default enable disable Technical
[SW3]
[SW4]display vlan
The total number of vlans is : 2
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports
--------------------------------------------------------------------------------
1 common UT:Eth0/0/2(D) Eth0/0/3(D) Eth0/0/4(D) Eth0/0/5(D)
Eth0/0/6(D) Eth0/0/7(D) Eth0/0/8(D) Eth0/0/9(D)
Eth0/0/10(D) Eth0/0/11(D) Eth0/0/12(D) Eth0/0/13(D)
Eth0/0/14(D) Eth0/0/15(D) Eth0/0/16(D) Eth0/0/17(D)
Eth0/0/18(D) Eth0/0/19(D) Eth0/0/20(D) Eth0/0/21(D)
Eth0/0/22(D) GE0/0/1(U) GE0/0/2(U)
10 common UT:Eth0/0/1(U)
TG:GE0/0/1(U) GE0/0/2(U)
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
1 enable default enable disable VLAN 0001
10 enable default enable disable Technical
[SW4]
查看各交换机 STP 状态信息,SW1、SW2 使用 display stp 命令查看 stp 模式是否正确, SW3、SW4 使用 display stp brief 命令查看备用端口是否处于 Discarding 状态。
[SW1]display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :0 .4c1f-cc23-1a63
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :0 .4c1f-cc23-1a63 / 0
CIST RegRoot/IRPC :0 .4c1f-cc23-1a63 / 0
CIST RootPortId :0.0
BPDU-Protection :Disabled
CIST Root Type :Primary root
TC or TCN received :161
TC count per hello :0
STP Converge Mode :Normal
Time since last TC :0 days 0h:0m:12s
Number of TC :86
Last TC occurred :GigabitEthernet0/0/2
----[Port1(GigabitEthernet0/0/1)][FORWARDING]----
Port Protocol :Enabled
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :0.4c1f-cc23-1a63 / 128.1
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :147 packets/hello-time
---- More ----
[SW2]display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :4096 .4c1f-ccd3-3e10
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :0 .4c1f-cc23-1a63 / 20000
CIST RegRoot/IRPC :4096 .4c1f-ccd3-3e10 / 0
CIST RootPortId :128.3
BPDU-Protection :Disabled
CIST Root Type :Secondary root
TC or TCN received :400
TC count per hello :0
STP Converge Mode :Normal
Time since last TC :0 days 0h:1m:18s
Number of TC :88
Last TC occurred :GigabitEthernet0/0/3
----[Port1(GigabitEthernet0/0/1)][FORWARDING]----
Port Protocol :Enabled
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=20000
Designated Bridge/Port :4096.4c1f-ccd3-3e10 / 128.1
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :147 packets/hello-time
---- More ----
[SW3]display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :32768.4c1f-cc13-6b1a
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :0 .4c1f-cc23-1a63 / 20000
CIST RegRoot/IRPC :32768.4c1f-cc13-6b1a / 0
CIST RootPortId :128.23
BPDU-Protection :Disabled
TC or TCN received :335
TC count per hello :0
STP Converge Mode :Normal
Time since last TC :0 days 0h:0m:25s
Number of TC :95
Last TC occurred :GigabitEthernet0/0/1
----[Port1(Ethernet0/0/1)][LEARNING]----
Port Protocol :Enabled
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=200000
Designated Bridge/Port :32768.4c1f-cc13-6b1a / 128.1
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :147 packets/hello-time
Protection Type :None
---- More ----
[SW4]display stp
-------[CIST Global Info][Mode STP]-------
CIST Bridge :32768.4c1f-ccd5-6d06
Config Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
Active Times :Hello 2s MaxAge 20s FwDly 15s MaxHop 20
CIST Root/ERPC :0 .4c1f-cc23-1a63 / 20000
CIST RegRoot/IRPC :32768.4c1f-ccd5-6d06 / 0
CIST RootPortId :128.23
BPDU-Protection :Disabled
TC or TCN received :665
TC count per hello :0
STP Converge Mode :Normal
Time since last TC :0 days 0h:0m:39s
Number of TC :90
Last TC occurred :GigabitEthernet0/0/1
----[Port1(Ethernet0/0/1)][FORWARDING]----
Port Protocol :Enabled
Port Role :Designated Port
Port Priority :128
Port Cost(Dot1T ) :Config=auto / Active=200000
Designated Bridge/Port :32768.4c1f-ccd5-6d06 / 128.1
Port Edged :Config=default / Active=disabled
Point-to-point :Config=auto / Active=true
Transit Limit :147 packets/hello-time
Protection Type :None
---- More ----
通过 Ping 命令,测试各部门内部通信息的情况。使用技术算机Ping 本部门的计算机:
图 4技术部PC1 ping 技术部PC2 测试图
图 5技术部PC2 ping 技术部PC1测试图
//SW1
system-view
sysname SW1
vlan 10
description Technical
quit
port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/3
port link-type trunk
port trunk allow-pass vlan 10
quit
stp enable
stp mode stp
stp priority 0
return
save
y
!
//SW2
system-view
sysname SW2
vlan 10
description Technical
quit
port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/3
port link-type trunk
port trunk allow-pass vlan 10
quit
stp enable
stp mode stp
stp priority 4096
return
save
y
!
//SW3
system-view
sysname SW3
vlan 10
description Technical
quit
interface Ethernet 0/0/1
port link-type access
port default vlan 10
port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
port link-type trunk
port trunk allow-pass vlan 10
quit
stp enable
stp mode stp
return
save
y
!
//SW4
system-view
sysname SW4
vlan 10
description Technical
quit
interface Ethernet 0/0/1
port link-type access
port default vlan 10
port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
port link-type trunk
port trunk allow-pass vlan 10
quit
stp enable
stp mode stp
return
save
y
!
网络技术是一个广阔而不断演化的领域,不断学习和不断更新知识是成功的关键。你已经迈出了第一步,学习并部署STP,这只是冰山一角。继续前进,探索更多的网络协议和技术,不断提高自己的技能
文章浏览阅读2.5w次,点赞6次,收藏50次。官方解释是,docker 容器是机器上的沙盒进程,它与主机上的所有其他进程隔离。所以容器只是操作系统中被隔离开来的一个进程,所谓的容器化,其实也只是对操作系统进行欺骗的一种语法糖。_docker菜鸟教程
文章浏览阅读5.7k次,点赞3次,收藏14次。该如何避免的,今天小编给大家推荐两个下载Windows系统官方软件的资源网站,可以杜绝软件捆绑等行为。该站提供了丰富的Windows官方技术资源,比较重要的有MSDN技术资源文档库、官方工具和资源、应用程序、开发人员工具(Visual Studio 、SQLServer等等)、系统镜像、设计人员工具等。总的来说,这两个都是非常优秀的Windows系统镜像资源站,提供了丰富的Windows系统镜像资源,并且保证了资源的纯净和安全性,有需要的朋友可以去了解一下。这个非常实用的资源网站的创建者是国内的一个网友。_msdn我告诉你
文章浏览阅读1.2k次。vue2封装对话框el-dialog组件_
文章浏览阅读4.7k次,点赞5次,收藏6次。MFC 文本框换行 标签: it mfc 文本框1.将Multiline属性设置为True2.换行是使用"\r\n" (宽字符串为L"\r\n")3.如果需要编辑并且按Enter键换行,还要将 Want Return 设置为 True4.如果需要垂直滚动条的话将Vertical Scroll属性设置为True,需要水平滚动条的话将Horizontal Scroll属性设_c++ mfc同一框内输入二行怎么换行
文章浏览阅读832次。检查Linux是否是否开启所需端口,默认为6379,若未打开,将其开启:以root用户执行iptables -I INPUT -p tcp --dport 6379 -j ACCEPT如果还是未能解决,修改redis.conf,修改主机地址:bind 192.168.85.**;然后使用该配置文件,重新启动Redis服务./redis-server redis.conf..._redis-server doesn't support auth command or ismisconfigured. try
文章浏览阅读4.9k次。济大数电实验报告_数据选择器及其应用
文章浏览阅读236次。1研究内容消费在生产中占据十分重要的地位,是生产的最终目的和动力,是保持省内经济稳定快速发展的核心要素。预测河南省社会消费品零售总额,是进行宏观经济调控和消费体制改变创新的基础,是河南省内人民对美好的全面和谐社会的追求的要求,保持河南省经济稳定和可持续发展具有重要意义。本文建立灰色预测模型,利用MATLAB软件,预测出2019年~2023年河南省社会消费品零售总额预测值分别为21881...._灰色预测模型用什么软件
文章浏览阅读1.2k次。12.4-在Qt中使用Log4Qt输出Log文件,看这一篇就足够了一、为啥要使用第三方Log库,而不用平台自带的Log库二、Log4j系列库的功能介绍与基本概念三、Log4Qt库的基本介绍四、将Log4qt组装成为一个单独模块五、使用配置文件的方式配置Log4Qt六、使用代码的方式配置Log4Qt七、在Qt工程中引入Log4Qt库模块的方法八、获取示例中的源代码一、为啥要使用第三方Log库,而不用平台自带的Log库首先要说明的是,在平时开发和调试中开发平台自带的“打印输出”已经足够了。但_log4qt
文章浏览阅读786次。全局观思维模型,一个教我们由点到线,由线到面,再由面到体,不断的放大格局去思考问题的思维模型。_计算机中对于全局观的
文章浏览阅读330次。一、CountDownLatch介绍CountDownLatch采用减法计算;是一个同步辅助工具类和CyclicBarrier类功能类似,允许一个或多个线程等待,直到在其他线程中执行的一组操作完成。二、CountDownLatch俩种应用场景: 场景一:所有线程在等待开始信号(startSignal.await()),主流程发出开始信号通知,既执行startSignal.countDown()方法后;所有线程才开始执行;每个线程执行完发出做完信号,既执行do..._countdownluach于cyclicbarrier的用法
文章浏览阅读508次。Prometheus 算是一个全能型选手,原生支持容器监控,当然监控传统应用也不是吃干饭的,所以就是容器和非容器他都支持,所有的监控系统都具备这个流程,_-自动化监控系统prometheus&grafana实战
文章浏览阅读4.7k次。输入关键字,可以通过键盘的搜索按钮完成搜索功能。_react search