华为设备的简单配置

简介:

这是以前工作总结出来的配置代码,当时是为了方便所带的人容易上手。

代码以交换为主,架构上分为核心层、分布层、接入层三层,部分相同的代码有简略。

简单的几条指令,你即可快速上手,在工作中即可应用。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#-----------虚拟接口---------------------------
#1)管理地址
interface Vlanif1
  description Management
  ip address 192.168.250.197 255.255.255.0
  dhcp  select  relay
  dhcp relay server- select  dhcpgroup1
#
#2)核心交换虚拟网关接口
interface Vlanif2
  description Server
  ip address 192.168.1.2 255.255.255.0
#
interface Vlanif3
  description office
  ip address 192.168.0.2 255.255.255.0
  dhcp  select  relay
  dhcp relay server- select  dhcpgroup1
#-----------Trunk------------------------------------
interface GigabitEthernet0 /0/24
  port link- type  trunk
  port trunk allow-pass vlan 2 to 100
  ntdp  enable
  ndp  enable
  bpdu  enable
#-----------Eth Trunk-------------------------------
interface Eth-Trunk1
  port link- type  trunk
  port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0 /0/1
  eth-trunk 1
interface GigabitEthernet0 /0/2
  eth-trunk 1
#-----------IP ROUTE---------------------
1)核心交换静态路由
  ip route-static 0.0.0.0 0.0.0.0 10.16.0.1
  ip route-static 1.1.1.0 255.255.255.0 192.168.9.101
  ip route-static 10.0.0.0 255.255.0.0 192.168.9.100
1)分布层接入层
ip route-static 0.0.0.0 0.0.0.0 192.168.250.1
#-----------VLAN-----------------------------
vlan 1
  description Management
vlan 2
  description Server
vlan 3
  description office
interface GigabitEthernet 0 /0/11
#-----------DHCP服务器声明-----------------------------
dhcp server group dhcpgroup1
  dhcp-server 192.168.1.250 0
#-----------Access Port------------------------------
#1)defaule
interface GigabitEthernet0 /0/1
  port link- type  access
  port default vlan 3
  stp disable
  stp edged-port  enable
  ntdp  enable
  ndp  enable
#2)POE config
interface GigabitEthernet0 /0/1
  port hybrid pvid vlan 2
  port hybrid tagged vlan 9 92
  port hybrid untagged vlan 2
  stp edged-port  enable
  undo poe  enable
#-----------认证---------------------------------------------------
#1)全局配置
  super password level 1 cipher ***
  super password level 2 cipher ***
  super password level 3 cipher ***
#2)Console配置
user-interface con 0
  authentication-mode password
  set  authentication password cipher a:FL2 /KX #^;Q=^Q`MAF4<1!!
  idle-timeout 5 0
#3)VTY配置
user-interface vty 0 4
  authentication-mode password
  idle-timeout 15 0
  user privilege level 3
#-----------STP---------------------------------------------------
#1)公共配置
  stp mode rstp
  stp  enable
  stp pathcost-standard legacy
#2)核心层交换
  stp instance 0 root primary
  stp  enable
#3)分布层交换
  stp instance 0 priority 8192
  stp  enable
#4)接入层交换
  stp instance 0 priority 16384
  stp  enable
  stp mode mstp
#5)接入端口配置
  stp edged-port  enable
#-----------LLDP--------------------------------------------------
lldp  enable
#-----------VRRP--------------------------------------------------
#1)Master交换机:
interface Vlanif1
  description Management
  ip address 192.168.250.250 255.255.255.0
  vrrp vrid 1 virtual-ip 192.168.250.1
  vrrp vrid 1 priority 120
  vrrp vrid 1 preempt-mode timer delay 20
#2)Slave交换机:
interface Vlanif1
  description Management
  ip address 192.168.250.251 255.255.255.0
  vrrp vrid 1 virtual-ip 192.168.250.1
