HC三层交换机配置命令

合集下载

三层交换机配置命令以及中文解释

三层交换机配置命令以及中文解释

三层交换机配置命令以及中文解释基本配置S> enable 进入特权模式S# configure terminal 进入全局配置模式S(config)# hostname name 改变交换机名称S(config)# enable password level level_# password 设置用户口令(level_#=1)或特权口令(level_#=15)S(config)# line console 0 进入控制台接口S(config-line)# password console_password 接上一条命令,设置控制台口令S(config)# line vty 0 15 进入虚拟终端S(config-line)# password telnet_password 接上一条命令,设置Telnet口令S(config-line)# login 允许Telnet登录S(config)# enable password|secret privilege_password 配置特权口令(加密或不加密)S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进入接口子配置模式S(config-if)# [no] shutdown 关闭或启用该接口(默认启用)S(config)# ip address IP_address sunbet_mask 指定IP地址S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认网关S# show running-config 查看当前的配置S# copy running-config startup-config 将RAM中的当前配置保存到NVRAM中S> show interface [type slot_#/port_#] 查看所有或指定接口的信息S> show ip 显示交换机的IP配置(只在1900系列上可用)S> show version 查看设备信息S# show ip interface brief 验证IP配置S(config-if)# speed 10|100|auto 设置接口速率S(config-if)# duplex auto|full|half 设置接口双工模式S> show mac-address-table 查看CAM表S# clear mac-address-table 清除CAM表中的动态条目1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# 在CAM表中创建静态条目2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/]port_# 在CAM表中创建静态条目1900(config)# mac-address-table restricted static MAC_address source_portlist_of_allowed_interface 设置静态端口安全措施1900(config-if)# port secure 启用粘性学习1900(config-if)# port secure max-mac-count value 设置粘性学习特性能够学到的地址数量(默认132,取值范围是1-132)1900(config)# address-violation suspend|ignore|disable 改变安全选项1900> show mac-address-table security 验证端口安全措施2950(config)# switchport mode access 定义接口为主机端口而不是中继端口2950(config)# switchport port-security 启用端口安全措施2950(config)# switchport port-security maximum value 指定可与此接口相关的设备的最大数量2950(config)# switchport port-security violation protect|restrict|shutdown 指定出现安全违规时应该发生的事2950(config)# switchport port-security mac-address MAC_address 指定允许与此接口相关的确切的MAC地址2950(config)# switchport port-security mac-address sticky 启用粘性学习特性2950(config)# show port interface type [slot_#/] port_# 验证接口配置2950(config-if) description name 设置接口描述信息2950# show buffers 查看系统缓存的大小1900# copy nvram tftp:// IP_address_of_TFTP_server/ file_name 将配置文件备份到TFTP服务器上1900# copy tftp:// IP_address_of_TFTP_server/ file_name nvram 从TFTP服务器上恢复配置到NVRAM1900# delete nvram 删除配置文件2950# erase startup-config 删除配置文件3550# show tcam qos TCAM_ID statistics 查看TCAM剩余容量4000> enable 进入特权模式4000>(enable) set password 设置用户模式密码4000>(enable) set enablepass 设置授权密码4000>(enable) set interface sc0 IP_address mask 配置IP地址4000>(enable) set port enable|disable slot_#/port_# 启用/禁用接口4000>(enable) show port [slot_#/port_#] 显示接口信息4000>(enable) set port name slot_#/port_# name 设置交换机接口描述信息4000>(enable) set port speed slot_#/port_# 4|10|16|100|auto 设置交换机接口速率4000>(enable) set port duplex slot_#/port_# full|half 设置交换机接口双工模式4000>(enable) clear config all 删除NVRAM中的配置信息4000>(enable) erase all 删除FLASH中的内容4000>(enable) show flash 显示FLASH中的内容4000>(enable) show cam [count] dynamic|static|permanent|system [vlan_#] 显示CAM表VLAN 1900(config)# vtp domain VTP_domain_name 定义交换机域名1900(config)# vtp server|client|transparent 定义交换机VTP模式(默认服务器)1900(config)# vtp password VTP_password 配置VTP口令1900(config)# vtp pruning enable|disable 启用/禁用修剪(默认启用)1900(config)# vtp trap enable 启用SNMP陷阱(默认启用)1900# show vtp 验证VTP配置2950# vtp database 访问VLAN和VTP配置(以下均是在IOS12.1前用,12.1后全是在全局配置模式下)2950(vlan)# vtp domain VTP_domain_name 定义交换机域名2950(vlan)# vtp server|client|transparent 定义交换机VTP模式(默认服务器)2950(vlan)# vtp password VTP_password 配置VTP口令2950(vlan)# vtp pruning 启用/禁用修剪(默认启用)2950(config)# snmp-server enable traps vtp 启用SNMP陷阱(默认启用)2950# show vtp status 检查VTP配置2950# show vtp counters 显示与VTP消息发送与接收相关的VTP统计信息1900(config-if)# trunk on|off|desirable|auto 指定中继类型1900# show trunk A|B 验证接口中继(A是fa0/26,B是fa0/27)2950(config-if)# switchport mode trunk|dynamic desirable|dynamic auto|nonegotiate 指定中继类型(默认自动协商)2950(config-if)# switchport trunk native|allowed|pruning vlan VLAN_# 配置中继2950(config-if)# switchport trunk pruning vlan remove VLAN_# 清除不希望消减的VLAN 2950# show interfaces [type 0/port_#] switchport|trunk 验证接口中继1900(config)# vlan VLAN_# [name VLAN_name] 创建VLAN1900(config-if)# vlan-membership static VLAN_# 将该接口静态地分配给一个VLAN1900# show vlan 验证VLAN1900# show vlan-membership 查看VLAN成员关系1900# show spantree [VLAN_#] 查看VLAN的STP信息2950# vlan database 进入VLAN数据库(ISO12.1前用)2950(vlan)# vlan VLAN_# [name VLAN_name] 创建VLAN2950(config)# vlan VLAN_# 进入VLAN数据库(ISO12.1后用)2950(config-vlan)# name VLAN_name 创建VLAN2950(config-if)# switchport mode access 指定连接是接入链路连接2950(config-if)# switchport access vlan VLAN_# 指定VLAN是接入链路连接4000>(enable) set vlan VLAN_# name VLAN_name 配置VLAN4000>(enable) set vlan VLAN_# slot_#/port_#-port_# 为VLAN分配端口4000>(enable) set trunk slot_#/port_# [on|off|desirable|auto|nonegotiate] [VLAN_#][isl|dot1q|dot10|lane|negotiate] 配置中继4000>(enable) clear trunk slot_#/port_# VLAN_# 删除VLAN4000>(enable) show trunk slot_#/port_# 验证中继端口4000>(enable) set vtp v2 enable 配置VTPv24000>(enable) set vtp [domain name] [mode client|server|transparent] [passwd password] [pruning enable|disable] [v2 enable|disable] 设置VTP4000>(enable) show vtp domain 验证VTP域的信息4000>(enable) show vtp statistics 显示发出或收到的VTP通告信息的摘要内容4000>(enable) set vtp pruneeligible VLAN_# 设置VTP消减4000>(enable) clear vtp pruneeligible VLAN_# 清除不希望消减的VLANSTP 4000>(enable) set spantree enable|disable VLAN_# 启用/禁用STP(默认启用)2950(config)# [no] spanning-tree vlan VLAN_# 启用/禁用STP(默认启用)4000>(enable) show spantree [VLAN_#] 验证STP状态2950# show spanning-tree 验证STP状态4000>(enable) set spantree root [secondary] VLAN_# [dia network_diameter] [hello hello_time] 设置主根节点桥、备份节点桥、最大桥数量(2-7)、持续时间(1-10,默认2)4000>(enable) set spantree portcost slot_#/port_# cost_# 设置端口开销2950(config-if)# spanning-tree cost cost_# 设置端口开销4000>(enable) set spantree portpri slot_#/port_# priority_# 设置端口优先级4000>(enable) set spantree portvlanpri slot_#/port_# priority_# [VLAN_#] 改变VLAN的优先级设置2950(config-if)# spanning-tree vlan VLAN_# port-priority priority_# 设置端口优先级4000>(enable) set spantree fwddelay delay_# [VLAN_#] 设置从侦听状态到学习状态再到转发状态的时间间隔(默认15秒,取值范围是4-30秒)4000>(enable) set spantree hello interval_time [VLAN_#] 设置根节点交换机发送BPDU的时间间隔(默认2秒,取值范围是1-10秒)4000>(enable) set spantree maxage agingtime [VLAN_#] 设置交换机持有BPDU的时间(默认20秒,取值范围是6-40秒)2950(config)# spanning-tree vlan VLAN_# forward-time forward_time 设置从侦听状态到学习状态再到转发状态的时间间隔(默认15秒,取值范围是4-30秒)2950(config)# spanning-tree vlan VLAN_# hello-time hello_time 设置根节点交换机发送BPDU的时间间隔(默认2秒,取值范围是1-10秒)2950(config)# spanning-tree vlan VLAN_# max-age maxage 设置交换机持有BPDU的时间(默认20秒,取值范围是6-40秒)4000>(enable) set port channel slot_#/port_# on 建立以太通道集合4000>(enable) show port capabilities slot_#/port_# 查看端口的配置4000>(enable) show port channel 验证以太通道集合的配置2950(config-if)# channel-group group_number mode auto|desirable|on 建立以太通道集合2950# show etherchannel group_number|brief|detail|load-balance|port|port-channel|summary 验证以太通道集合的配置4000>(enable) set spantree portfast slot_#/port_# enable 配置PortFast2950(config-if)# spanning-tree portfast 配置PortFast4000>(enable) set spantree uplinkfast enable|disable [rate station_update_rate] [all-protocolsoff|on] 启用/禁用UplinkFast4000>(enable) show spantree uplinkfast 验证UplinkFast配置2950(config)# spanning-tree uplinkfast [max_update_rate] 启用/禁用UplinkFast2950# show spanning-tree uplinkfast 验证UplinkFast配置4000>(enable) set spantree backbonefast enable|disable 启用/禁用BackboneFast4000>(enable) show spantree backbonefast 验证BackboneFast配置2950(config)# spanning-tree backbonefast 启用BackboneFast虚拟网间路由2600(config)# interface type slot_#/port_#.subint_number 配置子接口2600(config-subif)# encapsulation dot1q|isl|sde|tr-isl VLAN_# 配置封装类型4000>(enable) show module 查看交换机的硬件配置4000>(enable) session module_# 访问L3SML3SM(config-if)# mac-address mac_address 分配MAC地址MLS 2600(config)# mls rp ip 启动MLS2600(config-if)# mls rp vtp-domain domain_name 分配路由器接口到VTP域中2600(config-if)# mls rp vlan-id VLAN_# 向接口分配VLAN2600(config-if)# mls rp management-interface 指定该接口为管理接口2600# show mls rp 提供全局MLS信息2600# show mls rp interface type slot_#/port_# 提供指定接口的MLS信息2600# show mls rp vtp-domain domain_name 提供VTP域的MLS信息6500>(enable) set mls enable 在MLS-SE上启动MLS6500>(enable) set mls include rp_ip_address 告诉交换机哪一个IP地址是正确的6500>(enable) show mls include 显示外部路由处理器的IP地址列表6500>(enable) set mls flow [destination|destination-source|full] 告诉MLS交换机要缓存候选数据包的哪些信息6500>(enable) show mls entry 显示第三层缓存表6500>(enable) set mls agingtime aging_time 改变缓存的衰老时间(默认256秒,取值范围是8-2032秒中的8的倍数值)6500>(enable) set mls agingtime fast fast_aging_time pkt_threshold 改变快速衰老周期和数据包门限值6500>(enable) show mls ip 验证MLS-SE的配置6500>(enable) clear mls entry [destination IP_address] [source IP_address] [flow protocol] [source_port] [destination_port] [all] 删除所有或指定MLS缓存记录3550(config)# ip routing 启动IP路由3550(config)# ip cef 启动CEF3550(config-if)# no switchport 将第二层接口转换为第三层接口3550(config-if)# ip route-cache cef 在接口上启动CEF3550# show ip cef 验证CEF组播3640(config)# ip multicast-routing 启动路由器上的组播服务3640(config-if)# ip pim dense-mode 将接口设置为PIM密集模式3640(config-if)# ip pim sparse-mode 将接口设置为PIM稀疏模式3640(config-if)# ip pim sparsed-dense-mode 将接口设置为PIM稀疏-密集模式3640(config)# ip pim rp-address IP_address group_ACL_# [override] 手工配置RP3640(config)# ip pim send-rp-announce type slot_#/port_# scope ttl_value group-list ACL_# 通告RP组的分配3640(config)# ip pim send-rp-discovery scope ttl_value 配置RP映射代理3640(config-if)# ip multicast ttl-threshold ttl_value 设置TTL门限值3640(config-if)# ip igmp join-group group_address 加入组播组3640# show ip mroute 查看组播信息3640# ping 验证RP之间或其他组播路由器之间的连接3640# mtrace source_IP_address [destination_IP_address] [group] 组播traceroute3640(config-if)# ip cgmp 配置CGMP路由器4000>(enable) set cgmp enable 启动CGMP4000>(enable) show cgmp statistics 查看CGMP统计信息4000>(enable) show multicast group cgmp 查看交换机了解到的组播组信息4000>(enable) set cgmp leave enable 检查由客户端产生的IGMPv2的离开信息4000>(enable) set igmp enable 启动IGMP4000>(enable) ip igmp snooping 启动IGMP探听4000>(enable) set igmp fastleave enable 启动快速离开过程4000>(enable) show igmp statistics 显示交换机上IGMP探听的状态信息QoS 2950(config)# wrr-queue cos-map queue_ID cos_value 建立队列2950(config)# wrr-queue bandwidth bandwidth_value 设置队列门限2950(config)# class-maps name 定义对信息传输分类时的匹配标准2950(config-cmap)# match access-group ACL_# 识别被分类的信息传输2950(config)# policy-map name 确定为接入信息传输所设置的分类标准2950(config-pmap)# class name2950(config-pmap-c)# set ip dscp number2950(config-if)# service-policy input name 对该接口应用策略3550(config)# mls qos 启动QoS3550(config-if)# auto qos voip 在接口上启动自动服务质量3550(config)# priority-list priority_queue_# protocol protocol high|medium|normal|low [list ACL_#] 为优先级队列定义信息流3550(config)# priority-list priority_queue_# queue-limit limit_# 定义特定优先级队列的最大队列空间3550(config-if)# priority-group priority_queue_# 向特定输出接口分配优先级队列3550(config)# queue-list queue_list_# interface type slot_#/port_# queue_number 为一个特定的定制队列定义信息流3550(config)# queue-list queue_list_# queue queue_number byte-count size_in_bytes [limit number_of_queue] 为特定的定制队列定义队列的最大空间3550(config-if)# custom-queue-list custom_queue_number 为特定的输出接口分配优先级队列4840(config)# ip slb serverfarm serverfarm_name 配置SLB冗余4840(config-slb-sfarm)# real IP_address [port_#] 指定虚拟IP地址4840(config-slb-sfarm)# inservice 启动服务器4840(config)# virtual IP_address [network_mask] tcp|udp[port_number|wsp|wsp-wtp|wsp-wtls|wsp-wtp-wtls] [service service_name] 建立虚拟服务器IP 地址。

