1. 程式人生 > >NETWORK筆記10:VLAN之間通訊

NETWORK筆記10:VLAN之間通訊

實驗名稱:VLAN之間通訊(華為)


實驗拓撲:

image.png

實驗步驟: 1.改主機名

                  2.建立VLAN 新增描述

  3.配置VLAN 新增IP

  4.配置埠 模式 加入VLAN

  5.PC配置IP 子網掩碼 閘道器

  6.驗證:display vlan

               display prt vlan

  7.測試:PC ping

  8.儲存save


實驗總結:VLan10 20 30互通(華為三層裝置預設開啟路由功能)


實驗命令:

[Huawei]sysname HuaweiSwitch

[HuaweiSwitch]vlan batch 10 20 30       #批量建立VLAN 10 20 30

[HuaweiSwitch]interface vlan 10        #介面 Vlan10

[HuaweiSwitch-Vlanif10]undo shutdown        #啟用(預設是啟用狀態,為了培養習慣)

[HuaweiSwitch-Vlanif10]description vlan--10        #新增描述

[HuaweiSwitch-Vlanif10]ip address 192.168.10.254 255.255.255.0       #VLAN10 的閘道器

[HuaweiSwitch-Vlanif10]quit

[HuaweiSwitch]interface vlan 20

[HuaweiSwitch-Vlanif20]undo shutdown

[HuaweiSwitch-Vlanif20]description vlan--20

[HuaweiSwitch-Vlanif20]ip address 192.168.20.254 255.255.255.0

[HuaweiSwitch-Vlanif20]quit

[HuaweiSwitch]interface vlan 30

[HuaweiSwitch-Vlanif30]undo shutdown

[HuaweiSwitch-Vlanif30]description vlan--30

[HuaweiSwitch-Vlanif30]ip address 192.168.30.254 255.255.255.0


[HuaweiSwitch]interface GigabitEthernet 0/0/1

[HuaweiSwitch-GigabitEthernet0/0/1]undo shutdown

[HuaweiSwitch-GigabitEthernet0/0/1]port link-type access        #埠 鏈路 型別 access

[HuaweiSwitch-GigabitEthernet0/0/1]port default vlan 10        #埠 預設 vlan10


[HuaweiSwitch]interface GigabitEthernet 0/0/2

[HuaweiSwitch-GigabitEthernet0/0/2]undo shutdown

[HuaweiSwitch-GigabitEthernet0/0/2]port link-type access

[HuaweiSwitch-GigabitEthernet0/0/2]port default vlan 20


[HuaweiSwitch]interface GigabitEthernet 0/0/3

[HuaweiSwitch-GigabitEthernet0/0/3]undo shutdown

[HuaweiSwitch-GigabitEthernet0/0/3]port link-type access

[HuaweiSwitch-GigabitEthernet0/0/3]port default vlan 30


[HuaweiSwitch]display vlan

[HuaweiSwitch]display  port vlan


PC1:192.168.10.1 255.255.255.0 192.168.10.254 Vlan10

PC2:192.168.20.1 255.255.255.0 192.168.20.254 Vlan20

PC3:192.168.30.1 255.255.255.0 192.168.30.254 Vlan30


<HuaweiSwitch>save