端口划入Vlan前,必须设置为access模式端口批量加入Vlan[huawei]port-groupyewu[huawei-port-group-yewu]group-memberg0/0/4tog0/0/6[huawei-port-group-yewu]portlink-typeaccess[huawei-port-group-yewu]portdefaultvlan100密码配置[Quidway]user-interfacecon0[Quidway-ui-console0]setauthenticationpasswordTelnet配置[huawei]intvlan1[Quidway-Vlanif1]ipaddress192.168.1.100255.255.255.0设置管理地址[huawei]aaa进入aaa配置模式[huawei-aaa]local-useradminpassword设置admin密码[huawei-aaa]local-useradminprivilegelevel3然后设置登陆权限[huawei-aaa]local-useradminservice-typetelnet设置登录类型[huawei]user-interfacevty04进入认证配置模式[huawei-ui-vty0-4]authentication-modeaaa设置aaa认证huaweisystem-view简写:sy进入系统视图[huawei]sysnamehuawei交换机命名[huawei]quit简写:q返回上一级[huawei]return简写:ret直接返回用户视图huaweisave简写:sa保存配置huaweireboot重启设备[huawei]discur查看配置[huawei]disvlan查看Vlan[huawei]disintg0/0/1查看端口[huawei]vlan100新建Vlan[huawei]undovlan100删除Vlan[huawei-vlan100]portg0/0/1把端口放入Vlan100中[huawei-vlan100]undoportg0/0/1表示删除当前Vlan端口1[huawei-vlan100]descriptionwifi命名Vlan[huawei]intvlan100进入Vlan[huawei-vlanif100]ipaddress配置Vlan管理地址[huawei]intg0/0/1进入端口[huawei-GigabitEthernet0/0/1]portlink-typeaccess设置端口为access模式[Huawei-GigabitEthernet0/0/1]portdefaultvlan100把端口放入Vlan100中[huawei-GigabitEthernet0/0/1]portlink-typetrunk设置端口为trunk模式[huawei-G0/0/1]porttrunkallow-passvlanall设置允许所有Vlan的报文通过[huawei-GigabitEthernet0/0/1]undoportlink-type删除端口配置huaweiresetsaved-configuration檫除旧的配置文件[Huawei-Vlanif60]dhcpselectglobalDHCP获取范围从全局global获取恢复交换机出厂配置huaweiresetsaved-configuration檫除旧的配置文件huaweireboot交换机重启xtstartup:,Continue?[Y/N]:n此处选N忘记console密码,恢复交换机出厂配置设备重启时按Ctrl+B进入BOOTMENU之后,默认密码是:Admin@huawei.com第一步、选择7;第二步、Y;第三步、选择1。华为三层交换机做DHCP服务配置三层交换机S5700Huaweisystem-view进入系统模式[Huawei]dhcpenable开启dhcp服务[Huawei]dhcpsnoopingenable开启dhcp过滤功能[Huawei]ippoolaa创建地址池aa[Huawei-ip-pool-aa]network192.168.10.1mask255.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.2192.168.10.50排除地址[Huawei]ippoolbb创建地址池bb[Huawei-ip-pool-aa]network192.168.20.1mask255.255.255.0子网IP和掩码[Huawei-ip-pool-aa]gateway-list192.168.20.1网关地址[Huawei-ip-pool-aa]dns-list203.208.24.28配置DNS列表[Huawei-ip-pool-aa]excluded-ip-address192.168.20.2192.168.20.50排除地址[Huawei-ip-pool-aa]returnHuaweisy[Huawei]vlan10[Huawei-vlan10]quit[Huawei]intvlan10进入vlan10端口[Huawei-Vlanif10]ipaddress192.168.10.1255.255.255.0为vlan10配置IP地址[Huawei-Vlanif10]dhcpselectglobalDHCP获取范围从全局global获取[Huawei-Vlanif10]quit[Huawei]vlan20[Huawei-vlan10]quit[Huawei]intvlan20进入vlan20端口[Huawei-Vlanif20]ipaddress192.168.20.1255.255.255.0为vlan20配置IP地址[Huawei-Vlanif20]dhcpselectglobalDHCP获取范围从全局global获取[Huawei-Vlanif20]quit[Huawei]intg0/0/1进入端口[Huawei-GigabitEthernet0/0/1]portlink-typetrunk设置端口为trunk模式[Huawei-GigabitEthernet0/0/1]porttrunkallow-passvlanall设置允许所有Vlan的报文通过[Huawei-GigabitEthernet0/0/1]quit[Huawei]intg0/0/2进入端口[Huawei-GigabitEthernet0/0/2]portlink-typetrunk设置端口为trunk模式[Huawei-GigabitEthernet0/0/2]porttrunkallow-passvlanall设置允许所有Vlan的报文通过[Huawei-GigabitEthernet0/0/2]returnHuaweisave保存配置Areyousuretocontinue?[Y/N]y配置二层交换机(1)S3700Huaweisy[Huawei]inte0/0/1[Huawei-Ethernet0/0/1]portlink-typetrunk[Huawei-Ethernet0/0/1]porttrunkallow-passvlanall[Huawei-Ethernet0/0/1]q[Huawei]inte0/0/2[Huawei-Ethernet0/0/2]portlink-typeaccess[Huawei-Ethernet0/0/2]q[Huawei]vlan10[Huawei-vlan10]porte0/0/2[Huawei-vlan10]retHuaweisave配置二层交换机(2)S3700Huaweisy[Huawei]inte0/0/1[Huawei-Ethernet0/0/1]portlink-typetrunk[Huawei-Ethernet0/0/1]porttrunkallow-passvlanall[Huawei-Ethernet0/0/1]q[Huawei]vlan20[Huawei-vlan20]q[Huawei]inte0/0/2[Huawei-Ethernet0/0/2]portlink-typeaccess[Huawei-Ethernet0/0/2]portdefaultvlan20[Huawei-Ethernet0/0/2]retHuaweisave华为三层交换机做DHCP中继服务