华为三层交换机配置方法、命令及实例

华为三层交换机配置方法、命令及实例

华为三层交换机配置方法(1)(2008-07-21 11:27:34)转载分类:工作汇报标签:杂谈本文以河南平临高速所使用的华为华三通信的H3C S3600-28P-SI为例,配置前首先要确定型号后缀是SI还是EI,EI的支持所有协议,SI的不支持OSPS动态协议,因此SI配置路由时可以使用静态协议和RIP协议,具体配置如下:<H3C>system-view //进入系统视图[H3C]display current-configuration //显示当前配置//以下开始配置//第一步:划分VLAN,并描述vlan 1description local-S3600vlan 2description link-to-wenquanvlan 3description link-to-ruzhouvlan 4description link-to-xiaotunvlan 5description link-to-baofengvlan 6description link-to-pingxivlan 7description link-to-pingnanvlan 8description Uplink-to-Putianvlan 9description link-to-pingxicentre//(2)配静态路由(只用对远101 in101 in101 in101 in0.0.0cisco 35500.0.0华为三层交换机配置实例一例网络技术2008-07-25 06:08:28 阅读243 评论0 字号:大中小订阅华为三层交换机配置实例一例0.0.0华为路由器与CISCO路由器在配置上的差别"华为路由器与同档次的CISCO路由器在功能特性与配置界面上完全一致,有些方面还根据国内用户的需求作了很好的改进。

