news 2026/6/25 16:24:27

二层综合vlan实验

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
二层综合vlan实验

配置LSW1交换机

[sw1]stp enable

[sw1]stp mode mstp

[sw1]stp region-configuration

[sw1-mst-region]region-name aa

[sw1-mst-region]instance 1 vlan 2

[sw1-mst-region]instance 2 vlan 3

[sw1-mst-region]active region-configuration

[sw1-mst-region]q

[sw1]stp instance 1 root primary

[sw1]stp instance 2 root secondary

[sw1]interface Vlanif 2

[sw1-Vlanif2]ip address 172.16.0.1 26

[sw1-Vlanif2]vrrp vrid 1 virtual-ip 172.16.0.62

[sw1-Vlanif2]vrrp vrid 1 priority 120

[sw1-Vlanif2]vrrp vrid 1 track interface GigabitEthernet 0/0/5 reduced 30

[sw1-Vlanif2]q

[sw1]interface Vlanif 3

[sw1-Vlanif3]ip address 172.16.0.65 26

[sw1-Vlanif3]vrrp vrid 2 virtual-ip 172.16.0.126

[sw1-Vlanif3]q

[sw1]dhcp enable

[sw1]ip pool aa

[sw1-ip-pool-aa]network 172.16.0.0 mask 26

[sw1-ip-pool-aa]gateway-list 172.16.0.62

[sw1-ip-pool-aa]dns-list 8.8.8.8

[sw1-ip-pool-aa]q

[sw1]ip pool bb

[sw1-ip-pool-bb]network 172.16.0.64 mask 2

[sw1-ip-pool-bb]gateway-list 172.16.0.126

[sw1-ip-pool-bb]dns-list 8.8.8.8

[sw1-ip-pool-bb]q

[sw1]interface Vlanif 2

[sw1-Vlanif2]dhcp select global

[sw1-Vlanif2]q

[sw1]interface Vlanif 3

[sw1-Vlanif3]dhcp select global

[sw1-Vlanif3]q

[sw1]interface Vlanif 10

[sw1-Vlanif10]ip address 172.16.0.129 26

[sw1-Vlanif10]q

[sw1]ip route-static 0.0.0.0 0 172.16.0.130

配置LSW2交换机

[sw2]dhcp enable

[sw2]ip pool aa

[sw2-ip-pool-aa] gateway-list 172.16.0.62

[sw2-ip-pool-aa] network 172.16.0.0 mask 255.255.255.192

[sw2-ip-pool-aa] dns-list 8.8.8.8

[sw2-ip-pool-aa]q

[sw2]ip pool bb Info:It's successful to create an IP address pool.

[sw2-ip-pool-bb] gateway-list 172.16.0.126

[sw2-ip-pool-bb] network 172.16.0.64 mask 255.255.255.192

[sw2-ip-pool-bb] dns-list 8.8.8.8

[sw2-ip-pool-bb]q

[sw2]interface Vlanif 2

[sw2-Vlanif2]dhcp select global

[sw2-Vlanif2]q

[sw2]interface Vlanif 3

[sw2-Vlanif3]dhcp select global

[sw2-Vlanif3]q

[sw2]interface Vlanif 20

[sw2-Vlanif20]ip address 172.16.0.193 26

[sw2-Vlanif20]q

[sw2]ip route-static 0.0.0.0 0 172.16.0.194

配置LSW3交换机

[sw3]stp enable

[sw3]stp mode mstp

[sw3]stp region-configuration

[sw3-mst-region] region-name aa

[sw3-mst-region] instance 1 vlan 2

[sw3-mst-region] instance 2 vlan 3

[sw3-mst-region] active region-configuration

[sw3-mst-region]q

[sw3]port-group group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/4

[sw3-port-group]stp edged-port enable

[sw3-GigabitEthernet0/0/3]stp edged-port enable

[sw3-GigabitEthernet0/0/4]stp edged-port enable

[sw3-port-group]q

[sw3]stp bpdu-protection

配置LSW4交换机

[sw4]stp enable

[sw4]stp mode mstp

[sw4]stp region-configuration

[sw4-mst-region] region-name aa

[sw4-mst-region] instance 1 vlan 2

[sw4-mst-region] instance 2 vlan 3

[sw4-mst-region] active region-configuration

[sw4-mst-region]q

[sw4]port-group group-member GigabitEthernet 0/0/3 to g0/0/4

[sw4-port-group]stp edged-port enable

