基于 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,这只是冰山一角。继续前进,探索更多的网络协议和技术,不断提高自己的技能
文章浏览阅读833次,点赞26次,收藏26次。javascript是前端必要掌握的真正算得上是编程语言的语言,学会灵活运用javascript,将对以后学习工作有非常大的帮助。掌握它最重要的首先是学习好基础知识,而后通过不断的实战来提升我们的编程技巧和逻辑思维。这一块学习是持续的,直到我们真正掌握它并且能够灵活运用它。如果最开始学习一两遍之后,发现暂时没有提升的空间,我们可以暂时放一放。继续下面的学习,javascript贯穿我们前端工作中,在之后的学习实现里也会遇到和锻炼到。真正学习起来并不难理解,关键是灵活运用。
文章浏览阅读1k次。idea怎么设置eclipse快捷键_idea修改快捷键为eclipse
文章浏览阅读4.7k次。◎欧洲各地经纬度简表国家 城市 经度 纬度 时区 罗马尼亚 布加勒斯特 东经26:06 北纬44:26 +2保加利亚 索非亚 东经23:19 北纬42:41 +2希腊 雅典 东经23:43 北纬37:58 +2希腊 斯巴达 东经22:25 北纬37:05 +2马其顿 斯科普里 东经21:28 北纬42:00 +2波兰 华沙 东经21:00 北纬52:15 +1南斯拉夫 贝尔格莱德 东经20:30 ..._全球城市经纬度
文章浏览阅读294次。题目链接:题目大意:询问一个区间的第k大 但是有操作会对某个位置的值进行改变 即动态第k大思路:树状数组套主席树普通主席树装未修改的数据树状数组套主席树装的是修改的数据,即修改操作在树状数组中进行#include #include #include #include #include #include #include #include #include _动态第k大 树状数组套平衡树
文章浏览阅读82次。不知道你为什么要使用PL / sql块.您没有使用您声明的ID,最好给它一个与列名称不同的名称以避免混淆.您可以在sql * Plus中声明一个绑定变量,然后选择:var l_test_quote varchar2(80); -- or whatever type/size you needvar l_test_id varchar2(80);declarel_id varchar2(80) :=..._"oracle:sp2-0552: 未声明绑定变量 \"empid\"。"
文章浏览阅读4.3k次,点赞2次,收藏9次。在这里和大家分享一下关于达梦与oracle之间进行数据迁移的注意事项:达梦数据库与oracle的兼容性是很高的,所以这两类数据库之间进行迁移 还是很方便的。首先,初始化实例的时候,将空格填充模式参数设置为零(BLANK_PAD_MODE=0),oracle兼容性参数 (COMPATIBLE_MODE=2)打开。需要注意的是,空格填充模式参数是初始化参数,只能在初始化实例的时候进行设置,这两个参..._oracle迁移达梦方便吗
文章浏览阅读1.4w次。LSF系统介绍http://scc.ustc.edu.cn/zh_CN/ 中科大超算中心http://www.sccas.cn/gb/index.html 中科院超算中心http://www.ssc.net.cn/ 上涨超算中心LSF简介LSF(Load Sharing Facility)是分布资源管理的工具,用来调度、监视、分析联网计算机的负载。目的通过集中监控和调度,充分共享计算机的CPU_lsf分组
文章浏览阅读5.1k次。/ 今日科技快讯 /近日,字节跳动回应:由美国CFIUS调查及“总统令”引发对TikTok的大量关注与报道,其中有很多猜测和不实信息。真实情况是, 我们确实在与一些公司探讨合作方..._鸿蒙的开发
文章浏览阅读9.9k次,点赞5次,收藏45次。1.如何利用句柄操作windows窗体首先,获得窗体的句柄 win32api.FindWindows()第二,获得窗体中控件的id号,spy++第三,根据控件的ID获得控件的句柄(hwnd) GetDlgItem(hwnd,loginID)最后,利用控件句柄进行操作python可以通过win32api轻松获取控件的属性值通过标签找到主窗口句柄,然后通过主句柄获取下属控件句柄#-*- codin..._python 获取窗口句柄 模拟 点击按钮
文章浏览阅读2.4k次。一、背景说明 单机执行pyspark(python on spark)非常简单,只要在脚本所在服务器上部署个python环境或Anaconda这种集成运行环境,再通过python3命令执行就完了。 而想将python提交到spark集群中运行,则有两种方法,一种是在每个spark结点上部署python环境,在spark低版本与python集成没那么完善的时候,集群结点数又不多的情况下,的确可以这么干(实际上我就这么干过),这种方式比较大的优势是每次执行pyspark任务时,不用分发python环_spark.yarn.appmasterenv.pyspark_python
文章浏览阅读1.5k次,点赞15次,收藏11次。搞过POI的都知道,在处理Excel文件时,POI提供了两种模式:用户模式和SAX事件驱动模式。用户模式API丰富使用起来相对简单,但当遇到大文件、大量数据或复杂格式时,可能会导致内存溢出。因此,官方推荐使用SAX事件驱动模式来解析大型Excel文件。开始想解决方法之前,我们要先知道 Excel2003与Excel2007 的区别。_android 读取超大excel文件
文章浏览阅读1w次。先闲谈说下最近的微信要出的小程序吧,感觉确实很牛逼,革命说不上吧但是也是一个新的大的机遇。不得不承认腾讯有两个相当好的平台,一个是QQ,一个是微信,毕竟人数基数大,任何新的东西都会带来相当多的机会和挑战。那个小程序好像是基于react native,也是一种混合架构。最近整理整理下混合架构的知识,有时间也好好学习去。 好了开始正题吧。 最近研究cordova通过原生_cordova 连拍