例如中英文可切换的配置与调试界面,使中文用户再也不用面对着一大堆的英文专业单词而无从下手了。

华为三层交换机配置命令

华为三层交换机配置命令

华为三层交换机配置命令华为三层交换机配置命令你的三层交换机是不是经常让你机器不好使,看看下面的三层交换机配置文章,一切问题都能解决。

yjbys详细介绍实例讲解:全面的三层交换机配置比较全面的三层交换机配置实例,带命令解释哟!快来get吧!三层交换机配置:Enable //进入私有模式Configure terminal //进入全局模式service password-encryption //对密码进行加密hostname Catalyst 3550-12T1 //给三层交换机定义名称enable password 123456. //enable密码Enable secret 654321 //enable的加密密码(应该是乱码而不是654321这样)Ip subnet-zero //允许使用全0子网(默认都是打开的)Ip name-server 172.16.8.1 172.16.8.2 //三层交换机名字Catalyst 3550-12T1对应的IP地址是172.16.8.1Service dhcp //提供DHCP服务ip routing //启用三层交换机上的路由模块Exit三层交换机配置:Vtp mode server //定义VTP工作模式为sever模式Vtp domain centervtp //定义VTP域的名称为centervtpVlan 2 name vlan2 //定义vlan并给vlan取名(如果不取名的话,vlan2的名字应该是vlan002)Vlan 3 name vlan3Vlan 4 name vlan4Vlan 5 name vlan5Vlan 6 name vlan6Vlan 7 name vlan7Vlan 8 name vlan8Vlan 9 name vlan9Exit三层交换机配置:interface Port-channel 1 //进入虚拟的`以太通道组1switchport trunk encapsulation dot1q //给这个接口的trunk封装为802.1Q的帧格式switchport mode trunk //定义这个接口的工作模式为trunkswitchport trunk allowed vlan all //在这个trunk上允许所有的vlan通过Interface gigabitethernet 0/1 //进入模块0上的吉比特以太口1 switchport trunk encapsulation dotlq //给这个接口的trunk封装为802.1Q的帧格式switchport mode trunk //定义这个接口的工作模式为trunkswitchport trunk allowed vlan all //在这个trunk上允许所有的vlan通过channel-group 1 mode on //把这个接口放到快速以太通道组1中Interface gigabitethernet 0/2 //同上switchport trunk encapsulation dotlqswitchport mode trunkswitchport trunk allowed vlan allchannel-group 1 mode on三层交换机配置:port-channel load-balance src-dst-ip //定义快速以太通道组的负载均衡方式(依*源和目的IP的方式)interface gigabitethernet 0/3 //进入模块0上的吉比特以太口3 switchport trunk encapsulation dotlq //给trunk封装为802.1Qswitchport mode trunk //定义这个接口的工作模式为trunkswitchport trunk allowed vlan all //允许所有vlan信息通过interface gigabitethernet 0/4 //同上switchport trunk encapsulation dotlqswitchport mode trunkswitchport trunk allowed vlan allinterface gigbitethernet 0/5 //同上switchport trunk encapsulation dotlqswitchport mode trunkswitchport trunk allowed vlan allinterface gigbitethernet 0/6 //同上switchport trunk encapsulation dotlqswitchport mode trunkswitchprot trunk allowed vlan all三层交换机配置:interface gigbitethernet 0/7 //进入模块0上的吉比特以太口7 Switchport mode access //定义这个接口的工作模式为访问模式switchport access vlan 9 //定义这个接口可以访问哪个vlan(实际就是分配这个接口到vlan)no shutdownspanning-tree vlan 6-9 cost 1000 //在生成树中,vlan6-9的开销定义为10000interface range gigabitethernet 0/8 – 10 //进入模块0上的吉比特以太口8,9,10switchport mode access //定义这些接口的工作模式为访问模式switchport access vlan 8 //把这些接口都分配到vlan8中no shutdown三层交换机配置:spanning-tree portfast //在这些接口上使用portfast(使用portfast以后,在生成树的时候不参加运算,直接成为转发状态)interface gigabitethernet 0/11 //进入模块0上的吉比特以太口11switchport trunk encapsulation dotlq //给这个接口封装为802.1Qswitchport mode trunk //定义这个接口的工作模式为trunkswitchport trunk allowed vlan all //允许所有vlan信息通过interface gigabitethernet 0/12 //同上switchport trunk encapsulation dotlqswitchport mode trunkswitchport trunk allowed vlan allinterface vlan 1 //进入vlan1的逻辑接口(不是物理接口,用来给vlan做路由用)ip address 172.16.1.7 255.255.255.0 //配置IP地址和子网掩码no shutdown三层交换机配置:standby 1 ip 172.16.1.9 //开启了冗余热备份(HSRP),冗余热备份组1,虚拟路由器的IP地址为172.16.1.9standby 1 priority 110 preempt //定义这个三层交换机在冗余热备份组1中的优先级为110,preempt是用来开启抢占模式interface vlan 2 //同上ip address 172.16.2.252 255.255.255.0no shutdownstandby 2 ip 172.16.2.254standby 2 priority 110 preemptip access-group 101 in //在入方向上使用扩展的访问控制列表101interface vlan 3 //同上ip address 172.16.3.252 255.255.255.0no shutdown三层交换机配置:standby 3 ip 172.16.3.254standby 3 priority 110 preemptip access-group 101 ininterface vlan 4 //同上ip address 172.16.4.252 255.255.255.0 no shutdownstandby 4 ip 172.16.4.254standby 4 priority 110 preemptip access-group 101 ininterface vlan 5ip address 172.16.5.252 255.255.255.0 no shutdownstandby 5 ip 172.16.5.254standby 5 priority 110 preemptip access-group 101 ininterface vlan 6ip address 172.16.6.252 255.255.255.0 no shutdown三层交换机配置:standby 6 ip 172.16.6.254standby 6 priority 100 preempt interface vlan 7ip address 172.16.7.252 255.255.255.0 no shutdownstandby 7 ip 172.16.7.254standby 7 priority 100 preempt interface vlan 8ip address 172.16.8.252 255.255.255.0 no shutdownstandby 8 ip 172.16.8.254standby 8 priority 100 preemptinterface vlan 9ip address 172.16.9.252 255.255.255.0no shutdown三层交换机配置:standby 9 ip 172.16.9.254standby 9 priority 100 preemptaccess-list 101 deny ip any 172.16.7.0 0.0.0.255 //扩展的访问控制列表101access-list 101 permit ip any anyInterface vlan 1 //进入vlan1这个逻辑接口Ip helper-address 172.16.8.1 //可以转发广播(helper-address 的作用就是把广播转化为单播,然后发向172.16.8.1)Interface vlan 2Ip helper-address 172.16.8.1Interface vlan 3ip helper-address 172.16.8.1interface vlan 4ip helper-address 172.16.8.1interface vlan 5ip helper-address 172.16.8.1interface vlan 6ip helper-address 172.16.8.1interface vlan 7ip helper-address 172.16.8.1interface vlan 9ip helper-address 172.16.8.1router rip //启用路由协议RIPversion 2 //使用的是RIPv2,如果没有这句,则是使用RIPv1network 172.16.0.0 //宣告直连的网段exit三层交换机配置:ip route 0.0.0.0 0.0.0.0 172.16.9.250 //缺省路由,所有在路由表中没有办法匹配的数据包,都发向下一跳地址为172.16.9.250这个路由器line con 0line aux 0line vty 0 15 //telnet线路(路由器只有5个,是0-4)password 12345678 //login密码loginendcopy running-config startup-config 保存配置【华为三层交换机配置命令】。

H3C交换机常用配置命令大全

H3C交换机常用配置命令大全