[sw4-GigabitEthernet0/0/3]stp edged-port enable

[sw4-GigabitEthernet0/0/4]stp edged-port enable

[sw4-port-group]q

[sw4]stp bpdu-protection

配置AR1路由器

[ar1]interface GigabitEthernet 0/0/1

[ar1-GigabitEthernet0/0/1]q

[ar1]interface GigabitEthernet 0/0/0

[ar1-GigabitEthernet0/0/0]ip address 172.16.0.130 26

[ar1-GigabitEthernet0/0/0]q

[ar1]interface GigabitEthernet 0/0/1

[ar1-GigabitEthernet0/0/1]ip address 172.16.0.194 26

[ar1-GigabitEthernet0/0/1]int g 0/0/2

[ar1-GigabitEthernet0/0/2]ip address 12.0.0.1 24

[ar1-GigabitEthernet0/0/2]q

[ar1]ip route-static 172.16.0.0 26 172.16.0.129

[ar1]ip route-static 172.16.0.0 26 172.16.0.19

[ar1]ip route-static 172.16.0.64 26 172.16.0.129

[ar1]ip route-static 172.16.0.64 26 172.16.0.193

[ar1]ip route-static 0.0.0.0 0 12.0.0.2

[ar1]acl 2000

[ar1-acl-basic-2000]rule permit source 172.16.0.0 0.0.0.255

[ar1-acl-basic-2000] q

[ar1]interface GigabitEthernet 0/0/2

[ar1-GigabitEthernet0/0/2]nat outbound 2000

配置ISP

[isp]interface GigabitEthernet 0/0/0

[isp-GigabitEthernet0/0/0]ip address 12.0.0.2 24

[isp-GigabitEthernet0/0/0]int l 10

[isp-LoopBack10]ip address 2.2.2.2 24

[isp-LoopBack10]q

主机

pc1

pc2

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/25 16:24:09

2026年口碑最好的皮带模组企业,你选对了吗?

在工业自动化领域,皮带模组凭借其高速、轻载、低成本的特性,已成为3C电子、包装、医疗、食品等行业生产线上的“标配”。然而,随着2026年市场竞争加剧,用户对皮带模组的要求早已从“能用”升级为“好用、耐用、省心”。选错品牌&a…

作者头像 李华
网站建设 2026/6/25 16:23:24

AI Agent 中的向量数据库:深入解析与实战指南

AI Agent 中的向量数据库:深入解析与实战指南 1. 为什么 AI Agent 需要向量数据库? 要理解向量数据库在 AI Agent 中的角色,先看一个核心困境:大语言模型(LLM)本质上是一个“静态大脑”——它的知识截止于训…

作者头像 李华
网站建设 2026/6/25 16:19:10

贝锐如何赋能餐饮连锁行业?门店“网络+运维”闭环如何构建?

如今的连锁餐饮品牌,动辄在全国布局几百上千家门店。生意越做越大,但总部的管理和IT运维却面临不少挑战:几百家店的现场秩序怎么管?监控视频异地如何调取?各地门店的收银机、点餐屏、叫号机宕机了,难道让IT…

作者头像 李华
网站建设 2026/6/25 16:17:17

CodeWarrior IDE开发DSP56800E实战:从环境搭建到电机控制调试

1. 项目概述:为什么选择CodeWarrior IDE开发DSP56800E?如果你正在或即将使用飞思卡尔(Freescale,现为NXP的一部分)的DSP56800E系列数字信号控制器(DSC),比如MC56F8013、MC56F8357或者…

作者头像 李华
网站建设 2026/6/25 16:16:26

AI+复合材料/CFD 机器学习+水泥基复合材料+岩土工程

导语当前,PINN、数据驱动仿真、多尺度 AI 建模已成为流体力学、复合材料、土木工程领域顶刊发文、课题立项的核心热点方向。传统数值仿真与人工数据分析方式,不仅在湍流、多相流、复合材料力学行为等复杂问题上算力成本居高不下,还存在模型可…

作者头像 李华
网站建设 2026/6/25 16:15:20

福州大宅装修必看:全屋定制与整木定制的品牌选择逻辑

福州的大平层、别墅装修里,木作绝对是决定整体质感的核心。很多业主在选品牌时会陷入误区:要么盲目冲图森、木里木外等一线高定,要么贪便宜选了小厂家,最后落地效果一塌糊涂。其实大宅的全屋定制和整木定制,选品牌有清…

作者头像 李华