命令 | 说明 |
---|---|
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 always | ospf中配置默认路由 |
[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 all | trunk链路上允许所有vlan流量通过 |
[switch01-GigabitEthernet1/0/10]port trunk permit vlan 1 10 20 | trunk链路上只允许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模式) |
【H3C命令学习笔记】
最新推荐文章于 2023-04-18 11:24:23 发布