python自动化管理和zabbix监控网络设备(有线网络和路由配置部分)

目录

目录

一、拓扑图

二、core-sw1

三、core-sw2

四、sum-sw1

五、sum-sw2

六、FW1

七、DMZ-SW1

结语



一、拓扑图

二、core-sw1

sys
sysname core-sw1
vlan batch 10 20 30 40 50 60 100 
vlan batch 200 210 220 230 240 250 stp region-configuration 
region-name huawei
revision-level 1
instance 1 vlan 10 20 30
instance 2 vlan 40 50 60
instance 3 vlan 200 210 220
instance 4 vlan 230 240 250
instance 5 vlan 100
active region-configuration
qstp instance 1 root primary
stp instance 3 root primary
stp instance 5 root primarystp instance 2 root secondary
stp instance 4 root secondaryinter gi0/0/1
port link trunk
port trunk all vlan allinter gi0/0/2
port link trunk
port trunk all vlan allinterface Eth-Trunk 1p l tp t a v allinter gi0/0/3eth-trunk 1inter gi0/0/4eth-trunk 1interface Vlanif 10
ip address 172.16.0.252 23
vrrp vrid 10 virtual-ip 172.16.1.254
vrrp vrid 10 priority 120interface Vlanif 20
ip address 172.16.2.252 23
vrrp vrid 10 virtual-ip 172.16.3.254
vrrp vrid 10 priority 120interface Vlanif 30
ip address 172.16.4.252 23
vrrp vrid 10 virtual-ip 172.16.5.254
vrrp vrid 10 priority 120interface Vlanif 40
ip address 172.16.6.252 23
vrrp vrid 10 virtual-ip 172.16.7.254
vrrp vrid 10 priority 100interface Vlanif 50
ip address 172.16.8.252 23
vrrp vrid 10 virtual-ip 172.16.9.254
vrrp vrid 10 priority 100interface Vlanif 60
ip address 172.16.10.252 23
vrrp vrid 10 virtual-ip 172.16.11.254
vrrp vrid 10 priority 100dhcp enable
ip pool vlan10
network 172.16.0.0 mask 23
gateway-list 172.16.1.254
dns-list 192.168.150.1
excluded-ip-address 172.16.1.1 172.16.1.253
excluded-ip-address 172.16.0.252 172.16.0.253
qinterface Vlanif 10 
dhcp select global
qip pool vlan20
network 172.16.2.0 mask 23
gateway-list 172.16.3.254
dns-list 192.168.150.1
excluded-ip-address 172.16.3.1 172.16.3.253
excluded-ip-address 172.16.2.252 172.16.2.253
qinterface Vlanif 20
dhcp select global
qip pool vlan30
network 172.16.4.0 mask 23
gateway-list 172.16.5.254
dns-list 192.168.150.1
excluded-ip-address 172.16.5.1 172.16.5.253
excluded-ip-address 172.16.4.252 172.16.4.253
qinterface Vlanif 30 
dhcp select global
qip pool vlan40
network 172.16.6.0 mask 23
gateway-list 172.16.7.254
dns-list 192.168.150.1
excluded-ip-address 172.16.7.1 172.16.7.253
excluded-ip-address 172.16.6.252 172.16.6.253
qinterface Vlanif 40
dhcp select global
qip pool vlan50
network 172.16.8.0 mask 23
gateway-list 172.16.9.254
dns-list 192.168.150.1
excluded-ip-address 172.16.9.1 172.16.9.253
excluded-ip-address 172.16.8.252 172.16.8.253
qinterface Vlanif 50
dhcp select global
qip pool vlan60
network 172.16.10.0 mask 23
gateway-list 172.16.11.254
dns-list 192.168.150.1
excluded-ip-address 172.16.11.1 172.16.11.253
excluded-ip-address 172.16.10.252 172.16.10.253
qinterface Vlanif 60
dhcp select global
qinterface Vlanif 200
ip address 172.200.1.251 23
vrrp vrid 20 virtual-ip 172.200.1.254
vrrp vrid 20 priority 120interface Vlanif 210
ip address 172.210.3.251 23
vrrp vrid 20 virtual-ip 172.210.3.254
vrrp vrid 20 priority 120interface Vlanif 220
ip address 172.220.5.251 23
vrrp vrid 20 virtual-ip 172.220.5.254
vrrp vrid 20 priority 120interface Vlanif 230
ip address 172.230.7.251 23
vrrp vrid 20 virtual-ip 172.230.7.254
vrrp vrid 20 priority 100interface Vlanif 240
ip address 172.240.9.251 23
vrrp vrid 20 virtual-ip 172.240.9.254
vrrp vrid 20 priority 100interface Vlanif 250
ip address 172.250.11.251 23
vrrp vrid 20 virtual-ip 172.250.11.254
vrrp vrid 20 priority 100interface Vlanif 100
ip address 192.168.100.251 24
vrrp vrid 20 virtual-ip 192.168.100.254
vrrp vrid 20 priority 120vlan 70inter vlan 70ip address 10.1.70.1 30inter gi0/0/5p l acp de vlan 70inter loop 0
ip address 2.2.2.2 32router id 2.2.2.2
ospf 1
area 0	
network 10.1.70.0 0.0.0.3
network 172.16.0.0 255.255.254.0
network 172.16.2.0 255.255.254.0
network 172.16.4.0 255.255.254.0
network 172.16.6.0 255.255.254.0
network 172.16.8.0 255.255.254.0
network 172.16.10.0 255.255.254.0
network 172.200.0.0 255.255.254.0
network 172.210.2.0 255.255.254.0
network 172.220.4.0 255.255.254.0
network 172.230.6.0 255.255.254.0
network 172.240.8.0 255.255.254.0
network 172.250.10.0 255.255.254.0
network 192.168.100.0 255.255.255.0
network 2.2.2.2 0.0.0.0 
quit