一.用户配置: <H3C>system-view[H3C]super password H3C 设置用户分级密码[H3C]undo super password 删除用户分级密码[H3C]localuserbigheap 123456 1 Web网管用户设置,1(缺省)为管理级用户,缺省admin,admin[H3C]undo localuserbigheap 删除Web网管用户[H3C]user-interface aux 0 只支持0[H3C-Aux]idle-timeout 2 50 设置超时为2分50秒,若为0则表示不超时,默认为5分钟[H3C-Aux]undo idle-timeout 恢复默认值 [H3C]user-interface vty 0 只支持0和1[H3C-vty]idle-timeout 2 50 设置超时为2分50秒,若为0则表示不超时,默认为5分钟[H3C-vty]undo idle-timeout 恢复默认值[H3C-vty]set authentication password 123456 设置telnet密码,必须设置[H3C-vty]undo set authentication password 取消密码[H3C]display users 显示用户[H3C]display user-interface 显示用户界面状态二.系统IP配置:[H3C]vlan 20[H3C]management-vlan 20[H3C]interface vlan-interface 20 创建并进入管理VLAN [H3C]undo interface vlan-interface 20 删除管理VLAN接口[H3C-Vlan-interface20]ip address 192.168.1.2 255.255.255.0 配置管理VLAN接口静态IP地址(缺省为192.168.0.234)[H3C-Vlan-interface20]undo ip address 删除IP地址[H3C-Vlan-interface20]ip gateway 192.168.1.1 指定缺省网关(默认无网关地址)[H3C-Vlan-interface20]undo ip gateway[H3C-Vlan-interface20]shutdown 关闭接口[H3C-Vlan-interface20]undo shutdown 开启[H3C]display ip 显示管理VLAN接口IP的相关信息[H3C]display interface vlan-interface 20 查看管理VLAN的接口信息<H3C>debugging ip 开启IP调试功能<H3C>undo debugging ip三.DHCP客户端配置:[H3C-Vlan-interface20]ip address dhcp-alloc 管理VLAN接口通过DHCP方式获取IP地址[H3C-Vlan-interface20]undo ip address dhcp-alloc 取消[H3C]display dhcp 显示DHCP客户信息<H3C>debugging dhcp-alloc 开启DHCP调试功能<H3C>undo debugging dhcp-alloc四.端口配置:[H3C]interface Ethernet0/3 [H3C-Ethernet0/3]shutdown[H3C-Ethernet0/3]speed 100 速率,可为10,100,1000和auto(缺省)[H3C-Ethernet0/3]duplex full 双工,可为half,full和auto(缺省) 光口和汇聚后不能配置[H3C-Ethernet0/3]flow-control 开启流控,默认为关闭[H3C-Ethernet0/3]broadcast-suppression 20 设置抑制广播百分比为20%,可取5,10,20,100,缺省为100,同时组播和未知单播也受此影响[H3C-Ethernet0/3]loopback internal 内环测试[H3C-Ethernet0/3]loopback external 外环测试,需插接自环头,必须为全双工或者自协商模式[H3C-Ethernet0/3]port link-type trunk 设置链路的类型为trunk,可为access(缺省),trunk [H3C-Ethernet0/3]port trunk pvidvlan 20 设置20为该trunk的缺省VLAN,默认为1(trunk线路两端的PVID必须一致)[H3C-Ethernet0/3]port access vlan 20 将当前access端口加入指定的VLAN [H3C-Ethernet0/3]port trunk permit vlan all 允许所有的VLAN通过当前的trunk端口,可多次使用该命令[H3C-Ethernet0/3]mdi auto 设置以太端口为自动监测,normal(缺省)为直通线,across为交叉线[H3C]link-aggregation Ethernet 0/1 to Ethernet 0/4 将1-4口加入汇聚组,1为主端口,两端需要同时配置,设置了端口镜像以及端口隔离的端口无法汇聚 [H3C]undo link-aggregation Ethernet 0/1 删除该汇聚组[H3C]link-aggregation mode egress 配置端口汇聚模式为根据目的MAC地址进行负荷分担,可选为 ingress,egress和both,缺省为both[H3C]monitor-port Ethernet 0/2 将该端口设置为镜像端口,必须先设置镜像端口,删除时必须先删除被镜像端口,而且它们不能同在一个端口,该端口不能在汇聚组中,设置新镜像端口时,新取代旧,被镜像不变[H3C]mirroring-port Ethernet 0/3 to Ethernet 0/4 both 将端口3和4设置为被镜像端口,both 为同时监控接收和发送的报文,inbound表示仅监控接收的报文,outbound表示仅监控发送的报文 [H3C]display mirror[H3C]display interface Ethernet 0/3<H3C>reset counters 清除所有端口的统计信息[H3C]display link-aggregation Ethernet 0/3 显示端口汇聚信息[H3C-Ethernet0/3]virtual-cable-test 诊断该端口的电路状况五.VLAN配置:[H3C]vlan 2[H3C]undo vlan all 删除除缺省VLAN外的所有VLAN,缺省VLAN不能被删除[H3C-vlan2]port Ethernet 0/4 to Ethernet 0/7 将4到7号端口加入到VLAN2中,此命令只能用来加access端口,不能用来增加trunk或者hybrid端口[H3C-vlan2]port-isolate enable 打开VLAN内端口隔离特性,不能二层转发,默认不启用该功能[H3C-Ethernet0/4]port-isolate uplink-port vlan 2 设置4为VLAN2的隔离上行端口,用于转发二层数据,只能配置一个上行端口,若为trunk,则建议允许所有VLAN通过,隔离不能与汇聚同时配置[H3C]display vlan all 显示所有VLAN的详细信息S1550E支持基于端口的VLAN,通过创建不同的user-group来实现,一个端口可以属于多个user-group,不属于同一个user-group的端口不能互相通信,最多支持50个user-group[H3C]user-group 20 创建user-group 20,默认只存在user-group 1[H3C-UserGroup20]port Ethernet 0/4 to Ethernet 0/7 将4到7号端口加入到VLAN20中,初始时都属于user-group 1中[H3C]display user-group 20 显示user-group 20的相关信息六.集群配置:S2100只能作为成员交换机加入集群中,加入后系统名改为"集群名_成员编号.原系统名"的格式.即插即用功能通过两个功能实现: 集群管理协议MAC组播地址协商和管理VLAN协商 [H3C]cluster enable 启用群集功能,缺省为启用[H3C]cluster 进入群集视图[H3C-cluster]administrator-address H-H-H name switch H-H-H为命令交换机的MAC,加入switch集群[switch_1.H3C-cluster]undo administrator-address 退出集群[H3C]display cluster 显示集群信息[H3C]management-vlan 2 集群报文只能在管理VLAN中转发,同一集群需在同一个管理VLAN中,需在建立集群之前指定管理VLAN<H3C>debugging cluster七.QoS配置:QoS配置步骤:设置端口的优先级,设置交换机信任报文的优先级方式,队列调度,端口限速[H3C-Ethernet0/3]priority 7 设置端口优先级为7,默认为0[H3C]priority-trust cos 设置交换机信任报文的优先级方式为cos(802.1p优先级,缺省值),还可以设为dscp方式(dscp优先级方式)[H3C]queue-scheduler hq-wrr 2 4 6 8 设置队列调度算法为HQ-WRR(默认为WRR),权重为2,4,6,8[H3C-Ethernet0/3]line-rate inbound 29 将端口进口速率限制为2Mbps,取1-28时,速率为rate*8*1024/125,即64,128,192...1.792M;29-127时,速率为(rate-27)*1024,即2M,3M,4M...100M,千兆时可继续往下取,128-240时,速率为(rate-115)*8*1024,即104M,112M,120M...1000M [H3C]display queue-scheduler 显示队列调度模式及参数 [H3C]display priority-trust 显示优先级信任模式八.系统管理:[H3C]mac-address blackhole H-H-H vlan 1 在VLAN1中添加黑洞MAC[H3C]mac-address static H-H-H interface Ethernet 0/1 vlan 1 在VLAN1中添加端口一的一个mac[H3C]mac-address timer aging 500 设置MAC地址表的老化时间为500s[H3C]display mac-address [H3C]display arp[H3C]mac-address port-binding H-H-H interface Ethernet 0/1 vlan 1 配置端口邦定[H3C]display mac-address port-binding [H3C]display saved-configuration [H3C]display current-c onfiguration <H3C>save[H3C]restore default 恢复交换机出厂默认配置,恢复后需重启才能生效[H3C]display version <H3C>reboot[H3C]display device [H3C]sysnamebigheap[H3C]info-center enable 启用系统日志功能,缺省情况下启用[H3C]info-center loghostip 192.168.0.3 向指定日志主机(只能为UNIX或LINUX,不能为Windows)输出信息,需先开启日志功能,缺省关闭[H3C]info-center loghost level 8 设置系统日志级别为8,默认为5.级别说明:1.emergencies 2.alerts 3.critical 4.errors 5.warnings 6.notifications rmational 8.debuggin g<H3C>terminal debugging 启用控制台对调试信息的显示,缺省控制台为禁用<H3C>terminal logging 启用控制台对日志信息的显示,缺省控制台为启用<H3C>terminal trapping 启用控制台对告警信息的显示,缺省控制台为启用[H3C]display info-center 显示系统日志的配置和缓冲区记录的信息[H3C]display logbuffer 显示日志缓冲区最近记录的指定数目的日志信息[H3C]display trapbuffer 显示告警缓冲区最近记录的指定数目的日志信息<H3C>reset logbuffer 清除日志缓冲区的信息 <H3C>reset trapbuffer 清除告警缓冲区的信息九.网络协议配置:NDP即是邻居发现协议,S1550E只能开启或关闭NDP,无法配置,默认有效保留时间为180s,NDP报文发送的间隔60s[H3C]ndp enable 缺省情况下是开启的[H3C-Ethernet0/3]ndp enable 缺省情况下开启 [H3C]display ndp 显示NDP配置信息[H3C]display ndp interface Ethernet 0/1 显示指定端口NDP发现的邻居信息 <H3C>debugging ndp interface Ethernet 0/1HABP协议即Huawei Authentication Bypass Protocol,华为鉴权旁路协议,是用来解决当交换机上同时配置了802.1x和HGMPv1/v2时,未经授权和认证的端口上将过滤HGMP报文,从而使管理设备无法管理下挂的交换机的问题。

