VLAN与Trunk

VLAN入门

  • vlan的作用
  • 相同的广播域
    1、控制广播
    2、增加安全性
    3、提高带宽的利用率
    4、降低数据延迟

VLAN理论上可以划分4096个,普通市面上的交换机一般可以划分1000+个

  • 取消烦人的提示
    <Huawei>undo terminal monitor
  • 查看vlan
    <Huawei>display vlan
  • 创建vlan并将接口加入
[Huawei]vlan batch 2 3			//创建VLAN2、3
[Huawei]interface Ethernet0/0/3    //进入3口
[Huawei-Ethernet0/0/3] port link-type access  //将3口设置为access模式,即将加入某vlan(为某一vlan服务)
[Huawei-Ethernet0/0/3] port default vlan 2  //将3口加入vlan2	
		
[Huawei]port-group 1    //创建1号接口组
[Huawei-port-group-1]group-member Ethernet0/0/5 Ethernet0/0/6    //添加成员 5口和6口
[Huawei-port-group-1]port link-type access 
[Huawei-port-group-1]port default vlan 3	//将此组中所有接口加入vlan3
[Huawei]undo vlan 4   //如果创建vlan错误,可以使用undo删除

两台交换机下主机相连接需要将对应接口加入同一vlan

中继链路

为了解决一个接口同时传输多个vlan信息
access(接入链路)承载1个vlan
trunk (中继链路)可以承载多个vlan

  • 配置trunk
<sw1>sys
Enter system view, return user view with Ctrl+Z.
[sw1]int e0/0/10
[sw1-Ethernet0/0/10]port link-type trunk 
[sw1-Ethernet0/0/10]port trunk allow-pass vlan all
[sw1-Ethernet0/0/10]
  • 清除接口默认配置
[Huawei]clear configuration interface Ethernet 0/0/7
Warning: All configurations of the interface will be cleared, and its state will
 be shutdown. Continue? [Y/N] :y
Info: Total execute 2 command(s), 2 successful, 0 failed.
[Huawei-Ethernet0/0/7]display this 
#
interface Ethernet0/0/7
 shutdown
#
return
[Huawei-Ethernet0/0/7]undo shutdown 
[Huawei-Ethernet0/0/7]display this
#
interface Ethernet0/0/7
#
return
[Huawei-Ethernet0/0/7]

  • 链路聚合的配置
    配置链路聚合,增加网络可靠,提高带宽**
[Huawei]interface Eth-trunk 1   //进入(创建) 1号聚合接口
[Huawei- Eth-trunk1]trunkport ethernet 0/0/1  0/0/2   //添加2个需要捆绑在一起的接口
[Huawei- Eth-trunk1]port link-type trunk   //将1号聚合接口配置为trunk
[Huawei- Eth-trunk1]port trunk allow-pass vlan all   //允许1号聚合接口传递所有vlan的数据
posted @ 2021-12-03 11:12  菜鸟成长历程  阅读(839)  评论(0编辑  收藏  举报