三、core-sw2

sys
sysname core-sw2
vlan batch 10 20 30 40 50 60 100 
vlan batch 200 210 220 230 240 250 stp region-configuration 
region-name huawei
revision-level 1
instance 1 vlan 10 20 30
instance 2 vlan 40 50 60
instance 3 vlan 200 210 220
instance 4 vlan 230 240 250
instance 5 vlan 100
active region-configuration
qstp instance 1 root secondary
stp instance 3 root secondary
stp instance 5 root secondarystp instance 2 root primary
stp instance 4 root primaryinter gi0/0/1
port link trunk
port trunk all vlan allinter gi0/0/2
port link trunk
port trunk all vlan allinterface Eth-Trunk 1p l tp t a v allinter gi0/0/3eth-trunk 1inter gi0/0/4eth-trunk 1sys
sysname core-sw1
vlan batch 10 20 30 40 50 60 100 
vlan batch 200 210 220 230 240 250 stp region-configuration 
region-name huawei
revision-level 1
instance 1 vlan 10 20 30
instance 2 vlan 40 50 60
instance 3 vlan 200 210 220
instance 4 vlan 230 240 250
instance 5 vlan 100
active region-configuration
qstp instance 1 root primary
stp instance 3 root primary
stp instance 5 root primarystp instance 2 root secondary
stp instance 4 root secondaryinter gi0/0/1
port link trunk
port trunk all vlan allinter gi0/0/2
port link trunk
port trunk all vlan allinterface Eth-Trunk 1p l tp t a v allinter gi0/0/3eth-trunk 1inter gi0/0/4eth-trunk 1interface Vlanif 10
ip address 172.16.0.253 23
vrrp vrid 10 virtual-ip 172.16.1.254
vrrp vrid 10 priority 100interface Vlanif 20
ip address 172.16.2.253 23
vrrp vrid 10 virtual-ip 172.16.3.254
vrrp vrid 10 priority 100interface Vlanif 30
ip address 172.16.4.253 23
vrrp vrid 10 virtual-ip 172.16.5.254
vrrp vrid 10 priority 100interface Vlanif 40
ip address 172.16.6.253 23
vrrp vrid 10 virtual-ip 172.16.7.254
vrrp vrid 10 priority 120interface Vlanif 50
ip address 172.16.8.253 23
vrrp vrid 10 virtual-ip 172.16.9.254
vrrp vrid 10 priority 120interface Vlanif 60
ip address 172.16.10.253 23
vrrp vrid 10 virtual-ip 172.16.11.254
vrrp vrid 10 priority 120dhcp enable
ip pool vlan10
network 172.16.0.0 mask 23
gateway-list 172.16.1.254
dns-list 192.168.150.1
excluded-ip-address 172.16.0.1 172.16.0.254
qinterface Vlanif 10 
dhcp select global
qip pool vlan20
network 172.16.2.0 mask 23
gateway-list 172.16.3.254
dns-list 192.168.150.1
excluded-ip-address 172.16.2.1 172.16.2.254
qinterface Vlanif 20
dhcp select global
qip pool vlan30
network 172.16.4.0 mask 23
gateway-list 172.16.5.254
dns-list 192.168.150.1
excluded-ip-address 172.16.4.1 172.16.4.254
qinterface Vlanif 30 
dhcp select global
qip pool vlan40
network 172.16.6.0 mask 23
gateway-list 172.16.7.254
dns-list 192.168.150.1
excluded-ip-address 172.16.6.1 172.16.6.254
qinterface Vlanif 40
dhcp select global
qip pool vlan50
network 172.16.8.0 mask 23
gateway-list 172.16.9.254
dns-list 192.168.150.1
excluded-ip-address 172.16.8.1 172.16.8.254
qinterface Vlanif 50
dhcp select global
qip pool vlan60
network 172.16.10.0 mask 23
gateway-list 172.16.11.254
dns-list 192.168.150.1
excluded-ip-address 172.16.10.1 172.16.10.254
qinterface Vlanif 60
dhcp select global
qinterface Vlanif 200
ip address 172.200.1.252 23
vrrp vrid 20 virtual-ip 172.200.1.254
vrrp vrid 20 priority 100interface Vlanif 210
ip address 172.210.3.252 23
vrrp vrid 20 virtual-ip 172.210.3.254
vrrp vrid 20 priority 100interface Vlanif 220
ip address 172.220.5.252 23
vrrp vrid 20 virtual-ip 172.220.5.254
vrrp vrid 20 priority 100interface Vlanif 230
ip address 172.230.7.252 23
vrrp vrid 20 virtual-ip 172.230.7.254
vrrp vrid 20 priority 120interface Vlanif 240
ip address 172.240.9.252 23
vrrp vrid 20 virtual-ip 172.240.9.254
vrrp vrid 20 priority 120interface Vlanif 250
ip address 172.250.11.252 23
vrrp vrid 20 virtual-ip 172.250.11.254
vrrp vrid 20 priority 120interface Vlanif 100
ip address 192.168.100.252 24
vrrp vrid 20 virtual-ip 192.168.100.254
vrrp vrid 20 priority 100vlan 80inter vlan 80ip address 10.1.80.1 30inter gi0/0/5p l acp de vlan 80inter loop 0
ip address 3.3.3.3 32router id 3.3.3.3
ospf 1
silent-interface Vlanif 10
silent-interface Vlanif 20
silent-interface Vlanif 30
silent-interface Vlanif 40
silent-interface Vlanif 50
silent-interface Vlanif 60
silent-interface Vlanif 200
silent-interface Vlanif 210
silent-interface Vlanif 220
silent-interface Vlanif 230
silent-interface Vlanif 240
silent-interface Vlanif 250
silent-interface Vlanif 100
area 0
network 10.1.80.0 0.0.0.3
network 172.16.0.0 255.255.254.0
network 172.16.2.0 255.255.254.0
network 172.16.4.0 255.255.254.0
network 172.16.6.0 255.255.254.0
network 172.16.8.0 255.255.254.0
network 172.16.10.0 255.255.254.0
network 172.200.0.0 255.255.254.0
network 172.210.2.0 255.255.254.0
network 172.220.4.0 255.255.254.0
network 172.230.6.0 255.255.254.0
network 172.240.8.0 255.255.254.0
network 172.250.10.0 255.255.254.0
network 192.168.100.0 255.255.255.0
network 3.3.3.3 0.0.0.0 
q