HC交换机常用配置命令完整版

HC交换机常用配置命令完整版

H C交换机常用配置命令集团标准化办公室:[VV986T-J682P28-JP266L8-68PNN]H3C?交换机常用配置命令1、配置主机名[H3C]systemnameH3C2、配置console口密码#进入系统视图。

<H3C>system-view#进入AUX用户界面视图。

[H3C]user-interfaceaux0#设置通过Console口登录交换机的用户进行Password认证。

[H3C-ui-aux0]authentication-modepassword#设置用户的认证口令为加密方式,口令为123456。

[H3C-ui-aux0]setauthenticationpasswordcipher123456#设置从AUX用户界面登录后可以访问的命令级别为2级。

[H3C-ui-aux0]userprivilegelevel23、配置Telnet#进入系统视图。

<H3C>system-view#进入VTY0用户界面视图。

[H3C]user-interfacevty0#设置通过VTY0口登录交换机的用户进行Password认证。

[H3C-ui-vty0]authentication-modepassword#设置用户的认证口令为密码方式,口令为123456。

[H3C-ui-vty0]setauthenticationpasswordcipher123456#设置从VTY0用户界面登录后可以访问的命令级别为2级。

[H3C-ui-vty0]userprivilegelevel2#设置VTY0用户界面支持Telnet协议。

[H3C-ui-vty0]protocolinboundtelnet4、配置交换机VLAN1管理地址<H3C>system-view[H3C]interfacevlan-interface1[H3C-VLAN-interface1]ipaddress5、配置交换机网关地址[H3C]iproute-static6、配置HTTP服务[H3C]local-useradmin?#创建http用户[H3C-luser-admin]service-typetelnet?[H3C-luser-admin]authorization-attributelevel3[H3C-luser-admin]passwordcipheradmin#设置http用户密码,并加密显示7、配置SNMP[H3C]snmp-agent[H3C]snmp-agentcommunityread123456#设置snmp团体名称,权限为只读[H3C]snmp-agentsys-infoversionv1v2c?#设置snmp版本v1和v28、Qos端口限速[H3C]interfacegigabitethernet1/0/1#配置限速参数,端口进/出速率限制为5120kbps。

华为3层交换基本命令

华为3层交换基本命令

华为3层交换基本命令system-view 进入配置模式quit 退出至上一级模式sysname LanShanJiaoYu 更改交换机名称(配置模式下)display clock 显示交换机时间dis current-configuration 查看当前交换机配置display interface Vlanif 查看三层vlan接口配置信息display interface Ethernet0/0/0 查看Ethernet0/0/0端口状态display interface GigabitEthernet 1/0/1 查看GE 1/0/1端口状态display logbuffer 查看log日志display trapbuffer 查看告警日志display vlan 查看vlandisplay ip routing-table 查看路由vlan 10 创建vlan(或者进入vlan)(配置模式下)vlan batch 10 to 100 批量创建vlan 10-100 (配置模式下)interface Ethernet0/0/0 进入Ethernet0/0/0 (配置模式下)interface GigabitEthernet 1/0/1 进入GigabitEthernet 1/0/1 (配置模式下)interface Vlanif 100 进入三层vlan接口(配置模式下)user-interface vty 0 14 进入虚拟终端接口(配置模式下)description 4lou 描述(注释)(接口配置模式下)ip address 10.18.14.1 255.255.255.128 配置ip地址(vlan接口配置模式下)undo ip address 10.18.14.1 255.255.255.128 删除ip地址(vlan接口配置模式下)ip route-static 0.0.0.0 0.0.0.0 10.17.254.141 配置缺省路由(配置模式下)undo ip route-static 0.0.0.0 0.0.0.0 10.17.254.141 删除缺省路由(配置模式下)undo port hybrid tagged vlan 1023 删除hybrid tagged vlan 1023(接口配置模式下)port link-type trunk 设置端口类型为trunk(接口配置模式下)port link-type access 设置端口类型为access(接口配置模式下)port trunk allow-pass vlan 12 236 允许vlan 12 236两个vlan 通过(接口配置模式下)undo port trunk allow-pass vlan 12 236 删除(禁止)vlan 12 236通过(接口配置模式下)port default vlan 1000 将端口设置到vlan 1000内(接口配置模式下)undo port default vlan 删除端口vlan(接口配置模式下)aaa 进入AAA模式(配置模式下)local-user lsjy password cipher lsjy 创建本地用户lsjy,密码为密文local-user lsjy privilege level 3 设置用户操作权限local-user lsjy service-type telnet 设置用户登录类型为telnet端口和mac地址的绑定配置命令:mac-address static 00e0-fc22-f8d3 GigabitEthernet1/0/1 vlan 211终端mac地址的查看:通过cmd窗口输入ipconfig /all通过交换机的端口查看学习上来的mac:display mac-address dynamic GigabitEthernet1/0/1IP地址和mac地址的绑定配置命令:在配置模式下,输入arp static 10.1.1.2 00e0-fc22-f8d3完成对PC机的IP地址和MAC地址的全局绑定。

三层交换机 H3C交换机配置(三层交换机配置流程)

三层交换机 H3C交换机配置(三层交换机配置流程)

For personal use only in study and research;1.恢复到出厂设置->2.连接Trunk端口,设置Vlan1(管理Vlan)的IP地址,确保交换机互联互通->3.开启所有交换机的Telnet服务->4.从下至上依次配置Vlan,在三层交换机上配置Vlan接口地址(本Vlan的网关)->5.在三层交换机上配置服务器Vlan->6.在三层交换机上配置到汇聚层交换机的端口。

---------------------------------------------------------------------------------------一、初始化Reset save //删除保存配置Reboot //重启二、交换机之间实现互联互通登录3100,输入如下命令:System-viewInterface vlan-interface 1 //进入默认的VLAN端口,vlan 1Ip address 192.168.1.4 24 //设置本机在VLAN 1 中的IP 地址Quitsave登录5100,输入如下命令:System-viewInterface vlan-interface 1Ip address 192.168.1.2 24Quitsave登录5600,输入如下命令:System-viewInterface vlan-interface 1Ip address 192.168.1.1 24Quitsave在3100上输入:Ping 192.168.1.1Ping 192.168.1.2同理在5100上也输入:Ping 192.168.1.1Ping 192.168.1.4同理在5600上也输入:Ping 192.168.1.2Ping 192.168.1.4至此,交换机之间的管理vlan 就可以互相通信。

三、开启TELNET登录3100,输入如下命令:System-viewUser-interface vty 0 4 //进入用户端口Authenticate-mode scheme //设置认证模式Protocol inbound all //允许telnet 和RSH 访问User privilege level 3 //设置访问级别QuitLocal-user iamcat //创建本地用户Password simple xxxxxx //设置密码Service-type telnet //访问服务类型:telnetLevel 3 //设置授权访问级别QuitSave在5100或5600上,即可用telnet 192.168.1.4配置3100交换机。

