二层交换机VLAN基础配置

本文档详细介绍了如何在二层交换机上进行VLAN基础配置,包括使用access接口,配置拓扑,以及通过hybrid接口实现不同VLAN间通信的测试,以华为交换机为例进行操作演示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用access接口 

拓扑图:

LSW1:

<Huawei>system-view     //进入系统视图
[Huawei]sysname LSW1    //修改设备名称
[LSW1]vlan batch 10 20    //创建VLAN10 20
[LSW1]int g0/0/2    //进入端口
[LSW1-GigabitEthernet0/0/2]port link-type access    //设置access接口
[LSW1-GigabitEthernet0/0/2]port default vlan 10    //设置默认vlan为10
[LSW1-GigabitEthernet0/0/2]dis this    //查看当前的配置
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 10
#
return
[LSW1-GigabitEthernet0/0/2]
[LSW1]int g0/0/3
[LSW1-GigabitEthernet0/0/3]port link-type access 
[LSW1-GigabitEthernet0/0/3]port default vlan 20
[LSW1-GigabitEthernet0/0/3]dis vlan    //查看vlan
[LSW1-GigabitEthernet0/0/3]quit 
<LSW1>save     //保存
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y    //Y
Now saving the current configuration to the slot 0.
May 27 2022 15:14:07-08:00 LSW1 %%01CFM/4/SAVE(l)[1]:The user chose Y when decid
ing whether to save the configuration to the device.
Save the configuration successfully.

[LSW1]int g0/0/1
[LSW1-GigabitEthernet0/0/1]port link-type trunk 
[LSW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10    //允许vlan10通过
[LSW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 20    //允许vlan20通过
<LSW1>save

LSW2:

<Huawei>system-view     //进入系统视图
[Huawei]sysname LSW2    //修改设备名称
[LSW2]vlan batch 10 20    //创建VLAN10 20
[LSW2]int g0/
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值