四、sum-sw1

sys
sysname sum-sw1vlan batch 10 20 30 40 50 60 100 
vlan batch 200 210 220 230 240 250 port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/9
port link-type trunk
port trunk allow-pass vlan all
qstp region-configuration 
region-name huawei
revision-level 1
instance 1 vlan 10 20 30
instance 2 vlan 40 50 60
instance 3 vlan 200 210 220
instance 4 vlan 230 240 250
instance 5 vlan 100
active region-configuration
q

五、sum-sw2

sys
sysname sum-sw2vlan batch 10 20 30 40 50 60 100 
vlan batch 200 210 220 230 240 250 
port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/9
port link-type trunk
port trunk allow-pass vlan all
qstp region-configuration 
region-name huawei
revision-level 1
instance 1 vlan 10 20 30
instance 2 vlan 40 50 60
instance 3 vlan 200 210 220
instance 4 vlan 230 240 250
instance 5 vlan 100
active region-configuration
q

六、sw1-6

system-view
sysname SW1
vlan batch 10 100 200inter gi0/0/1port link-type trunkport trunk allow-pass vlan 10 100 200quitinter gi0/0/2port link-type trunkport trunk allow-pass vlan 10 100 200quitinter gi0/0/3port link-type accessport default vlan 10quitinter gi0/0/4
system-view
sysname SW2
vlan batch 20 100 210inter gi0/0/1port link-type trunkport trunk allow-pass vlan 20 100 210quitinter gi0/0/2port link-type trunkport trunk allow-pass vlan 20 100 210quitinter gi0/0/3port link-type accessport default vlan 20quit
system-view
sysname SW3
vlan batch 30 100 220inter gi0/0/1port link-type trunkport trunk allow-pass vlan 30 100 220quitinter gi0/0/2port link-type trunkport trunk allow-pass vlan 30 100 220quitinter gi0/0/3port link-type accessport default vlan 30quit
system-view
sysname SW4
vlan batch 40 100 230inter gi0/0/1port link-type trunkport trunk allow-pass vlan 40 100 230quitinter gi0/0/2port link-type trunkport trunk allow-pass vlan 40 100 230quitinter gi0/0/3port link-type accessport default vlan 40quit
system-view
sysname SW5
vlan batch 50 100 240inter gi0/0/1port link-type trunkport trunk allow-pass vlan 50 100 240quitinter gi0/0/2port link-type trunkport trunk allow-pass vlan 50 100 240quitinter gi0/0/3port link-type accessport default vlan 50quit
system-view
sysname SW6
vlan batch 60 100 250inter gi0/0/1port link-type trunkport trunk allow-pass vlan 60 100 250quitinter gi0/0/2port link-type trunkport trunk allow-pass vlan 60 100 250quitinter gi0/0/3port link-type accessport default vlan 60quit

