H3C交换机基本配置命令 下载本文

内容发布更新时间 : 2024/5/3 20:07:54星期一 下面是文章的全部内容请认真阅读。

//创建二层ACL并进入二层ACL视图

description text //(可选)定义ACL的描述信息 step step-value //(可选)定义ACL规则编号步长

rule [rule-id]{deny | permit } [cos vlan-pri |counting |dest-mac dest-addr dest-mask |{lsap lsap-type lsap-type-mask |type protocol-type protocol-type-mask } |source-mac sour-addr source-mask |time-range time-range-name ]* //定义二层ACL规则

rule rule-id comment text //(可选)为指定的规则配置描述信息

hardware-count enable //(可选)开启基于硬件应用的ACL统计功能

(4)ACL应用配置

acl copy {source-acl-number |name source-acl-name} to {dest-acl-number |name dest-acl-name} //ACL复制

packet-filter vlan vlan-id inbound acl-rule

//(可选)在指定VLAN中应用ACL,对VLAN中的所有端口上接收到的数据包进行过滤

8. QoS配置

(1)定义流分类和匹配规则; (2)定义流行为;

(3)定义QoS策略,并将流分类和流行为绑定在一起; (4)应用QoS策略。

? 定义流分类

traffic classifier tcl-name [operator {and |or }] //定义一个流分类,并进入类视图 if-match match-criteria //定义对应流分类的匹配规则

? 定义流行为

traffic behavior behavior-name //定义流行为,并进入流行为视图

? 定义QoS策略

qos policy policy-name //定义策略并进入视图

classifier tcl-name behavior behavior-name [mode {dcbx |dot1q-tag-manipulation}] //在策略中为类指定采用的流行为

? 应用QoS策略

1) 基于全局应用QoS策略

qos apply policy policy-name global {inbound |outbound} 2) 基于端口应用QoS策略

qos apply policy policy-name {inbound |outbound} 3) 基于在线用户应用QoS策略

user-profile profile-name //创建User Profile并进入相应的user-profile视图 qos apply policy policy-name {inbound |outbound} //在对应的在线用户上应用指定关联的QoS策略

user-profile profile-name enable //激活User profile 4) 基于VLAN应用QoS策略

qos vlan-policy policy-name vlan vlan-id-list {inbound |outbound} 5) 基于控制平面应用QoS策略

control-plane slot slot-number //进入控制平面视图

qos apply policy policy-name inbound //在控制平面入方向上应用指定的QoS策略

9. IRF配置

(1)Fabric端口配置

fabric-port interface-type interface-number enable //在系统视图下开启Fabric端口

interface interface-type interface-number

port link-type irf-fabric //在对应以太网端口视图下将对应以太网端口配置为Fabric端口 (2)UnitID配置

change self-unit to {unit-id | auto-numbering} //系统视图下配置本地交换机的UnitID 1) 更改当前交换机的UnitID

change unit-id to unit-id | auto-numbering 2) 修改堆叠中其他交换机的UnitID

change unit-id unit-id1 to {unit-id2 | auto-numbering} 3) 保存或取消设置更改 fabric save-unit-id

10. IRF2配置

(1)IRF基本配置

irf domain domain-id //IRF域编号配置 irf member member-id renumber new-member-id //IRF2成员编号配置 (2)IRF2端口配置

irf-port member-id/port-number //创建IRF2逻辑端口,进入IRF2逻辑端口视图 port group interface interface-type interface-number [mode {enhanced |normal }] //将IRF2逻辑端口和IRF2物理端口绑定

irf-port-configuration active //激活设备中所有IRF2逻辑端口下的配置 (3)IRF2成员优先级配置

irf member member-id priority priority (4)IRF2成员设备描述信息配置

irf member member-id description text (5)IRF2链路负载分担类型配置

irf-port load-sharing mode {destination-ip |destination-mac |source-ip |source-mac}* (6)IRF2的桥MAC保留时间配置 irf mac-address persistent {timer |always}

(7)启用IRF2系统启动文件的自动加载功能 irf auto-update enable

(8)IRF2链路down延迟上报功能配置 irf link-delay interval

(9)IRF2 MAD配置

