组网配置案例

 汇聚层与接入层或者汇聚层与核心层组网

组网配置案例_第1张图片

案例:

组网配置案例_第2张图片

port-group技术:可实现对于所有组内接口进行相同配置

[ACC-1]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/9
[ACC-1-port-group]port link-type access
[ACC-1-port-group]port default vlan 2

[ACC-1]port-group group-member GigabitEthernet 0/0/10 to GigabitEthernet 0/0/19
[ACC-1-port-group]port link-type access
[ACC-1-port-group]port default vlan 3

上行接口配置:

interface GigabitEthernet0/0/23
 port link-type trunk
 undo port trunk allow-pass vlan 1  #防止vlan1出环
 port trunk allow-pass vlan 2 to 3
#
interface GigabitEthernet0/0/24
 port link-type trunk
 undo port trunk allow-pass vlan 1  #防止vlan1出环
 port trunk allow-pass vlan 2 to 3

对于未规划用途并长期不使用接口进行关闭处理:

[ACC-1]port-group group-member g0/0/20 to g0/0/22
[ACC-1-port-group]shutdown 

设备命名规则:

[AGG-1]sysname BG-AGG-Master-S5728C #办公区-汇聚层-主设备-型号
[BG-AGG-Master-S5728C]

添加接口描述:

[ACC-1]interface GigabitEthernet 0/0/23	
[ACC-1-GigabitEthernet0/0/23]description to_BG-AGG-Master-S5728C_G0/0/23
[ACC-1-GigabitEthernet0/0/23]display this
#
interface GigabitEthernet0/0/23
 description to_BG-AGG-Master-S5728C_G0/0/23 #该接口连接了哪个口
 port link-type trunk
 undo port trunk allow-pass vlan 1
 port trunk allow-pass vlan 2 to 3
#
return

二层聚合通道:

[BG-AGG-Master-S5728C]interface Eth-Trunk 1
[BG-AGG-Master-S5728C-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 
[BG-AGG-Master-S5728C-Eth-Trunk1]trunkport GigabitEthernet 0/0/2

组网配置案例_第3张图片

[BG-AGG-BackUp-S5728C]interface Eth-Trunk 1
[BG-AGG-BackUp-S5728C-Eth-Trunk1]trunkport GigabitEthernet 0/0/1
[BG-AGG-BackUp-S5728C-Eth-Trunk1]trunkport GigabitEthernet 0/0/2

组网配置案例_第4张图片

配置二层聚合通道

[BG-AGG-Master-S5728C-Eth-Trunk1]display this
#
interface Eth-Trunk1
 port link-type trunk
 undo port trunk allow-pass vlan 1
 port trunk allow-pass vlan 2 to 3
#
return
[BG-AGG-BackUp-S5728C-Eth-Trunk1]display this
#
interface Eth-Trunk1
 port link-type trunk
 undo port trunk allow-pass vlan 1
 port trunk allow-pass vlan 2 to 3
#
return

配置生成树

[BG-AGG-Master-S5728C-mst-region]display this
#
stp region-configuration
 region-name BG
 instance 1 vlan 2 to 3
 active region-configuration
#
return
[BG-AGG-BackUp-S5728C-mst-region]display this
#
stp region-configuration
 region-name BG
 instance 1 vlan 2 to 3
 active region-configuration
#
return

[ACC-1-mst-region]display this
#
stp region-configuration
 region-name BG
 instance 1 vlan 2 to 3
 active region-configuration
#
return

生成树设置主根网桥和备份根网桥

[BG-AGG-Master-S5728C]stp instance 1 root primary 
[BG-AGG-BackUp-S5728C]stp instance 1 root secondary 

接入层交换机接口配置边缘接口

[ACC-1-port-group]stp edged-port enable

生成树保护技术

BPDU保护、root保护、TC保护、环路保护、共享线路保护

BPDU保护:接入层接口一般是连接终端的设备,我们会在接入层交换机的接口上配置stp edged-port enable 这个命令来开启边缘接口,这个命令配置后,配置该命令的接口收敛时间为0,让该接口丧失检测环路的能力,本质是让该接口不加入生成树的收敛。

如图所示接入层交换机的1-9接口都配置了边缘接口的命令,也就是说这些接口都不加入生成树的收敛,但是当这些接口连接了交换机并产生了环路,则会对接入层交换机造成非常大的影响,使用BPDU保护来隔绝这种风险,开启BPDU保护后,当接入层交换机收到边缘接口传来的BPDU时,会断开该接口的连接。  

[ACC-1]stp bpdu-protection
[ACC-1]
Jun  1 2023 17:16:33-08:00 ACC-1 %%01MSTP/4/BPDU_PROTECTION(l)[7]:This edged-por
t GigabitEthernet0/0/2 that enabled BPDU-Protection will be shutdown, because it
 received BPDU packet!
Jun  1 2023 17:16:33-08:00 ACC-1 %%01PHY/1/PHY(l)[8]:    GigabitEthernet0/0/2: c
hange status to down

组网配置案例_第5张图片

组网配置案例_第6张图片

TC保护,当线路不稳定的时候可以用,比如说一会松一会紧引起的震荡,但如果真的是拓扑变更触发TC保护则会对网络维护延迟这是不好的,所以建议用第一种方法。 

建议所有接终端的接口都做边缘接口stp edged-port

你可能感兴趣的:(HCIP实验,网络)