基本命令+查看端口所属vlan

//视图切换命令

system-view

[Huawei]

//交换机修改名字

system-view

[Huawei]sysname R1

[R1]

//保存命令  思科貌似是write

save

  The current configuration will be written to the device.

  Are you sure to continue? (y/n)[n]:y

  It will take several minutes to save configuration file, please wait........

  Configuration file had been saved successfully

  Note: The configuration file will take effect after being activated

//创建VLAN,并配置VLAN ip地址,开启vlan

[Huawei]vlan 5

[Huawei]interface Vlanif 5

[Huawei-Vlanif5]ip address 10.10.1.1 24

[Huawei-Vlanif5]undo shutdown

Info: Interface Vlanif5 is not shutdown.

//配置端口类型,所属vlan.

[Huawei]interface Ethernet 0/0/0

[Huawei-Ethernet0/0/0]port link-type access

[Huawei-Ethernet0/0/0]port default vlan 5

//描述接口信息

[R1]interface Ethernet 0/0/0

[R1-Ethernet0/0/0]description link-to-pc1

//查看当前接口配置命令

[R1-Ethernet0/0/0]display this

[V200R003C00]

#

interface Ethernet0/0/0

description link-to-pc1

port link-type access

port default vlan 5

#

return

//查看端口状态

display ip interface brief

*down: administratively down

^down: standby

(l): loopback

(s): spoofing

The number of interface that is UP in Physical is 2

The number of interface that is DOWN in Physical is 2

The number of interface that is UP in Protocol is 2

The number of interface that is DOWN in Protocol is 2

Interface                        IP Address/Mask      Physical  Protocol 

GigabitEthernet0/0/0              192.168.1.1/24      up        up       

GigabitEthernet0/0/1              unassigned          down      down     

GigabitEthernet0/0/2              unassigned          down      down     

NULL0                            unassigned          up        up(s) 

//重启命令    锐捷restart

reboot

Info: The system is comparing the configuration, please wait.

Warning: All the configuration will be saved to the next startup configuration.

Continue ? [y/n]:y

  It will take several minutes to save configuration file, please wait.........

  Configuration file had been saved successfully

  Note: The configuration file will take effect after being activated

System will reboot! Continue ? [y/n]:y

Info: system is rebooting ,please wait...

//配置管理vlan,华为管理vlan不能添加成员,思科可以

[Huawei]vlan 5

[Huawei-vlan5]management-vlan

//查看端口所属vlan

[sw2]display port vlan

Port                    Link Type    PVID  Trunk VLAN List

-------------------------------------------------------------------------------

Ethernet0/0/1          trunk        1    1-4094

Ethernet0/0/2          access      10    -                                 

Ethernet0/0/3          access      20    - 

//查看端口状态?

[sw2]display vlan

//创建多个vlan,vlan 10  vlan 20 vlan 30               

[Huawei]vlan batch 10 20 30

你可能感兴趣的:(基本命令+查看端口所属vlan)