华为交换机常用配置命令
system-view 简写:sy
进入系统视图
[huawei]sysname huawei
交换机命名
[huawei]quit 简写:q
返回上一级
[huawei]return 简写:ret
直接返回用户视图
save 简写:sa
保存配置
reboot
重启设备
[huawei]dis cur
查看配置
[huawei]dis vlan
查看Vlan
[huawei]dis int g0/0/1
查看端口
[huawei]vlan 100
新建Vlan
[huawei]undo vlan 100
删除Vlan
[huawei-vlan100]port g0/0/1
把端口放入Vlan 100 中
[huawei-vlan100]undo port g0/0/1
表示删除当前Vlan端口1
[huawei-vlan100]description wifi
命名Vlan
[huawei]int vlan 100
进入Vlan
[huawei-vlanif100]ip address
配置Vlan管理地址
[huawei]int g0/0/1
进入端口
[huawei-GigabitEthernet0/0/1]port link-type access
设置端口为access模式
[Huawei-GigabitEthernet0/0/1]port default vlan 100
把端口放入Vlan 100 中
[huawei-GigabitEthernet0/0/1]port link-type trunk
设置端口为trunk模式
[huawei-G0/0/1]port trunk allow-pass vlan all
设置允许所有Vlan 的报文通过
[huawei-GigabitEthernet0/0/1]undo port link-type
删除端口配置
reset saved-configuration
檫除旧的配置文件
[Huawei-Vlanif60]dhcp select global
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 authenticationpassword
Telnet配置
[huawei]int vlan 1
[Quidway-Vlanif1]ip address 192.168.1.100255.255.255.0 设置管理地址
[huawei]aaa 进入aaa配置模式
[huawei-aaa]local-user admin password 设置admin密码
[huawei-aaa]local-user admin privilege level3 然后设置登陆权限
[huawei-aaa]local-user admin service-typetelnet 设置登录类型
[huawei]user-interface vty 0 4 进入认证配置模式
[huawei-ui-vty0-4]authentication-modeaaa 设置aaa认证
恢复交换机出厂配置
reset saved-configuration 檫除旧的配置文件
reboot 交换机重启
xt startup:, Continue?[Y/N]:n 此处选N
忘记console密码,恢复交换机出厂配置
设备重启时按Ctrl+B进入BOOT MENU之后,默认密码是:[email protected]
第一步、选择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.1mask 255.255.255.0 子网IP和掩码
[Huawei-ip-pool-aa]gateway-list192.168.10.1 网关地址
[Huawei-ip-pool-aa]dns-list203.208.24.28 配置DNS列表
[Huawei-ip-pool-aa]excluded-ip-address192.168.10.2 192.168.10.50 排除地址
[Huawei]ip pool bb 创建地址池bb
[Huawei-ip-pool-aa]network 192.168.20.1mask 255.255.255.0 子网IP和掩码
[Huawei-ip-pool-aa]gateway-list192.168.20.1 网关地址
[Huawei-ip-pool-aa]dns-list 203.208.24.28 配置DNS列表
[Huawei-ip-pool-aa]excluded-ip-address192.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.1255.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.1255.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-typetrunk 设置端口为trunk模式
[Huawei-GigabitEthernet0/0/1]port trunkallow-pass vlan all 设置允许所有Vlan 的报文通过
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]int g0/0/2 进入端口
[Huawei-GigabitEthernet0/0/2]port link-typetrunk 设置端口为trunk模式
[Huawei-GigabitEthernet0/0/2]port trunkallow-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-passvlan 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-passvlan 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