基于 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.1k次。 需求如下:该搜索框是对整个页面的input检索 ,但与弹出层中的input冲突 博主几经辗转 简单处理 解决问题,思路如下:排除掉特定class的input。代码如下:$('input:not(.pop)', this.footer()).on('keyup change', function () { if (that.search() !== th..._input排他选择器
文章浏览阅读5.6k次,点赞6次,收藏20次。看到别人有个1024的勋章,特意留了一篇在今年的10.24日,看看会不会获得。在日常开发中可能涉及接口之间的相互调用,虽然在现在微服务的理念推广下,很多公司都采用轻量级的JSON格式做为序列化的格式,但是不乏有些公司还是有一些XML格式的报文,最近就在对接某个合作方的时候遇到了XML报文。在JSON报文爽快的转换下很难试用一个一个的拿报文参数,还是希望能直接将报文转换成Bean。接下来就了解到..._jaxb 泛型
文章浏览阅读1.2k次。numpy的主要数据对象是多维数组,其中包含相同类型的元素,通常是数字类型,每个元素都有一个索引。使用numpy前通常要导入包。import numpy as np目录类型维度创建运算索引和切片类型numpy的数组被称为ndarray。numpy.array只处理一维数组,而ndarray对象才提供更多功能。a = np.array([[1, 2, 3], [4, 5, 6]])type(a) # <class 'numpy.ndarray'>dtype属性可以获得元素的数_ndarray的位置
文章浏览阅读1.6w次。还在苦于网上找到的一些指令已经不适用了吗?还在苦于有些地方的指令有误吗?还在苦于有些地方整理的指令不够全面吗?那么你来对地方了!小编为大家整理了《我的世界》原版游戏常用的指令,这些基本足以满足各位的基本需求了!大家来一起看看吧!注:表示的是必须输入的部分,[方括号]表示的是可选择性输入的部分基本命令列表命令描述/?/help的替代命令,提供命令使用帮助。/ban + 玩家名字将玩家加入封禁列表。/..._gamemode指令java
文章浏览阅读1.5w次,点赞3次,收藏3次。Spring Boot 结合shiro做第三方登录验证1、首先,说一下我的具体实现思路。在做spring boot拦截器的过程中,开始我准备用spring security来实现,但是研究了一段时间之后发现spring security的集成度太高,需要修改的东西比较多,而且对它本身的使用方法不是很了解,后来转而使用Apache shiro。由于是第三方登录,是不需要我来验证密码的。最开始,我陷入了_shiro 第三方token登录
文章浏览阅读1.9k次,点赞4次,收藏4次。[INFO ] __init__:get_config:71 - Loading config file from:C:\Users\xxx\.labelmercTraceback (most recent call last): File .... line 191, in <module> main() File ...., line 145, in main config = get_config(config_file_or_yaml, config_fro_file "c:\rgzn\labelme-main\setup.py", line 91, in main if sys.argv[1] == "re
文章浏览阅读8.7k次。代码错误的原因和调试方法_代码报错
文章浏览阅读5.2k次,点赞9次,收藏40次。---恢复内容开始---1.认识游戏 1.1什么是游戏 1.1.1游戏的定义 任何人类正常生理需求之外的活动均可称为游戏 1.1.2游戏的分类 RPG角色扮演游戏、ACT动作游戏、AVG冒险游戏、FPS第一人称视角射击游戏、TPS第三人称视角射击游戏、FTG格斗游戏、SPT体育游戏、RAC竞速游戏、RTS即时战略游戏、STG..._深度解析java游戏服务器开发
文章浏览阅读4k次。CSRF是什么我就不解释了,百度一搜全是,比波姐的片源还要多,千篇一律都他么是复制粘贴。那为什么这个令牌(token)操作可以防范CSRF呢?下面我就随便说说说错了大家不要介意。首先我们要知道令牌是存储在session里面的,这个很重要 php代码如下<?php namespace app\index\controller; //我直接允许跨域,因为伪装..._tp5 开启csrf令牌
文章浏览阅读1.7k次,点赞2次,收藏6次。市盈率PE市盈率 = 市值/净利润概念解析:买入一家公司,几年回本,年化收益率:净利润/市值(市盈率的倒数)举例:砖头10万买个砖头,每年拍人带来1万利润,需要10年回本市盈率:10/1 = 10年化收益率:1/10 = 10%市净率PB市净率 = 市值/净资产净资产 = 总资产 - 负债举例:张三便利店,净资产:120万市值:1..._净资产收益率和股息率
文章浏览阅读737次。教育部昨举行「102年国立馆所文创商品设计比赛」颁奖典礼,台北科技大学创新设计研究所硕士生谢镇宇,为TW艺术教育馆设计「墨器」杯垫,取「默契」谐音,用5片压克力板,展现水墨画层层渲染效果,增加立体视觉感受,并在杯架后方加入LED光源,获评审肯定夺特优奖和奖金10万元。台南应用科技大学商品设计系学生高郁翔,为国立自然科学博物馆设计「恐龙化石钉书机」,他认为小朋友把钉书机钉下去的那一刻,会觉得像暴龙準_杯垫文创设计说明
文章浏览阅读404次。XML与对象,集合的相互转化 今天小伙伴在群里问了一下关于XML与对象之间的相互转换,作为菜鸟的我正好趁着闲着的时间学习了一波,直接上代码了,有疑问或者有错误的地方还请大家指正,谢谢。。。。 1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System...._c# xml转集合