HC华为交换机配置命令大全

HC华为交换机配置命令大全

H C华为交换机配置命令大全Revised final draft November 26, 2020H3C交换机配置命令大全1、system-view进入系统视图模式2、sysname为设备命名3、displaycurrent-configuration当前配置情况4、language-modeChinese|English中英文切换5、interfaceEthernet1/0/1进入以太网端口视图6、portlink-typeAccess|Trunk|Hybrid设置端口访问模式7、undoshutdown打开以太网端口8、shutdown关闭以太网端口9、quit退出当前视图模式10、vlan10创建VLAN10并进入VLAN10的视图模式11、portaccessvlan10在端口模式下将当前端口加入到vlan10中12、portE1/0/2toE1/0/5在VLAN模式下将指定端口加入到当前vlan中13、porttrunkpermitvlanall允许所有的vlan通过H3C路由器1、system-view进入系统视图模式2、sysnameR1为设备命名为R13、displayiprouting-table显示当前路由表4、language-modeChinese|English中英文切换5、interfaceEthernet0/0进入以太网端口视图6、ipaddress配置IP地址和子网掩码7、undoshutdown打开以太网端口8、shutdown关闭以太网端口9、quit退出当前视图模式10、iproute-staticdescriptionTo.R2配置静态路由11、iproute-static0.0.0.0descriptionTo.R2配置默认的路由H3CS3100SwitchH3CS3600SwitchH3CMSR20-20Router1、调整超级终端的显示字号;2、捕获超级终端操作命令行,以备日后查对;3、language-modeChinese|English中英文切换;4、复制命令到超级终端命令行,粘贴到主机;5、交换机清除配置:<H3C>resetsave;<H3C>reboot;6、路由器、交换机配置时不能掉电,连通测试前一定要检查网络的连通性,不要犯最低级的错误。

H3C华三交换机基本配置命令大全,别到用的时候找不到了

H3C华三交换机基本配置命令大全,别到用的时候找不到了

H3C华三交换机基本配置命令大全,别到用的时候找不到了!本期我们一起来学习一下H3C最详细的基础命令。

一、不知道密码,如何恢复出厂设置1、开机启动,Ctrl+B进入bootrom菜单,选择恢复出厂设置。

2、用com线连上电脑,用超级终端进入,然后重启电脑,看提示按ctrl+b 进入bootrom模式,然后按照菜单提示删除flash中的.cfg文件,然后重启就可以了。

二、将Trunk端口添加到vlan中Trunk端口可以允许多个VLAN通过,也就是可以加入多个VLAN,所以Trunk 端口的VLAN加入不可能是一个一个地加,而是采取批量添加的方式进行。

但只能在以太网端口视图下进行配置,配置步骤如表7-11所示。

【示例1】使用port trunk permit vlan命令将中继端口Ethernet2/0/1加入到2、6、10、50~100 VLAN中。

1. <H3C> system-view2. System View: return to User View with Ctrl+Z.3. [H3C] interface Ethernet2/0/14. [H3C-Ethernet2/0/1] port trunk permit vlan 2 6 10 50 to 100【示例2】使用undo port trunk permit vlan命令将中继端口Ethernet2/0/1从VLAN 1中删除。

三、H3C交换机基础配置说明1、以太网端口的链路类型Access link:只能允许某一个vlan的untagged数据流通过。

Trunk link:允许多个vlan的tagged数据流和某一个vlan的untagged数据流通过。

Hybrid link:允许多个vlan的tagged数据流和多个vlan的untagged数据流通过。

hybrid link端口可以允许多个vlan的报文发送时不携带标签,而Trunk端口只允许缺省vlan的报文发送时不携带标签。

华三交换机-路由器配置命令

华三交换机-路由器配置命令

华三交换机-路由器配置命令华三交换机-路由器配置命令第一章:登录华三交换机-路由器1. 使用浏览器登录:a. 打开浏览器;b. 在地址栏中输入交换机-路由器的IP地址;c. 输入正确的用户名和密码;d. 单击登录按钮。

2. 使用命令行登录:a. 打开命令提示符或终端窗口;b. 输入telnet或ssh命令,后跟交换机-路由器的IP地址;c. 输入正确的用户名和密码;d. 按下回车键登录。

第二章:基本配置1. 设置主机名:hostname [主机名]2. 设置登录密码:enable password [密码]3. 配置管理接口:interface [接口]ip address [IP地址] [子网掩码] 4. 配置默认网关:ip default-gateway [默认网关]第三章:VLAN(虚拟局域网)配置1. 创建VLAN:vlan [VLAN号]name [VLAN名称]2. 配置端口―VLAN关联:interface [端口]switchport mode accessswitchport access vlan [VLAN号] 3. 配置交换机端口为Trunk口:interface [端口]switchport mode trunk第四章:路由配置1. 静态路由配置:ip route [目标网络] [目标子网掩码] [下一跳IP地址] 2. OSPF(开放最短路径优先)配置:router ospf [进程号]network [网络地址] [通配符] area [区域号]3. BGP(边界网关协议)配置:router bgp [自治系统号]neighbor [对等体IP地址] remote-as [对等体自治系统号]第五章:安全配置1. 配置SSH(安全外壳协议):crypto key generate rsaip ssh server enable2. 配置访问控制列表(ACL):ip access-list [ACL名称]permit/deny [源IP地址] [目标IP地址] [协议]第六章:性能优化配置1. 配置端口速率限制:interface [端口]bandwidth [带宽]2. 配置端口链路聚合(LACP):interface port-channel [聚合组号]channel-group [组号] mode active3. 配置端口流量控制:interface [端口]storm-control [选项]附件:本文档涉及的附件可在[link]。

计算机三级交换机配置命令总结

计算机三级交换机配置命令总结

考点1:交换机基本配置Switch>enable(进入特权模式)Switch#config terminal(进入全局配置模式)Switch#copy running-config startup-config(保存配置文件)1、在全局配置模式下:Switch-3528-TEST(config)#hostname <name> (修改交换机主机名)Switch-3528-TEST(config)#no hostname <name> (删除交换机的主机名,恢复默认值)Switch-3528-TEST(config)#enable secret 5 <password>(配置超级用户加密口令)Switch-3528-TEST(config)#enable password <password>(配置超级用户明文口令)Switch-3528-TEST(config)#enable password 7 <password>(配置超级用户加密口令)Switch-3528-TEST(config)#clock set <hh:mm:ss day month year>(修改系统时间)配置设备管理IP地址:设置VLAN1接口地址为192.168.1.1,子网掩码为255.255.255.0。

Switch-3528-TEST(config)#interface VLAN1Switch-3528-TEST(config-if)#ip address 192.168.1.1 255.255.255.0设置默认路由Switch-3528-TEST(config-if)#ip default-gateway 192.168.1.254Switch(config)#line vty 0 4(对0-4号Telnet虚拟终端配置模式也即进程模式)2、在进程配置模式下:Switch-3528-TEST(config-line)#password 7 <password>(配置远程登录加密口令)Switch-3528-TEST(config-line)#password <password>(配置远程登录明文口令)Switch-3528-TEST(config-line)#exit (退出到全局配置模式)3、在端口配置模式下:Switch-3528-TEST(config-if)#description <text>(配置端口描述信息)Switch-3528-TEST(config-if)#no shutdown(开启当前交换机端口)Switch-3528-TEST(config-if)#shutdown(关闭当前交换机端口)Switch-3528-TEST(config-if)#duplex full/half/auto(设置端口通信方式为全双工/半双工/自适应方式)Switch-3528-TEST(config-if)#speed 10/100/1000/auto(设置端口传输速率为10Mbps/100Mbps/1000bps/自适应)考点2:VLAN和VTP配置1、VLAN基本配置Switch(config)#vlan database(进入VLAN配置子模式)在VLAN配置子模式下:Switch(vlan)#vlan <vlan_ID> name <vlan_name>(创建vlan<id>并命名为<vlan_name>)Switch(vlan)#no vlan <vlan_ID>(删除vlan<id>)Switch(vlan)# vlan 100 name vlangroup(vlan100名称修改为vlangroup)2. VLAN Trunk配置Switch-3528-TEST#configure terminal (进入交换机端口配置模式)Switch-3528-TEST(config)#int fo/24Switch-3528-TEST(config-if)#switchport mode trunk(进入VLAN Trunk模式,必须设)Switch-3528-TEST(config-if)#switchport trunk encapsulation dotl q (配置VLAN Trunk的封装模式为802.1q)Switch-3528-TEST(config-if)#switchport trunk encapsulation isl (封装ISL协议)Switch-3528-TEST(config-if)#switchport trunk encapsulation negotiate P (自动协商)注:自动协商(即自适应)协议的功能,要求Cisco硬件支持ISL和802.1Q两个协议。

