【H3C命令学习笔记】

命令说明
display version路由器版本信息
display current-configuration查看路由器当前配置
display interface g0/0查看接口信息
dispaly ip routing-table查看路由表信息
<H3C>sys进入系统视图
save保存配置
[H3C]sysname R1重命名(sysname可简写为sy)
[R1-Serial2/0]interface g0/0切换接口(interface可简写为in)
[R1-Serial2/0]ip add 192.168.1.1 24配置地址
[R1-Serial2/0]undo ip add 192.168.1.1 24取消配置某条命令
[R1]dis ip int brief查看配置的ip地址信息
ip route-static 192.168.1.1 24 192.168.1.2配置静态路由(在前面加上undo 即删除)
[R1]rip配置RIP协议
[R1-rip-1]network 192.168.1.0配置RIPv1协议
[R1-rip-1]version2配置RIPv2协议
[R1-rip-1]silent-interface g0/1静默接口
[R1-rip-1]no summary关闭自动聚合(对于边缘路由器)
[R1-rip-1]undo summary打开自动聚合(对于中间路由器)
[R2-rip-1]default-route originate发送默认路由
[R1-Serial1/0]rip poison-reverse毒性逆转,避免回环
[R1]ospf 1启动OSPF路由协议,进程号为1
[R1-ospf-1]area 0接上:设置为骨干区域
[R1-ospf-area-0.0.0.0]network 192.168.2.0 0.0.0.255接上:通告网络(若在骨干网络上的路由器,其环回地址在骨干网络上,且环回地址不变)
[R1]display ospf peer查看邻居关系
[R3-ospf-1]ospf cost [value]配置ospf开销,[value]为开销值
[R3-ospf-1]bandwidth-reference [value]配置ospf 接口的参考带宽,[value]为带宽值(默认为100)
[R3-ospf-1]default-route-advertise alwaysospf中配置默认路由
[R1]router id 1.1.1.1修改路由器id(需reset ospf 1 process重启)
[R1]ospf network-type [network-type]修改ospf网络类型,[network-type]可以为broadcast、nbma、p2mp或p2p
[H3C-ospf-1-area-0.0.0.0]authentication-mode simple plain hello启动区域认证(简单口令),口令为hello
[R1]display ip routing-table protocol ospf查看ospf路由
[R1]display ospf lsdb查看OSPF数据库
[R1-ospf-area-0.0.0.1]stub配置末梢区域
[R1-ospf-area-0.0.0.1]stub no-summary配置完全末梢区域
[R1-ospf-area-0.0.0.1]nssa default-route-advertise配置nssa区域(配置前需要undo stub)
[R1-ospf-area-0.0.0.2]nssa接上
[R2-ospf-1-area-0.0.0.1]vlink-peer 3.3.3.3配置虚链路(不通过骨干链路传输)
[R4-ospf-1-area-0.0.0.1]vlink-peer 2.2.2.2接上
[R2-ospf-1-area-0.0.0.1]dis ospf peer查看邻里关系
[R2-ospf-1-area-0.0.0.1]display ospf vlink查看虚链路
[R1]undo ospf 1清除ospf配置
[switch01]vlan 100创建vlan
[switch01-vlan100]name Teacher命名为Teacher
[switch01-vlan100]supervlan设置为超级vlan
[switch01-vlan100]subvlan 101 102 103加入三个子vlan
[switch01-vlan100]vlan 101进入vlan101
[switch01-vlan101]port g1/0/1 to g1/0/5将端口g1/0/1到g1/0/5加入vlan101
[switch01-vlan101]dis supervlan查看supervlan
[switch01-vlan100]private-vlan primary将vlan100设置为private-vlan
[switch01-vlan100]private-vlan secondary 101 102 103将101 102 103 配置为100的secondary vlan
[switch01-vlan100]dis private-vlan 100查看private-vlan
[switch01]in g1/0/10进入交换机接口(两台交换机相连的接口)
[switch01-GigabitEthernet1/0/10]port link-type access将链路类型设置为access
[switch01-GigabitEthernet1/0/10]port link-type trunk将链路类型设置为trunk
[switch01-GigabitEthernet1/0/10]port trunk permit vlan alltrunk链路上允许所有vlan流量通过
[switch01-GigabitEthernet1/0/10]port trunk permit vlan 1 10 20trunk链路上只允许vlan 1 10 20的流量通过
[switch01-GigabitEthernet1/0/10]port trunk pvid vlan 10配置交换机switch01的pvid为vlan10
[switch01]in range g1/0/1 to g1/0/10批量选择端口
[switch1]interface Bridge-Aggregation 1创建桥接聚合组1
[switch1-if-range]port link-aggregation group 1将批量选择的端口加入聚合组1
[switch1]dis link-aggregation verbose查看链路聚合的详细信息
[switch1-Bridge-Aggregation2]link-aggregation mode dynamic将聚合组模式设置为动态模式(共有协议LACP)
[switch1-Route-Aggregation1]ip add 192.168.1.253 24配置路由聚合组ip和子网掩码(注意聚合组名)
[switch1]stp region-configuration进入交换机MSTP系统视图
[switch1-mst-region]region-name h3c配置MSTP域名为h3c
[switch1-mst-region]instance 1 vlan 10创建实例1并配置vlan10属于实例1
[switch1-mst-region]revision-level 0配置MSTP的修正级别为0
[switch1-mst-region]active region-configuration激活MSTP的域配置
[switch1]stp global enable在交换机全局范围内启用STP
[switch2]stp instance 1 root primary配置交换机2为实例1的根网桥
[switch1-if-range]mvrp enable将交换机的两个接口开启MVRP功能(需要trunk模式)
  • 4
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值