六、FW1

admin
Huawei@123
Admin@123
sys
sysname FW1firewall zone untrustadd interface GigabitEthernet1/0/4firewall zone trustadd interface GigabitEthernet0/0/0add interface GigabitEthernet1/0/0add interface GigabitEthernet1/0/1add interface GigabitEthernet1/0/3firewall zone dmzadd interface GigabitEthernet1/0/2inter gi1/0/0
ip address 10.1.70.2 30inter gi1/0/1ip address 10.1.80.2 30inter loop 0
ip address  1.1.1.1 32router id 1.1.1.1
ospf 1
default-route-advertise always
area 0	
network 10.1.70.0 0.0.0.3
network 10.1.80.0 0.0.0.3

七、DMZ-SW1

sys
sysname DMZ-SW1
vlan batch 150 160 170interface Vlanif150ip address 192.168.150.254 255.255.255.0interface Vlanif160ip address 192.168.160.254 255.255.255.0interface Vlanif170ip address 192.168.170.254 255.255.255.0inter gi0/0/2
p l a
p d v 150inter gi0/0/3
p l a
p d v 160inter gi0/0/4
p l a
p d v 170vlan 90
inter vlan 90ip address 10.1.90.1 30
inter gi0/0/1
p l a
p d v 90
qint LoopBack 0
ip add 4.4.4.4 32router id 4.4.4.4
ospf 1area 0.0.0.1network 192.168.150.0 0.0.0.255network 192.168.160.0 0.0.0.255network 192.168.170.0 0.0.0.255network 10.1.90.0 0.0.0.3network 4.4.4.4 0.0.0.0
quit