华为三层交换机配置方法、命令及实例

华为三层交换机配置方法、命令及实例

华为三层交换机配置方法(1)(2008-07-21 11:27:34)转载标签:分类:工作汇报杂谈本文以河南平临高速所使用的华为华三通信的H3C S3600-28P-SI为例,配置前首先要确定型号后缀是SI还是EI,EI的支持所有协议,SI的不支持OSPS动态协议,因此SI配置路由时可以使用静态协议和RIP协议,具体配置如下:<H3C>system-view //进入系统视图[H3C]display current-configuration //显示当前配置//以下开始配置//第一步:划分VLAN,并描述vlan 1description local-S3600vlan 2description link-to-wenquanvlan 3description link-to-ruzhouvlan 4description link-to-xiaotunvlan 5description link-to-baofengvlan 6description link-to-pingxivlan 7description link-to-pingnanvlan 8description Uplink-to-Putianvlan 9description link-to-pingxicentre//第二步:给VLAN 划网关interface Vlan-interface2description link to wenquanip address 10.41.77.41 255.255.255.192 interface Vlan-interface3description link to ruzhouip address 10.41.77.105 255.255.255.192 interface Vlan-interface4description link to xiaotunip address 10.41.77.169 255.255.255.192 interface Vlan-interface5description link to baofengip address 10.41.77.233 255.255.255.192 interface Vlan-interface6description link to pingxiip address 10.41.78.41 255.255.255.192 interface Vlan-interface7description link to pingnanip address 10.41.78.105 255.255.255.192 interface Vlan-interface8description uplink to putianip address 10.41.244.102 255.255.255.252 interface Vlan-interface9description link to pingxicentreip address 10.41.80.233 255.255.255.192//第三步:给VLAN 指定端口interface Ethernet1/0/2description link to wenquanport access vlan 2interface Ethernet1/0/3description link to ruzhouport access vlan 3interface Ethernet1/0/4description link to xiaotunport access vlan 4interface Ethernet1/0/5description link to baofengport access vlan 5interface Ethernet1/0/6description link to pingxiport access vlan 6interface Ethernet1/0/7description link to pingnanport access vlan 7interface Ethernet1/0/8description uplink to putianport access vlan 8interface Ethernet1/0/9 to Ethernet1/0/24 description link to pingxicentreport access vlan 9//第四步:配置路由协议//(1)用RIP配动态路由ripnetwork 10.41.77.41network 10.41.77.105network 10.41.77.169network 10.41.77.233network 10.41.78.41network 10.41.78.105network 10.41.80.233network 10.41.244.102//(2)配静态路由(只用对远Enable //进入私有模式Configure terminal //进入全局模式service password-encryption //对密码进行加密hostname Catalyst 3550-12T1 //给三层交换机定义名称enable password 123456. //enable密码Enable secret 654321 //enable的加密密码(应该是乱码而不是654321这样)Ip subnet-zero //允许使用全0子网(默认都是打开的)Ip name-server 172.16.8.1 172.16.8.2 //三层交换机名字Catalyst 3550-12T1对应的IP地址是172.16.8.1Service dhcp //提供DHCP服务ip routing //启用三层交换机上的路由模块ExitVtp mode server //定义VTP工作模式为sever模式Vtp domain centervtp //定义VTP域的名称为centervtpVlan 2 name vlan2 //定义vlan并给vlan取名(如果不取名的话,vlan2的名字应该是vlan002)Vlan 3 name vlan3Vlan 4 name vlan4Vlan 5 name vlan5Vlan 6 name vlan6Vlan 7 name vlan7Vlan 8 name vlan8Vlan 9 name vlan9Exitinterface Port-channel 1 //进入虚拟的以太通道组1Interface gigabitethernet 0/1 //进入模块0上的吉比特以太口1channel-group 1 mode on //把这个接口放到快速以太通道组1中Interface gigabitethernet 0/2 //同上channel-group 1 mode onport-channel load-balance src-dst-ip //定义快速以太通道组的负载均衡方式(依靠源和目的IP的方式)interface gigabitethernet 0/3 //进入模块0上的吉比特以太口3interface gigabitethernet 0/4 //同上interface gigbitethernet 0/5 //同上interface gigbitethernet 0/6 //同上interface gigbitethernet 0/7 //进入模块0上的吉比特以太口7no shutdownspanning-tree vlan 6-9 cost 1000 //在生成树中,vlan6-9的开销定义为10000 interface range gigabitethernet 0/8 – 10 //进入模块0上的吉比特以太口8,9,10no shutdownspanning-tree portfast //在这些接口上使用portfast(使用portfast以后,在生成树的时候不参加运算,直接成为转发状态)interface gigabitethernet 0/11 //进入模块0上的吉比特以太口11interface gigabitethernet 0/12 //同上interface vlan 1 //进入vlan1的逻辑接口(不是物理接口,用来给vlan做路由用)ip address 172.16.1.7 255.255.255.0 //配置IP地址和子网掩码no shutdownstandby 1 ip 172.16.1.9 //开启了冗余热备份(HSRP),冗余热备份组1,虚拟路由器的IP地址为172.16.1.9standby 1 priority 110 preempt //定义这个三层交换机在冗余热备份组1中的优先级为110,preempt是用来开启抢占模式interface vlan 2 //同上ip address 172.16.2.252 255.255.255.0no shutdownstandby 2 ip 172.16.2.254standby 2 priority 110 preemptip access-group 101 in //在入方向上使用扩展的访问控制列表101interface vlan 3 //同上ip address 172.16.3.252 255.255.255.0no shutdownstandby 3 ip 172.16.3.254standby 3 priority 110 preemptip access-group 101 ininterface vlan 4 //同上ip address 172.16.4.252 255.255.255.0no shutdownstandby 4 ip 172.16.4.254standby 4 priority 110 preemptip access-group 101 ininterface vlan 5ip address 172.16.5.252 255.255.255.0no shutdownstandby 5 ip 172.16.5.254standby 5 priority 110 preemptip access-group 101 ininterface vlan 6ip address 172.16.6.252 255.255.255.0no shutdownstandby 6 ip 172.16.6.254standby 6 priority 100 preemptinterface vlan 7ip address 172.16.7.252 255.255.255.0no shutdownstandby 7 ip 172.16.7.254standby 7 priority 100 preemptinterface vlan 8ip address 172.16.8.252 255.255.255.0standby 8 ip 172.16.8.254standby 8 priority 100 preemptinterface vlan 9ip address 172.16.9.252 255.255.255.0no shutdownstandby 9 ip 172.16.9.254standby 9 priority 100 preemptaccess-list 101 deny ip any 172.16.7.0 0.0.0.255 //扩展的访问控制列表101access-list 101 permit ip any anyInterface vlan 1 //进入vlan1这个逻辑接口Ip helper-address 172.16.8.1 //可以转发广播(helper-address的作用就是把广播转化为单播,然后发向172.16.8.1)Interface vlan 2Ip helper-address 172.16.8.1Interface vlan 3ip helper-address 172.16.8.1interface vlan 4ip helper-address 172.16.8.1interface vlan 5ip helper-address 172.16.8.1interface vlan 6ip helper-address 172.16.8.1interface vlan 7ip helper-address 172.16.8.1interface vlan 9ip helper-address 172.16.8.1router rip //启用路由协议RIPversion 2 //使用的是RIPv2,如果没有这句,则是使用RIPv1network 172.16.0.0 //宣告直连的网段exitip route 0.0.0.0 0.0.0.0 172.16.9.250 //缺省路由,所有在路由表中没有办法匹配的数据包,都发向下一跳地址为172.16.9.250这个路由器line aux 0line vty 0 15 //telnet线路(路由器只有5个,是0-4)password 12345678 //login密码loginendcopy running-config startup-config 保存配置cisco 3550Switch# configure terminalSwitch(config)#vtp mode transparentSwitch(config)#vlan 10Switch(config-vlan)# name vlan10Switch(config)#exitSwitch(config)#vlan 11Switch(config-vlan)name vlan11Switch(config-vlan)endSwitch#configure terminalSwitch(config)#interface fastethernet0/9Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#exitSwitch(config)#interface fastethernet0/10Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#exitSwitch(config)#interface fastethernet0/11Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 11Switch(config-if)#exitSwitch(config)#interface fastethernet0/12Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 11Switch(config-if)#exitSwitch(config)#interface vlan10Switch(config-if)#ip address 192.168.0.1 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#interface vlan11Switch(config-if)#ip address 192.168.1.1 255.255.255.0Switch(config-if)#no shutdownSwitch(config-if)#exitSwitch(config)#ip routingSwitch(config)#ip forward-protocol udpSwitch(config)#inter vlan 10ip helper 172.16.11.255 //这个命令又是什么意思?是不是转发整个网段的UDP协议?为什么用到了172.16.11.255这个地址?Switch(config)#exitSwitch(config)#inter vlan 11Switch(config-if)#ip helper 172.16.10.255 //同上?Switch(config-if)#exitSwitch(config)#ip route 0.0.0.0 0.0.0.0 Vlan10Switch(config)#ip route 0.0.0.0 0.0.0.0 Vlan11Switch(config)#conf tSwitch(config)#access-list 103 permit ip 172.16.11.0 0.0.0.255 172.16.10.0 0.0.0.255 Switch(config)#access-list 103 permit udp any any eq bootpcSwitch(config)#access-list 103 permit udp any any eq tftpSwitch(config)#access-list 103 permit udp any eq bootpc anySwitch(config)#access-list 103 permit udp any eq tftp anySwitch(config)#inter vlan 10Switch(config-if)#ip directed-broadcast 103 //请解释一下这个的具体含义,本人不是太明白,懂一点意思(直接广播这个列表?是不是)Switch(config-if)#exitSwitch(config)#access-list 104 permit ip 172.16.10.0 0.0.0.255 172.16.11.0 0.0.0.255 Switch(config)#access-list 104 permit udp any any eq bootpcSwitch(config)#access-list 104 permit udp any any eq tftpSwitch(config)#access-list 104 permit udp any eq bootpc anySwitch(config)#access-list 104 permit udp any eq tftp anySwitch(config)#inter vlan 11Switch(config-if)#ip directed-broadcast 104 //同上Switch(config)#endSwitch#copy run star华为三层交换机配置实例一例网络技术2008-07-25 06:08:28 阅读243 评论0 字号:大中小订阅华为三层交换机配置实例一例服务器1双网卡,内网IP:192.168.0.1,其它计算机通过其代理上网PORT1属于VLAN1PORT2属于VLAN2PORT3属于VLAN3VLAN1的机器可以正常上网配置VLAN2的计算机的网关为:192.168.1.254配置VLAN3的计算机的网关为:192.168.2.254即可实现VLAN间互联如果VLAN2和VLAN3的计算机要通过服务器1上网则需在三层交换机上配置默认路由系统视图下:ip route-static 0.0.0.0 0.0.0.0 192.168.0.1然后再在服务器1上配置回程路由进入命令提示符route add 192.168.1.0 255.255.255.0 192.168.0.254route add 192.168.2.0 255.255.255.0 192.168.0.254这个时候vlan2和vlan3中的计算机就可以通过服务器1访问internet了~~华为路由器与CISCO路由器在配置上的差别"华为路由器与同档次的CISCO路由器在功能特性与配置界面上完全一致,有些方面还根据国内用户的需求作了很好的改进。

