h3c交换机操作1,进入全局配置界面[Quidway]display current-configuration ;显示当前生效的配置[Quidway]display saved-configuration ;显示flash中配置文件,即下次上电启动时所用的配置文件<Quidway>reset saved-configuration ;檫除旧的配置文件<Quidway>reboot ;交换机重启2,配置web登陆页面的账号密码interface Vlan-interface 1ip address 管理地址的ip和子网掩码,配置用户local-user adminservice-type telnetauthorization-attribute level 3password simple admin3,基本设置[Quidway]super password ;修改特权用户密码[Quidway]sysname ;交换机命名[Quidway]interface ethernet 0/1 ;进入接口视图[Quidway]interface vlan x ;进入接口视图[Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0 ;配置VLAN的IP地址[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关4,telnet配置[Quidway]user-interface vty 0 4 ;进入虚拟终端[S3026-ui-vty0-4]authentication-mode password ;设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple 222 ;设置口令[S3026-ui-vty0-4]user privilege level 3 ;用户级别5,端口配置[Quidway-Ethernet0/1]duplex {half|full|auto} ;配置端口工作状态[Quidway-Ethernet0/1]speed {10|100|auto} ;配置端口工作速率[Quidway-Ethernet0/1]flow-control ;配置端口流控[Quidway-Ethernet0/1]mdi {across|auto|normal} ;配置端口平接扭接[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid} ;设置端口工作模式[Quidway-Ethernet0/1]undo shutdown ;激活端口[Quidway-Ethernet0/2]quit ;退出系统视图6,链路聚合配置[DeviceA] link-aggregation group 1 mode manual ;创建手工聚合组1[DeviceA] interface ethernet 1/0/1 ;将以太网端口Ethernet1/0/1加入聚合组1[DeviceA-Ethernet1/0/1] port link-aggregation group 1[DeviceA-Ethernet1/0/1] interface ethernet 1/0/2 ;将以太网端口Ethernet1/0/1加入聚合组1[DeviceA-Ethernet1/0/2] port link-aggregation group 1[DeviceA] link-aggregation group 1 service-type tunnel # 在手工聚合组的基础上创建Tunnel业务环回组。
[DeviceA] interface ethernet 1/0/1 # 将以太网端口Ethernet1/0/1加入业务环回组。
[DeviceA-Ethernet1/0/1] undo stp[DeviceA-Ethernet1/0/1] port link-aggregation group 17,端口镜像[Quidway]monitor-port <interface_type interface_num> ;指定镜像端口[Quidway]port mirror <interface_type interface_num> ;指定被镜像端口[Quidway]port mirror int_list observing-port int_type int_num ;指定镜像和被镜像8,VLAN配置[Quidway]vlan 3 ;创建VLAN[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 ;在VLAN中增加端口配置基于access的VLAN[Quidway-Ethernet0/2]port access vlan 3 ;当前端口加入到VLAN注意:缺省情况下,端口的链路类型为Access类型,所有Access端口均属于且只属于VLAN1配置基于trunk的VLAN[Quidway-Ethernet0/2]port link-type trunk ;设置当前端口为trunk[Quidway-Ethernet0/2]port trunk permit vlan {ID|All} ;设trunk允许的VLAN注意:所有端口缺省情况下都是允许VLAN1的报文通过的[Quidway-Ethernet0/2]port trunk pvid vlan 3 ;设置trunk端口的PVID配置基于Hybrid端口的VLAN[Quidway-Ethernet0/2]port link-type hybrid ;配置端口的链路类型为Hybrid类型[Quidway-Ethernet0/2]port hybrid vlan vlan-id-list { tagged | untagged } ;允许指定的VLAN通过当前Hybrid端口注意:缺省情况下,所有Hybrid端口只允许VLAN1通过[Quidway-Ethernet0/2]port hybrid pvid vlan vlan-id ;设置Hybrid端口的缺省VLAN 注意:缺省情况下,Hybrid端口的缺省VLAN为VLAN1VLAN描述[Quidway]description string ;指定VLAN描述字符[Quidway]description ;删除VLAN描述字符[Quidway]display vlan [vlan_id] ;查看VLAN设置私有VLAN配置[SwitchA-vlanx]isolate-user-vlan enable ;设置主vlan[SwitchA]Isolate-user-vlan <x> secondary <list> ;设置主vlan包括的子vlan[Quidway-Ethernet0/2]port hybrid pvid vlan <id> ;设置vlan的pvid[Quidway-Ethernet0/2]port hybrid pvid ;删除vlan的pvid[Quidway-Ethernet0/2]port hybrid vlan vlan_id_list untagged ;设置无标识的vlan如果包的vlan id与PVId一致,则去掉vlan信息. 默认PVID=1。
所以设置PVID为所属vlan id, 设置可以互通的vlan为untagged.9,STP配置[Quidway]stp {enable|disable} ;设置生成树,默认关闭[Quidway]stp mode rstp;设置生成树模式为rstp[Quidway]stp priority 4096 ;设置交换机的优先级[Quidway]stp root {primary|secondary} ;设置为根或根的备份[Quidway-Ethernet0/1]stp cost 200 ;设置交换机端口的花费10、GVRP配置[SwitchA] gvrp # 开启全局GVRP[SwitchA-Ethernet1/0/1] gvrp # 在以太网端口Ethernet1/0/1上开启GVRP[SwitchE-Ethernet1/0/1] gvrp registration { fixed | forbidden | normal } # 配置GVRP端口注册模式缺省为normal [SwitchA] display garp statistics [ interface interface-list ] ;显示GARP统计信息[SwitchA] display garp timer [ interface interface-list ] ;显示GARP定时器的值[SwitchA] display gvrp statistics [ interface interface-list ] ;显示GVRP统计信息[SwitchA] display gvrp status ;显示GVRP的全局状态信息[SwitchA] display gvrp statusreset garp statistics [ interface interface-list ] ;清除GARP统计信息11,启用dhcp服务[H3C]dhcp enable[H3C]dhcp server ip-pool 2[H3C-dhcp-pool-2]networl 10.0.2.0 24[H3C-dhcp-pool-2]dns-list 223.5.5.5 223.6.6.6[H3C-dhcp-pool-2]gateway-list 10.0.2.1[H3C-dhcp-pool-2]expired day 2[H3C-dhcp-pool-2]domain-name [H3C-dhcp-pool-2]quit。