IRF2支持多IRF2的三种MAD检测方式:LACP MAD检测、BFD MAD检测、ARP MAD检测。

① LACP MAD检测配置

interface bridge-aggregation interface-number

//创建二层聚合接口和二层聚合组,并进入二层聚合端口视图 link-aggregation mode dynamic

//配置以上聚合组工作在动态聚合模式下

mad enable //在以上静态聚合组中启用LACP MAD检测功能 interface interface-type interface-number

port link-aggregation group number //将以上二层以太网端口加入到指定的聚合组

② BFD MAD检测

interface vlan-interface interface-number

mad bfd enable //在以上VLAN接口上启用BFD MAD检测功能

mad ip address ip-address {mask |mask-length} member member-id //为指定成员设备的以上VLAN接口配置MAD IP地址

③ ARP MAD检测

interface vlan-interface interface-number ip address ip-address {mask |mask-length}

mad arp enable //在以上VLAN接口上启用ARP MAD检测功能

11. ARP配置

arp static ip-address mac-address [vlan-id interface-type interface-number] //手工添加静态ARP表项,相当于IP与MAC地址的静态绑定

arp timer aging aging-time //配置动态ARP表项的老化时间 arp check enable //开启ARP表项的检查功能

display arp [dynamic |static | ip-address ] //显示当前交换机上的ARP表项 display arp [dynamic |staic] |{begin |include |exclude} regular-expression //查看包含指定内容的ARP映射表

display arp count [[dynamic |static][|{begin |include |exclude} regular-expression ]| ip-address ] //查看指定类型的ARP表项的数目

display arp count detection statistics interface interface-type interface-number //查看指定端口被丢弃掉的不可信任的ARP报文的数量

display arp timer aging //查看动态ARP老化定时器的时间

reset arp [dynamic |static |interface interface-type interface-number] //消除ARP表项

interface vlan-interface vlan-id

arp max-learning-num number

//在VLAN接口视图下配置允许学习的动态ARP表项的最大数目

arp anti-attack valid-check enable //系统视图下开启对ARP报文源MAC地址一致性检查功能

#ARP入侵检测功能配置:

dhcp-snooping //全局开启交换机DHCP Snooping功能

ip source static import dot1x //全局开启基于802.1x认证用户的ARP入侵检测功能

interface interface-type interface-number

dhcp-snooping trust //配置DHCP Snooping的信任端口 arp detection trust //设置当前端口为ARP信任端口

vlan vlan-id //进入VLAN视图

arp detection enable //开启指定VLAN内所有端口的ARP入侵检测功能 arp restricted-forwarding enable //在对应VLAN内开启ARP严格转发功能

#ARP报文限速功能配置:

interface interface-type interface-number

arp rate-limit enable //开启以上端口的ARP报文限速功能 arp rate-limit rate //配置允许通过的ARP报文的最大速率

arp protective-down recover enable //全局开启交换机上的端口状态自动恢复功能 arp protective-down recover interval interval

//全局设置端口状态由关闭恢复为开启的时间间隔

#ARP代理配置:

interface Vlan-interface vlan-id

arp proxy enable //开启普通代理ARP功能

local-proxy-arp enable [ip-range startIP to endIP ] //开启本地代理ARP功能 display arp proxy [interface vlan-interface vlan-id ] //显示普通代理ARP和本地代理ARP的状态

12. 集群配置

(1)NDP的启用及参数配置

ndp enable //启用NDP——用于收集邻接设备信息

ndp timer aging aging-in-seconds //指定接收设备应该保持本设备发送的NDP报文时间 ndp timer hello seconds //修改NDP信息的更新频率 (2)NTDP的启用及参数配置

ntdp enable //启用NTDP——用于收集邻接设备拓扑信息 ntdp hop hop-value //配置拓扑收集范围

ntdp timer hop-delay time //配置当前设备转发拓扑收集请求的跳数延迟时间 ntdp timer port-delay time //配置当前设备转发拓扑收集请求的端口延迟时间 ntdp timer interval-in-minutes //配置定时拓扑收集的时间间隔

ntdp explore //启动拓扑信息的收集过程

(3)集群启用及配置

cluster enable //启用集群功能