H3C交换机基本配置命令明细

H3C交换机基本配置命令明细

H3C交换机基本配置命令明细1:配置登录用户,口令等//用户直行模式提示符,用户视图system-view //进入配置视图[H3C] //配置视图(配置密码后必须输入密码才可进入配置视图)[H3C] sysname //设置主机名成为这里使用修改特权用户密码system-view[H3C]super password level 3 cipher/simple //设置本地登录交换机命令[H3C] aaa //进入aaa认证模式定义用户账户[H3C-aaa] local-user duowan password cipher duowan[H3C-aaa] local-user duowan level 15[H3C-aaa] local-user duowan service-type telnet terminal ssh //有时候这个命令是最先可以运 //行的,上边两个命令像password,level都是定义完vty 的 // authentication-mode aaa后才出现[H3C-aaa] quit[H3C] user-interface vty 0 4 //当时很奇怪这个命令就是找不到,最后尝试了几次才能运行[H3C-ui-vty0-4] authentication-mode aaa[H3C-ui-vty0-4] quit单独设置远程登录账户:system-view[H3C]user-interface vty 0 4[H3C-ui-vty0-4]authentication-mode password //设置登录模式[H3C-ui-vty0-4]user privilege level 3 //管理权限配置,3为管理级权限[H3C-ui-vty0-4]set authentication password cipher //设置登录密码以密文方式登录[H3C-ui-vty0-4]quit[H3C]2:H3C VLan设置创建vlan://用户直行模式提示符,用户视图system-view //进入配置视图[H3C] vlan 10 //创建vlan 10,并进入vlan10配置视图,如果vlan10存在就直接进入vlan10配置视图[H3C-vlan10] quit //回到配置视图[H3C] vlan 100 //创建vlan 100,并进入vlan100配置视图,如果vlan10存在就直接进入vlan100配置视图[H3C-vlan100] quit //回到配置视图将端口加入到vlan中:[H3C] interface GigabitEthernet2/0/1 (10G光口)[H3C- GigabitEthernet2/0/1] port link-type access //定义端口传输模式[H3C- GigabitEthernet2/0/1] port default vlan 100 //将端口加入vlan100[H3C- GigabitEthernet2/0/1] quit[H3C] interface GigabitEthernet1/0/0 //进入1号插槽上的第一个千兆网口配置视图中。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

H C三层交换机配置命令 Revised by Liu Jing on January 12, 2021
H3C三层交换机配置命令[Quidway]dis cur ;显示当前配置
[Quidway]display current-configuration ;
显示当前配置
[Quidway]display interfaces ;
显示接口信息
[Quidway]display vlan all? ;显示路由信息[Quidway]display version ;
显示版本信息
[Quidway]super password ;修改特权用户密码[Quidway]sysname ;
交换机命名
[Quidway]interface ethernet 0/1? ;进入接口视图[Quidway]interface vlan x ;
进入接口视图
[Quidway]ip route-static 0.0.0
[Quidway]rip? ;三层交换支持
[Quidway]local-user ftp
增加用户名
[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 ;用户级别
[Quidway]interface ethernet 0/1 ;进入端口模式
[Quidway]int e0/1 ;
进入端口模式
[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]port access vlan 3 ;
当前端口加入到VLAN
[Quidway-Ethernet0/2]port trunk permit vlan {ID|All}
;设trunk允许的VLAN
[Quidway-Ethernet0/3]port trunk pvid vlan 3 ;
设置trunk端口的PVID
[Quidway-Ethernet0/1]undo shutdown ;
激活端口
[Quidway-Ethernet0/1]shutdown ;
关闭端口
[Quidway-Ethernet0/1]quit ;返回
[Quidway]vlan 3? ;创建VLAN
[Quidway-vlan3]port ethernet 0/1 ;
在VLAN中增加端口
[Quidway-vlan3]port e0/1 ;
简写方式
[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 ;
在VLAN中增加端口
[Quidway-vlan3]port e0/1 to e0/4 ;
简写方式
[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 ;指定镜像和被镜像
[Quidway]description string ;指定VLAN描述字符
[Quidway]description ;
删除VLAN描述字符
[Quidway]display vlan [vlan_id] ;查看VLAN设置
[Quidway]stp {enable|disable} ;设置生成树,默认关闭[Quidway]stp priority 4096 ;
设置交换机的优先级
[Quidway]stp root {primary|secondary}
;设置为根或根的备份
[Quidway-Ethernet0/1]stp cost 200 ;设置交换机端口的花费[Quidway]link-aggregation e0/1 to e0/4 ingress|both ; 端口的聚合
[Quidway]undo link-aggregation e0/1|all ; 始端口为通道号[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.。

相关文档
最新文档