NETWORK笔记4:华为命令
admin
2023-02-18 14:20:05
0

NETWORK笔记4:华为命令

      #用户视图

system-view      #进系统视图

Enter system view, return user view with Ctrl+Z.      #进入系统视图,返回用户视图用Ctrl+Z。

[Huawei]interface Ethernet 0/0/1      #接口视图 Ethernet:接口类型 0/0/1:第一个0代表槽位,第二个0代表子卡号,1代表接口号

[Huawei-Ethernet0/0/1]quit      #返回上一试图

[Huawei]ospf      #ospt协议视图

[Huawei-ospf-1]

[Huawei-ospf-1]return      #回到用户视图


[Huawei]sysname Switch     #系统名 交换机

[Switch]display version      #显示 版本信息

[Switch]display current-configuration       #显示 当前配置


[Switch]user-interface console 0      #用户 接口 控制台 0

[Switch-ui-console0]authentication-mode password      #认证模式 密码

[Switch-ui-console0]set authentication password {simple|cipher} 123      #设置 认证 密码 简单|暗文 123    简单|暗文二选一!


[Switch]user-interface console 0

[Switch-ui-console0]authentication-mode aaa

[Switch-ui-console0]aaa

[Switch-aaa]local-user huawei password cipher huawei123      #本地用户 huawei 密码 暗文 huawei123

Info: Add a new user.      #信息:添加 新 用户

save      #保存

The current configuration will be written to the device.      #当前配置将被写入设备

Are you sure to continue?[Y/N]                                #您确定继续吗?[y/n]

Save the configuration successfully.      #保存配置成功。

reboot      #重新启动

System will reboot! Continue?[Y/N]:y      #系统将重启!继续[Y/ N]:Y?

reset saved-configuration       #重置 保存 配置

Warning: The action will delete the saved configuration in the device.      #警告:该操作将删除设备中保存的配置。

The configuration will be erased to reconfigure. Continue? [Y/N]:y      #配置将被擦除以重新配置。 继续?[Y/ N]:Y

Info: Succeeded in clearing the configuration in the device.      #信息:成功清除设备中的配置。


[Huawei]user-interface console 0

[Huawei-ui-console0]idle-timeout 120      #闲置-时间 120分钟     120分钟后自动退出

[Huawei-ui-console0]screen-length 24      #屏幕-长度24      显示24行


display bridge mac-address      #显示桥(交换机)MAC地址

display mac-address        #显示MAC地址       

[Huawei]lldp enable        #LLDP协议 启用

[Huawei]display lldp neighbor brief        #显示LLDP邻居简介


[Huawei]interface GigabitEthernet 0/0/1

[Huawei-GigabitEthernet0/0/1]undo negotiation auto        #撤消协商自动

[Huawei-GigabitEthernet0/0/1]duplex {half|full}        #双工 半|全

[Huawei-GigabitEthernet0/0/1]speed {10|100|1000}        #速度 10|100|1000  M


[Huawei]interface vlan 1

[Huawei-Vlanif1]ip address 192.168.1.250 255.255.255.0        #IP地址192.168.1.250 255.255.255.0 

[Huawei-Vlanif1]undo shutdown        #解开 关掉        启用


system-view 

[Huawei]sysname R1

[R1]interface GigabitEthernet 0/0/0

[R1-GigabitEthernet0/0/0]ip address 192.168.2.1  255.255.255.0

[R1]ip route-static 192.168.4.0 255.255.255.0 192.168.2.2        #IP 路由-静态   ip route-static 目标网络ID 子网掩码 下一跳

[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.2.2        #默认路由或缺省路由! 

display ip routing-table        #显示IP路由表


[Router]user-interface vty 0 4      #远程用户登录接口


[HuaweiSwitch]vlan 12        #创建Vlan12

[HuaweiSwitch-vlan12]description HAHA        #描述 HAHA (思科name)


[HuaweiSwitch]interface GigabitEthernet 0/0/1

[HuaweiSwitch-GigabitEthernet0/0/1]port link-type access        #端口 链接-类型 access 

[HuaweiSwitch-GigabitEthernet0/0/1]port default vlan 12       #端口 默认 vlan12


[HuaweiSwitch3]interface GigabitEthernet 0/0/24

[HuaweiSwitch3-GigabitEthernet0/0/24]port link-type trunk        #端口 链接-类型 trunk 

[HuaweiSwitch3-GigabitEthernet0/0/24]port trunk allow-pass vlan all        #端口 trunk 允许通过 VLAN 全部


[HuaweiSwitch]port-group 1        #端口-组 1

[HuaweiSwitch-port-group-1]group-member GigabitEthernet 0/0/1 GigabitEthernet 0/0/3 GigabitEthernet 0/0/5        #组-成员 1 3 5

[HuaweiSwitch-port-group-1]group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/9        #组-成员 123456789


[HuaweiSwitch]port-group group-member GigabitEthernet 0/0/1 GigabitEthernet 0/0/3 GigabitEthernet 0/0/5

[HuaweiSwitch]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/9

永久组临时组


华为交换机删除Vlan后端口自动回到Vlan1


[HuaweiSwitch]vlan 1        #创建Vlan1

[HuaweiSwitch]vlan batch 1 3 5        #创建Vlan1 3 5

[HuaweiSwitch]vlan batch 1 to 9        #创建Vlan123456789


[HuaweiSwitch]undo vlan 1        #解开Vlan1

[HuaweiSwitch]undo vlan batch 1 3 5        #解开Vlan1 3 5 

[HuaweiSwitch]undo vlan batch 1 to 9        #解开Vlan123456789


未完


相关内容

热门资讯

小伙相亲2天后花33万闪婚,一... 极目新闻记者 邓波2025年4月,安徽安庆小伙何攀到贵州贵阳花果园相亲,并与相识两天的贵阳籍女子陆某...
丘成桐:王虹和邓煜都在MIT待... 当地时间7月23日,在美国费城举行的2026年国际数学家大会开幕式上,中国数学家邓煜、王虹获得菲尔兹...
欧盟对俄制裁列单中企,中国驻欧... 问:2026年7月23日,欧盟通过第21轮对俄罗斯制裁方案,新增列单制裁中国企业。中方对此有何评论?...
特朗普预警9月政府“停摆”,美... 一国总统公开预警自家联邦政府即将“停摆”,这种魔幻剧情又双叒叕要在华盛顿上演?当地时间7月22日,特...
视频丨2026年APEC数字和... 昨天(23日),2026年亚太经合组织数字和人工智能部长会议在四川成都举行。本届会议的主题为“数字和...
海南商发二期发射区土建完工,建... 7 月 24 日消息,海南商发今日宣布,海南商业航天发射场二期发射区建设项目土建工作完成,全面转入设...
菲律宾,没有以色列的命,得了以... 菲律宾,马尼拉。美国国务卿鲁比奥来了。菲律宾期盼已久的“救星”来了。菲律宾认为的“阳光”来了。从机场...
服务器盛会东莞启幕,松山湖软硬... 7月23日至24日,“智算筑基 融链共赢——2026年服务器产业供需对接活动”在东莞举行。作为系列配...
面向6G通信、高端安检、精准医... 太赫兹作为“电磁波段最后一块未开垦之地”,近年在超快光电子、低尺度半导体技术的推动下,逐步从实验室走...
获得全球最高奖项的中国数学家,... 一个喜欢玩梗的二次元大佬,竟然站上了数学界最高荣誉的领奖台。他就是今年的菲尔兹奖得主之一,邓煜。另一...