结语


具体操作访问

白帽小丑的个人空间-白帽小丑个人主页-哔哩哔哩视频

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/704959.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【Java设计模式】一、工厂模式、建造者模式、原型设计模式

文章目录 1、简单工厂模式2、工厂方法模式3、抽象工厂模式4、建造者模式5、原型设计模式 设计模式即总结出来的一些最佳实现。23种设计模式可分为三大类: 创建型模式:隐藏了创建对象的过程,通过逻辑方法进行创建对象,而不是直接n…

贝叶斯核机器回归拓展R包:bkmrhat

1.摘要 bkmrhat包是用于扩展bkmr包的贝叶斯核机器回归(Bayesian Kernel Machine Regression, BKMR)分析工具,支持多链推断和诊断。该包利用future, rstan, 和coda包的功能,提供了在贝叶斯半参数广义线性模型下进行identity链接和 …

CUDA编程 - 用向量化访存优化 - Cuda elementwise - Add(逐点相加)- 学习记录

Cuda elementwise - Add 一、简介1.1、ElementWise Add1.2、 float4 - 向量化访存 二、实践2.1、如何使用向量化访存2.1、简单的逐点相加核函数2.2、ElementWise Add float4(向量化访存)2.3、完整代码 一、简介 1.1、ElementWise Add Element-wise 操作…

替代 Intercom 和 Zendesk: 开源的客户互动套件 | 开源日报 No.183

chatwoot/chatwoot Stars: 17.8k License: NOASSERTION chatwoot 是一个开源的客户互动套件,是 Intercom、Zendesk、Salesforce Service Cloud 等的替代品。 该项目主要功能、关键特性和核心优势包括: 支持多种对话渠道,如网站、Facebook、…

2024022601-数据库语言SQL

数据库语言SQL SQL的发展 1974年,由Boyce和Chamberlin提出 1975~1979,IBM San Jose Research Lab的关系数据库管理系统原型System R实施了这种语言 SQL-86是第一个SQL标准 SQL-89、SQL-92(SQL2)、SQL-99(SQL3) 非过程化语言 SQL语言进行数据库操作…

【 C++ 】闭散列哈希表的模拟实现

哈希节点状态 我们都很清楚数组里的每一个值无非三种状态: 如果某下标没有值,则代表空EMPTY。如果有值在代表存在EXIST。如果此位置的值被删掉了,则表示为DELETE。 而这三种状态我们可以借助enum枚举来帮助我们表示数组里每个位置的状态。…

亿道推出重磅加固平板!为行业发展注入新动力

随着科技生产力的不断发展,各行各业都得到质的飞跃。产品的迭代速度也大大加快,作为全球领先的加固行移动终端一站式提供商,亿道信息跟紧时代潮流,推出EM-I10J、EM-I20J两款均衡型加固平板,为行业发展注入新动力。 接地…

【Python笔记-设计模式】命令模式

一、说明 命令模式是一种行为设计模式,旨在对命令的封装,根据不同的请求将方法参数化、延迟请求执行或将其放入队列中,且能实现可撤销操作。 (一) 解决问题 将请求发送者和接受者解耦,请求发送者只需知道如何发送请求&#xff…

LVGL 环境搭建-基于WSL

背景说明 小白刚开始接触LVGL,前些日子狠心花198元入手了一块堪称LVGL 入门利器~HMI-Board 开发板,虽然有RT-Thread 集成好的LVGL 环境,只需要几个步骤就能成功把lvgl 的示例运行起来,对于爱折腾的我来说,过于简单也并…

