交換機自動學習vlan
阿新 • • 發佈:2018-05-07
交換機自動學習vlan
如圖所示:LSW1創建靜態vlan 10,SW2和SW3沒有配置vlan,通過配置gvrp和trunk,讓SW2、SW3自動學習vlan
LSW1
<Huawei>undo terminal mon
<Huawei>undo terminal monitor #關閉提示信息
Info: Current terminal monitor is off.
[Huawei]vlan 10 #創建vlan 10
[Huawei-vlan10]q #推出vlan 10
[Huawei]gvrp #開啟gvrp功能
[Huawei]int g0/0/1 #進入端口
[Huawei-GigabitEthernet0/0/1]port link-type trunk #將端口設置為trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all #允許所有vlan進入此端口
[Huawei-GigabitEthernet0/0/1]gvrp #在該端口開啟gvrp功能
LSW2
<Huawei>undo terminal monitor #關閉提示信息
Info: Current terminal monitor is off.
<Huawei>sys #進入系統視圖
Enter system view, return user view with Ctrl+Z.
[Huawei]gvrp #開啟gvrp
[Huawei]int g0/0/2 #進入端口
[Huawei-GigabitEthernet0/0/2]port link-type trunk #將端口設置為trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all #允許所有端口進入
LSW3
<Huawei>undo terminal monitor #關閉提示信息
Info: Current terminal monitor is off.
<Huawei>sys #進入系統視圖
Enter system view, user view with Ctrl+Z.
[Huawei]gvrp #開啟gvrp
[Huawei]int g0/0/1 #進入端口
[Huawei-GigabitEthernet0/0/1]port link-type trunk #將端口設置為trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all #允許所有端口進入
[Huawei-GigabitEthernet0/0/1]gvrp #開啟gvrp
[Huawei-GigabitEthernet0/0/1]q #退出端口視圖
最後在LSW2和LSW3的命令行輸入: [Huawei]display vlan 來驗證
註:自動學習到的vlan是動態vlan,不能在動態vlan上直接加入端口,需要將其改為靜態vlan即可
如圖所示:LSW1創建靜態vlan 10,SW2和SW3沒有配置vlan,通過配置gvrp和trunk,讓SW2、SW3自動學習vlan
LSW1
<Huawei>undo terminal mon
<Huawei>undo terminal monitor #關閉提示信息
Info: Current terminal monitor is off.
[Huawei]vlan 10 #創建vlan 10
[Huawei-vlan10]q #推出vlan 10
[Huawei]gvrp #開啟gvrp功能
[Huawei]int g0/0/1 #進入端口
[Huawei-GigabitEthernet0/0/1]port link-type trunk #將端口設置為trunk
[Huawei-GigabitEthernet0/0/1]gvrp #在該端口開啟gvrp功能
LSW2
<Huawei>undo terminal monitor #關閉提示信息
Info: Current terminal monitor is off.
<Huawei>sys #進入系統視圖
Enter system view, return user view with Ctrl+Z.
[Huawei]gvrp #開啟gvrp
[Huawei-GigabitEthernet0/0/2]port link-type trunk #將端口設置為trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all #允許所有端口進入
LSW3
<Huawei>undo terminal monitor #關閉提示信息
Info: Current terminal monitor is off.
<Huawei>sys #進入系統視圖
Enter system view, user view with Ctrl+Z.
[Huawei]int g0/0/1 #進入端口
[Huawei-GigabitEthernet0/0/1]port link-type trunk #將端口設置為trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all #允許所有端口進入
[Huawei-GigabitEthernet0/0/1]gvrp #開啟gvrp
[Huawei-GigabitEthernet0/0/1]q #退出端口視圖
最後在LSW2和LSW3的命令行輸入: [Huawei]display vlan 來驗證
註:自動學習到的vlan是動態vlan,不能在動態vlan上直接加入端口,需要將其改為靜態vlan即可
交換機自動學習vlan