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的數據


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM