华为交换机常用配置命令

system-view 简写:sy [huawei]sysname huawei [huawei]quit 简写:q [huawei]return 简写:ret save 简写:sa reboot [huawei]dis cur [huawei]dis vlan [huawei]dis int g0/0/1 [huawei]vlan 100 [huawei]undo vlan 100 [huawei-vlan100]port g0/0/1 [huawei-vlan100]undo port g0/0/1 [huawei-vlan100]description wifi [huawei]int vlan 100 [huawei-vlanif100]ip address [huawei]int g0/0/1 [huawei-GigabitEthernet0/0/1]port link-type access [Huawei-GigabitEthernet0/0/1]port default vlan 100 [huawei-GigabitEthernet0/0/1]port link-type trunk [huawei-G0/0/1]port trunk allow-pass vlan all [huawei-GigabitEthernet0/0/1]undo port link-type reset saved-configuration [Huawei-Vlanif60]dhcp select global 进入系统视图 交换机命名 返回上一级 直接返回用户视图 保存配置 重启设备 查看配置 查看Vlan 查看端口 新建Vlan 删除Vlan 把端口放入Vlan 100 中 表示删除当前Vlan端口1 命名Vlan 进入Vlan 配置Vlan管理地址 进入端口 设置端口为access模式 把端口放入Vlan 100 中 设置端口为trunk模式 设置允许所有Vlan 的报文通过 删除端口配置 檫除旧的配置文件 DHCP获取范围从全局global获取 端口划入Vlan前,必须设置为access模式 端口批量加入Vlan

[huawei]port-group yewu

[huawei-port-group-yewu]group-member g0/0/4 to g0/0/6 [huawei-port-group-yewu]port link-type access [huawei-port-group-yewu]port default vlan 100

密码配置

[Quidway]user-interface con 0

[Quidway-ui-console0]set authentication password

Telnet配置

[huawei]int vlan 1

[Quidway-Vlanif1]ip address 192.168.1.100 255.255.255.0 设置管理地址 [huawei]aaa 进入aaa配置模式

[huawei-aaa]local-user admin password 设置admin密码

[huawei-aaa]local-user admin privilege level 3 然后设置登陆权限 [huawei-aaa]local-user admin service-type telnet 设置登录类型 [huawei]user-interface vty 0 4 进入认证配置模式

[huawei-ui-vty0-4]authentication-mode aaa 设置aaa认证

恢复交换机出厂配置

reset saved-configuration 檫除旧的配置文件 reboot 交换机重启 xt startup:, Continue?[Y/N]:n 此处选N

忘记console密码,恢复交换机出厂配置

设备重启时按Ctrl+B进入BOOT MENU之后,默认密码是:Admin@huawei.com 第一步、选择7;第二步、Y;第三步、选择1。

华为三层交换机做DHCP服务

配置三层交换机S5700

system-view 进入系统模式 [Huawei]dhcp enable 开启dhcp服务

[Huawei]dhcp snooping enable 开启dhcp过滤功能 [Huawei]ip pool aa 创建地址池aa

[Huawei-ip-pool-aa]network 192.168.10.1 mask 255.255.255.0 子网IP和掩码 [Huawei-ip-pool-aa]gateway-list 192.168.10.1 网关地址 [Huawei-ip-pool-aa]dns-list 203.208.24.28 配置DNS列表

[Huawei-ip-pool-aa]excluded-ip-address 192.168.10.2 192.168.10.50 排除地址 [Huawei]ip pool bb 创建地址池bb

[Huawei-ip-pool-aa]network 192.168.20.1 mask 255.255.255.0 子网IP和掩码 [Huawei-ip-pool-aa]gateway-list 192.168.20.1 网关地址 [Huawei-ip-pool-aa]dns-list 203.208.24.28 配置DNS列表

[Huawei-ip-pool-aa]excluded-ip-address 192.168.20.2 192.168.20.50 排除地址 [Huawei-ip-pool-aa]return sy

[Huawei]vlan 10 [Huawei-vlan10]quit

[Huawei]int vlan 10 进入vlan 10端口

[Huawei-Vlanif10]ip address 192.168.10.1 255.255.255.0 为vlan 10配置IP地址 [Huawei-Vlanif10]dhcp select global DHCP获取范围从全局global获取 [Huawei-Vlanif10]quit [Huawei]vlan 20 [Huawei-vlan10]quit

[Huawei]int vlan 20 进入vlan 20端口

[Huawei-Vlanif20]ip address 192.168.20.1 255.255.255.0 为vlan 20配置IP地址 [Huawei-Vlanif20]dhcp select global DHCP获取范围从全局global获取 [Huawei-Vlanif20]quit

[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]quit

[Huawei]int g0/0/2 进入端口

[Huawei-GigabitEthernet0/0/2]port link-type trunk 设置端口为trunk模式

[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all 设置允许所有Vlan 的报文通过 [Huawei-GigabitEthernet0/0/2]return save 保存配置 Are you sure to continue?[Y/N]y

配置二层交换机(1)S3700 sy

[Huawei]int e0/0/1

[Huawei-Ethernet0/0/1]port link-type trunk

[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all [Huawei-Ethernet0/0/1]q [Huawei]int e0/0/2

[Huawei-Ethernet0/0/2]port link-type access [Huawei-Ethernet0/0/2]q [Huawei]vlan 10

[Huawei-vlan10]port e0/0/2 [Huawei-vlan10]ret save

配置二层交换机(2)S3700 sy

[Huawei]int e0/0/1

[Huawei-Ethernet0/0/1]port link-type trunk

[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all [Huawei-Ethernet0/0/1]q [Huawei]vlan 20 [Huawei-vlan20]q [Huawei]int e0/0/2

[Huawei-Ethernet0/0/2]port link-type access [Huawei-Ethernet0/0/2]port default vlan 20 [Huawei-Ethernet0/0/2]ret save

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4