#-----------SystemName------------------------------------------------------
systemname XXXX 192.168.2.X
#---------------------------------------------------------------
  storm-control broadcast min-rate 1000 max-rate 2000
  storm-control multicast min-rate 1000 max-rate 2000
  storm-control unicast min-rate 1000 max-rate 2000
  storm-control interval 90
  storm-control action block
  storm-control  enable  log









本文转自 tanzhenchao 51CTO博客,原文链接:http://blog.51cto.com/cmdschool/1701719,如需转载请自行联系原作者

目录
相关文章
|
存储 监控 固态存储
硬盘对碎片整理的需求
【10月更文挑战第1天】硬盘对碎片整理的需求
378 4
|
6月前
|
人工智能 自然语言处理 供应链
AI如何帮助中小企业进行赋能?
人工智能(AI)正加速赋能中小企业,在营销、生产、客服等领域助力转型升级。通过精准营销、智能运营与高效服务,企业可显著提升效率与竞争力。尽管面临技术门槛、数据安全与人才短缺等挑战,借助云服务、政策扶持与人才培养,中小企业仍能把握机遇,实现可持续发展。
624 0
|
自然语言处理 运维 前端开发
OS Copilot-操作系统智能助手-新手小白入门必选~
作为一名安卓开发工程师,我日常专注于前端和移动端开发。然而,在项目推进中偶尔需要部署服务端,这对不熟悉Linux的我来说颇具挑战。每次用命令行工具操作时,常需频繁查阅命令及参数,效率低下。 幸运的是,我发现了阿里云推出的OS Copilot智能助手。它通过自然语言问答功能,让命令行操作变得轻松流畅,帮助我快速定位并解决问题,显著提升了工作效率。安装简单,配置便捷,支持单命令模式和命令行模式,极大简化了Linux操作,成为我得力的开发利器。 总结而言,OS Copilot让我这个Linux小白也能高效处理服务端任务,操作体验焕然一新,是不可多得的智能助手。
|
7月前
|
XML 缓存 Java
一文讲透程序编排的核心方式:从表达式语言到并行化实践
高德的poi数据来源多种多样,处理流程也多种多样,但因流程相对固定,因此使用了流程化配置简化开发,使用表达式语言保证灵活性。为了加深对平台的理解,并帮助大家对编排有一定的了解,本文会以影响范围的视角去总结当前编排的方案。
389 13
一文讲透程序编排的核心方式:从表达式语言到并行化实践
|
10月前
|
人工智能 数据可视化 数据挖掘
工业零件不良率、残次率的智能数据分析和数字化管理
在传统工业领域,我们通过引入DataV-Note平台,成功实现了企业智能数据分析与数字化管理的初步目标。这一平台不仅显著提升了数据处理的效率和准确性,还为我们的日常运营提供了更加科学、直观的决策支持。然而,这只是智能化转型的第一步。展望未来,我们期望能够进一步深化技术应用,推动企业管理向更高层次的智能化方向迈进。通过持续优化数据分析能力、完善数字化管理体系,我们致力于将企业的运营模式从传统的经验驱动转变为数据驱动,从而全面提升管理效能和市场竞争力,为企业创造更大的长期价值
542 129
ThinkPHP 通用的API格式封装
本文介绍了在ThinkPHP框架中如何统一封装API返回格式的方法,包括创建状态码枚举类、编写统一格式化函数以及在BaseController和Error控制器中重写`__call`方法来处理不存在的方法或控制器调用,以实现统一的错误处理和返回格式。
ThinkPHP 通用的API格式封装
|
缓存 监控 前端开发
网站性能
网站性能
314 1
|
缓存 网络协议 网络虚拟化
读透,什么是EVPN?
读透,什么是EVPN?
617 5
|
网络协议 Linux 测试技术
基于PING命令的主机探测
基于PING命令的主机探测
365 3
|
关系型数据库 MySQL 数据库
数据库读写分离后的数据同步方式
【6月更文挑战第5天】该文介绍了应对大并发请求的数据库解决方案,主要涉及MySQL的主从同步和读写分离。根据业务对数据一致性和延迟的容忍度选择合适模式,读写分离则能进一步优化数据库负载。
662 3
数据库读写分离后的数据同步方式

热门文章

最新文章