Sora专辑|AI视频制作新时代的曙光:OpenAI Sora 模型启示录

本文深入剖析 OpenAI 最新发布的人工智能视频生成模型 Sora 的工作原理,并探讨它对电影制作行业的深远影响。Sora 利用海量数据和强大的计算能力,学习视频的"语法规则"即物理定律,从而生成逼真的视频画面。Sora 将从根本上改变电影制作的方式,降低制作成本、赋能…

vue2、vue3各自的响应式原理

查看本专栏目录 关于作者 还是大剑师兰特:曾是美国某知名大学计算机专业研究生,现为航空航海领域高级前端工程师;CSDN知名博主,GIS领域优质创作者,深耕openlayers、leaflet、mapbox、cesium,canvas&#x…

助力智能化农田作物除草,基于DETR(DEtection TRansformer)模型开发构建农田作物场景下玉米苗、杂草检测识别分析系统

在我们前面的系列博文中,关于田间作物场景下的作物、杂草检测已经有过相关的开发实践了,结合智能化的设备可以实现只能除草等操作,玉米作物场景下的杂草检测我们则少有涉及,这里本文的主要目的就是想要基于DETR模型来开发构建玉米…

【春运抢票攻略浅析】

参考 最全12306放票规则,抢票策略,候补作用2023年12306抢票攻略(纯技巧) 研究放票规则,候补的时候车次进行一下挑选,能够买长乘短的尽量买长,不要候补一些区间票吧,这是一开始放票…

LeetCode刷题---确认率

解题思路: 将Signups和Confirmations进行左连接,连接的条件为Signups.user_idConfirmations.user_id 根据题中要求进行查询,这里使用AVG聚合函数来求解确认率 AVG(c.action‘confirmed’)表示对action列进行求平均,如果action‘confirmed’&a…

【题解】—— LeetCode一周小结8

【题解】—— 每日一道题目栏 上接:【题解】—— LeetCode一周小结7 19.N 叉树的后序遍历 题目链接:590. N 叉树的后序遍历 给定一个 n 叉树的根节点 root ,返回 其节点值的 后序遍历 。 n 叉树 在输入中按层序遍历进行序列化表示&#x…

深度学习目标检测】二十、基于深度学习的雾天行人车辆检测系统-含数据集、GUI和源码(python,yolov8)

雾天车辆行人检测在多种场景中扮演着至关重要的角色。以下是其作用的几个主要方面: 安全性提升:雾天能见度低,视线受阻,这使得驾驶者和行人在道路上的感知能力大大降低。通过车辆行人检测技术,可以在雾天条件下及时发现…

【Linux】head命令使用

head命令 head是一个在 Unix 和 Unix-like 操作系统中常用的命令行工具,用于输出文件的前 n 行。默认为 10,即显示 10 行的内容。 语法 head [options] [file(s)] head命令 -Linux手册页 选项及作用 执行令 : head --help 执行命令结果…

k8s二进制部署的搭建

1.1 常见k8s安装部署方式 ●Minikube Minikube是一个工具,可以在本地快速运行一个单节点微型K8S,仅用于学习、预览K8S的一些特性使用。 部署地址:Install Tools | Kubernetes ●Kubeadm Kubeadm也是一个工具,提供kubeadm init…

文心一言 VS 讯飞星火 VS chatgpt (203)-- 算法导论15.3 2题

二、对一个16个元素的数组,画出2.3.1节中MERGE-SORT过程运行的递归调用树。解释备忘技术为什么对MERGE-SORT这种分治算法无效。需要写代码的时候,请用go语言。 文心一言,代码不完整: 首先,让我们明确2.3.1节中的MERG…

docker创建mongodb数据库容器

介绍 本文将通过docker创建一个mongodb数据库容器 1. 拉取mongo镜像 docker pull mongo:3.63.6版本是一个稳定的版本,可以选择安装此版本。 2. 创建并启动主数据库 容器数据卷配置 /docker/mongodb/master/data # 数据库数据目录(宿主机&am…