华为交换机的根本操作命令
设置日期和时间——时间对于交换机来说非常重要,时间不对很多功能无法实现
<Huawei>clock timezone BJ add 08:00:00 ——在用户视图下输入此命令
<Huawei>clock datetime 13:45:30 2021-09-20 ----设置当前时间和日期,24小时制
<Huawei>system-view ------进入系统视图
[Huawei] -----------进入系统视图后<>变成了[ ]
创立Vlan并把端口参加VLAN
[ Huawei]vlan 2 ------------在系统视图下操作,创立Vlan 2
[Huawei-vlan2] #--创立了vlan2并进入vlan2
[Huawei-vlan2]quit #--退出vlan2
[Huawei]vlan batch 3 to 20 #--批量创立vlan 3到30
Info: This operation may take a few seconds. Please wait for done.
[Huawei]vlan batch 21 22 25 #--批量创立vlan,创立了21,22,25三个vlan
Info: This operation may take a few seconds. Please wait for done.
[Huawei]undo vlan 21 #--删除vlan 21
[Huawei]undo vlan batch 22 25 #--批量删除vlan,删除22 和25
Warning: The configurations of the VLAN will be deleted. Continue?[Y/N]:y #--询问是否真的删除
Info: This operation may take a few seconds. Please wait for done.
[Huawei]interface GigabitEthernet 0/0/2 #--进入G0/0/2端口
[Huawei-GigabitEthernet0/0/2]port link-type access #--更改端口的连接类型为access
[Huawei-GigabitEthernet0/0/2]port default vlan 2 #--更改端口的默认vlan为vlan 2
[Huawei]port-group 3-10 #--创立了一个名为3-10的端口组,并进入这个组
[Huawei-port-group-3-10]group-member GigabitEthernet 0/0/3 to GigabitEthernet 0/0/10 #-- 在组内,将G0/0/3 到 G0/0/10端口抓进来
[Huawei-port-group-3-10]port link-type access #--一条命令可以修改端口组内所有端口的属性
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/4]port link-type access
[Huawei-GigabitEthernet0/0/5]port link-type access
[Huawei-GigabitEthernet0/0/6]port link-type access
[Huawei-GigabitEthernet0/0/7]port link-type access
[Huawei-GigabitEthernet0/0/8]port link-type access
[Huawei-GigabitEthernet0/0/9]port link-type access
[Huawei-GigabitEthernet0/0/10]port link-type access
[Huawei-port-group-3-10]
[Huawei-port-group-3-10]port default vlan 3
[Huawei-GigabitEthernet0/0/3]port default vlan 3
[Huawei-GigabitEthernet0/0/4]port default vlan 3
[Huawei-GigabitEthernet0/0/5]port default vlan 3
[Huawei-GigabitEthernet0/0/6]port default vlan 3
[Huawei-GigabitEthernet0/0/7]port default vlan 3
cipher命令[Huawei-GigabitEthernet0/0/8]port default vlan 3
[Huawei-GigabitEthernet0/0/9]port default vlan 3
[Huawei-GigabitEthernet0/0/10]port default vlan 3
[Huawei-port-group-3-10]
[Huawei]undo port-group 3-10 #--如不再需要这个端口组,可以解散
[Huawei]display port vlan #--显示端口和Vlan的关系
Port Link Type PVID Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1 hybrid 1 -
GigabitEthernet0/0/2 access 2 -
GigabitEthernet0/0/3 access 3 -
GigabitEthernet0/0/4 access 3 -
GigabitEthernet0/0/5 access 3 -
GigabitEthernet0/0/6 access 3 -
GigabitEthernet0/0/7 access 3 -
GigabitEthernet0/0/8 access 3 -
GigabitEthernet0/0/9 access 3 -
GigabitEthernet0/0/10 access 3 -
GigabitEthernet0/0/11 hybrid 1 -
GigabitEthernet0/0/12 hybrid 1 -
>>>>>>>>>>>>>>####
设置Vlanif的IP地址
交换机是二层设备,不能直接给某个端口指定IP地址,但可以给Vlan interface这个虚拟的接口设置IP地址
[Huawei]interface vlanif 1 #--进入vlanif 1
[Huawei-Vlanif1]
[Huawei-Vlanif1]ip address 192.168.1.1 255.255.255.0 #--设置vlanif 1的IP地址为192.168.1.1,子网掩码为255.255.255.0
[Huawei-Vlanif1]ip address 192.168.1.1 24 #--也可以这样输入,子网掩码直接输入位数
>>>>>>>>>>>>>>####
保存交换机的设置
<Huawei>save #--在用户视图下,输入save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y #--这里提示是否继续保存配置
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
两台MAC电脑通过局域网快速传输文件
« 上一篇
windows xp 系统CMD命令大全
下一篇 »
发表评论