GRE_MGRE综合实验

目录

1、R5为ISP,只能进行IP地址配置,其所有地址均配为公有IP地址。

IP配置

配置公网全网通

2、(1)R1和R5间使用PPP的PAP认证,R5为主认证方。

PAP认证

(2)R2与R5之间使用ppp的CHAP认证,R5为主认证方。

(3)R3与R5之间使用HDLC封装。

3、R1、R2、R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE。

构建隧道

配置NHRP

查看

配置GRE隧道

4、整个私有网络基于RIP全网可达。

RIP配置

开启R1Tunnel0/0/0口的伪广播功能

 关闭水平分割

 5、所有PC设置私有IP为源IP,可以访问R5环回,实现全网通。 

easy IP配置


1、R5为ISP,只能进行IP地址配置,其所有地址均配为公有IP地址。

IP配置

R1:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
Mar 29 2024 16:47:26-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R1-GigabitEthernet0/0/0]q
[R1]int s4/0/0
[R1-Serial4/0/0]ip add 15.1.1.1 24
[R1-Serial4/0/0]q
[R1]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 3Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.1/24       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Serial4/0/0                       15.1.1.1/24          up         up        
Serial4/0/1                       unassigned           down       down      
[R1]

R2:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.2.2 24
Mar 29 2024 16:49:49-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R2-GigabitEthernet0/0/0]q
[R2]int s4/0/0
[R2-Serial4/0/0]ip add 25.1.1.2 24
[R2-Serial4/0/0]q
[R2]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 3Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.2.2/24       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Serial4/0/0                       25.1.1.2/24          up         up        
Serial4/0/1                       unassigned           down       down      
[R2]

R3:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.3.3 24
[R3-GigabitEthernet0/0/0]
Mar 29 2024 16:52:19-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R3-GigabitEthernet0/0/0]q
[R3]int s4/0/0
[R3-Serial4/0/0]ip add 35.1.1.3 24
[R3-Serial4/0/0]q
[R3]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 3Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.3.3/24       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Serial4/0/0                       35.1.1.3/24          up         up        
Serial4/0/1                       unassigned           down       down      
[R3]

R4:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.1.1.4 24
Mar 29 2024 16:54:35-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R4-GigabitEthernet0/0/0]q
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.4.4 24
Mar 29 2024 16:54:52-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R4-GigabitEthernet0/0/1]q
[R4]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              45.1.1.4/24          up         up        
GigabitEthernet0/0/1              192.168.4.4/24       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[R4]

ISP:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname ISP
[ISP]int s4/0/1
[ISP-Serial4/0/1]ip add 15.1.1.5 24
[ISP-Serial4/0/1]
Mar 29 2024 16:56:20-08:00 ISP %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PP
P IPCP on the interface Serial4/0/1 has entered the UP state. 
[ISP-Serial4/0/1]q
[ISP]int s3/0/1
[ISP-Serial3/0/1]ip add 25.1.1.5 24
[ISP-Serial3/0/1]
Mar 29 2024 16:56:43-08:00 ISP %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PP
P IPCP on the interface Serial3/0/1 has entered the UP state. 
[ISP-Serial3/0/1]q
[ISP]int s4/0/0
[ISP-Serial4/0/0]ip add 35.1.1.5 24
[ISP-Serial4/0/0]
Mar 29 2024 16:57:01-08:00 ISP %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PP
P IPCP on the interface Serial4/0/0 has entered the UP state. 
[ISP-Serial4/0/0]q
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 45.1.1.5 24
Mar 29 2024 16:57:47-08:00 ISP %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IPon the interface GigabitEthernet0/0/0 has entered the UP state. 
[ISP-GigabitEthernet0/0/0]q
[ISP]int LoopBack 0
[ISP-LoopBack0]ip add 5.5.5.5 24
[ISP-LoopBack0]q
[ISP]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 6
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 6
The number of interface that is DOWN in Protocol is 3Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              45.1.1.5/24          up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         5.5.5.5/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
Serial3/0/0                       unassigned           down       down      
Serial3/0/1                       25.1.1.5/24          up         up        
Serial4/0/0                       35.1.1.5/24          up         up        
Serial4/0/1                       15.1.1.5/24          up         up        
[ISP]

PC1:

PC2:

PC3:

PC4:

配置公网全网通

R1:

[R1]ip route-static 0.0.0.0 0 15.1.1.5

R2:

[R2]ip route-static 0.0.0.0 0 25.1.1.5

R3:

[R3]ip route-static 0.0.0.0 0 35.1.1.5

R4:

[R4]ip route-static 0.0.0.0 0 45.1.1.5


2、(1)R1和R5间使用PPP的PAP认证,R5为主认证方。

PAP认证

ISP为主认证方,所以在ISP上配置账户:

R5:

[ISP]aaa
[ISP-aaa]local-user a1 password cipher a12345
Info: Add a new user.
[ISP-aaa]local-user a1 service-type ppp
[ISP-aaa]q
[ISP]int s4/0/1
[ISP-Serial4/0/1]ppp authentication-mode pap

R1:

[R1]int s4/0/0
[R1-Serial4/0/0]ppp pap local-user a1 password cipher a12345

验证:

[R1-Serial4/0/0]shutdown 
Mar 29 2024 18:12:22-08:00 R1 %%01PPP/4/PHYSICALDOWN(l)[0]:On the interface Seri
al4/0/0, PPP link was closed because the status of the physical layer was Down. [R1-Serial4/0/0]
Mar 29 2024 18:12:22-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPPon the interface Serial4/0/0 has entered the DOWN state. 
[R1-Serial4/0/0]
Mar 29 2024 18:12:22-08:00 R1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPPIPCP on the interface Serial4/0/0 has entered the DOWN state. 
[R1-Serial4/0/0]
Mar 29 2024 18:12:22-08:00 R1 %%01IFPDT/4/IF_STATE(l)[3]:Interface Serial4/0/0 h
as turned into DOWN state.
[R1-Serial4/0/0]undo shutdown 
[R1-Serial4/0/0]
Mar 29 2024 18:12:31-08:00 R1 %%01IFPDT/4/IF_STATE(l)[4]:Interface Serial4/0/0 h
as turned into UP state.
[R1-Serial4/0/0]
Mar 29 2024 18:12:34-08:00 R1 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol PPPon the interface Serial4/0/0 has entered the UP state. 
[R1-Serial4/0/0]
Mar 29 2024 18:12:34-08:00 R1 %%01IFNET/4/LINK_STATE(l)[6]:The line protocol PPPIPCP on the interface Serial4/0/0 has entered the UP state. 
[R1-Serial4/0/0]

(2)R2与R5之间使用ppp的CHAP认证,R5为主认证方。

依然是R5为主,故在R5上配置账户:

R5:

[ISP]aaa
[ISP-aaa]local-user b1 password cipher b12345
Info: Add a new user.
[ISP-aaa]local-user b1 service-type ppp
[ISP-aaa]q
[ISP-Serial3/0/1]ppp authentication-mode chap

R2:

[R2]int s4/0/0
[R2-Serial4/0/0]ppp chap user b1	
[R2-Serial4/0/0]ppp chap password cipher b12345

验证:

[R2-Serial4/0/0]shutdown 
Mar 29 2024 18:17:41-08:00 R2 %%01PPP/4/PHYSICALDOWN(l)[0]:On the interface Seri
al4/0/0, PPP link was closed because the status of the physical layer was Down. [R2-Serial4/0/0]
Mar 29 2024 18:17:41-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPPon the interface Serial4/0/0 has entered the DOWN state. 
[R2-Serial4/0/0]
Mar 29 2024 18:17:41-08:00 R2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPPIPCP on the interface Serial4/0/0 has entered the DOWN state. 
[R2-Serial4/0/0]
Mar 29 2024 18:17:41-08:00 R2 %%01IFPDT/4/IF_STATE(l)[3]:Interface Serial4/0/0 h
as turned into DOWN state.
[R2-Serial4/0/0]undo shutdown 
[R2-Serial4/0/0]
Mar 29 2024 18:17:50-08:00 R2 %%01IFPDT/4/IF_STATE(l)[4]:Interface Serial4/0/0 h
as turned into UP state.
[R2-Serial4/0/0]
Mar 29 2024 18:17:53-08:00 R2 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol PPPon the interface Serial4/0/0 has entered the UP state. 
[R2-Serial4/0/0]
Mar 29 2024 18:17:54-08:00 R2 %%01IFNET/4/LINK_STATE(l)[6]:The line protocol PPPIPCP on the interface Serial4/0/0 has entered the UP state. 
[R2-Serial4/0/0]

(3)R3与R5之间使用HDLC封装。

R5:

[ISP]int s4/0/0
[ISP-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Mar 29 2024 18:22:40-08:00 ISP %%01IFNET/4/CHANGE_ENCAP(l)[14]:The user performe
d the configuration that will change the encapsulation protocol of the link and 
then selected Y. 
[ISP-Serial4/0/0]
[ISP-Serial4/0/0]
Mar 29 2024 18:22:40-08:00 ISP %%01PPP/4/PHYSICALDOWN(l)[15]:On the interface Se
rial4/0/0, PPP link was closed because the status of the physical layer was Down
. 
[ISP-Serial4/0/0]
Mar 29 2024 18:22:40-08:00 ISP %%01IFNET/4/LINK_STATE(l)[16]:The line protocol P
PP on the interface Serial4/0/0 has entered the DOWN state. 
[ISP-Serial4/0/0]
Mar 29 2024 18:22:40-08:00 ISP %%01IFNET/4/LINK_STATE(l)[17]:The line protocol P
PP IPCP on the interface Serial4/0/0 has entered the DOWN state. 
[ISP-Serial4/0/0]
Mar 29 2024 18:22:40-08:00 ISP %%01IFPDT/4/IF_STATE(l)[18]:Interface Serial4/0/0has turned into DOWN state.
[ISP-Serial4/0/0]
Mar 29 2024 18:22:41-08:00 ISP %%01IFPDT/4/IF_STATE(l)[19]:Interface Serial4/0/0has turned into UP state.
[ISP-Serial4/0/0]
Mar 29 2024 18:22:41-08:00 ISP %%01IFNET/4/LINK_STATE(l)[20]:The line protocol I
P on the interface Serial4/0/0 has entered the UP state. 
[ISP-Serial4/0/0]

R3:

[R3]int s4/0/0
[R3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Mar 29 2024 18:23:02-08:00 R3 %%01IFNET/4/CHANGE_ENCAP(l)[0]:The user performed 
the configuration that will change the encapsulation protocol of the link and th
en selected Y. 
[R3-Serial4/0/0]
Mar 29 2024 18:23:02-08:00 R3 %%01PPP/4/PHYSICALDOWN(l)[1]:On the interface Seri
al4/0/0, PPP link was closed because the status of the physical layer was Down. [R3-Serial4/0/0]
Mar 29 2024 18:23:02-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PPPon the interface Serial4/0/0 has entered the DOWN state. 
[R3-Serial4/0/0]
Mar 29 2024 18:23:02-08:00 R3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol PPPIPCP on the interface Serial4/0/0 has entered the DOWN state. 
[R3-Serial4/0/0]
Mar 29 2024 18:23:02-08:00 R3 %%01IFPDT/4/IF_STATE(l)[4]:Interface Serial4/0/0 h
as turned into DOWN state.
[R3-Serial4/0/0]
Mar 29 2024 18:23:03-08:00 R3 %%01IFPDT/4/IF_STATE(l)[5]:Interface Serial4/0/0 h
as turned into UP state.
[R3-Serial4/0/0]
Mar 29 2024 18:23:03-08:00 R3 %%01IFNET/4/LINK_STATE(l)[6]:The line protocol IP 
on the interface Serial4/0/0 has entered the UP state. 
[R3-Serial4/0/0]

验证:

3、R1、R2、R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE。

构建隧道

首先配置MGRE隧道:

R1:

[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip add 10.1.2.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R1-Tunnel0/0/0]source 15.1.1.1
Mar 29 2024 18:33:05-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[R1-Tunnel0/0/0]

R2:

[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]ip add 10.1.2.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R2-Tunnel0/0/0]source s4/0/0
Mar 29 2024 18:35:02-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 

R3:

[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip add 10.1.2.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R3-Tunnel0/0/0]source s4/0/0
Mar 29 2024 18:36:12-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[R3-Tunnel0/0/0]

配置NHRP

R1:

[R1-Tunnel0/0/0]nhrp network-id 100

R2:

[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register 

R3:

[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register 

查看

配置GRE隧道

R1:

[R1]int Tunnel 0/0/1
[R1-Tunnel0/0/1]ip add 10.1.1.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre
[R1-Tunnel0/0/1]source 15.1.1.1
[R1-Tunnel0/0/1]destination 45.1.1.4

R4:

[R4]int Tunnel 0/0/1
[R4-Tunnel0/0/1]ip add 10.1.1.2 24
[R4-Tunnel0/0/1]tunnel-protocol gre	
[R4-Tunnel0/0/1]source 45.1.1.4
[R4-Tunnel0/0/1]destination 15.1.1.1

R1:

R4:

4、整个私有网络基于RIP全网可达。

RIP配置

R1:

[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]undo summary 	
[R1-rip-1]network 192.168.1.0        	
[R1-rip-1]network 10.0.0.0
[R1-rip-1]

R2:

[R2]rip 1
[R2-rip-1]v 2
[R2-rip-1]undo summary 
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 10.0.0.0

R3:

[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]undo summary 
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 10.0.0.0

R4:

[R4]rip 1
[R4-rip-1]v 2
[R4-rip-1]undo summary 
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 10.0.0.0

开启R1Tunnel0/0/0口的伪广播功能

[R1-Tunnel0/0/0]nhrp entry multicast dynamic 

 关闭水平分割

水平分割 --- 从哪个接口学到的路由信息将不再从这个接口发出去。

故使用rip的路由器不能发送其他主机的路由信息,要实现全网通,我们就得关闭该功能。

R1:

[R1-Tunnel0/0/0]undo rip split-horizon 

R2:

[R2-Tunnel0/0/0]undo rip split-horizon 

R3:

[R3-Tunnel0/0/0]undo rip split-horizon 

至此,R2和R3就能学习到其他的路由信息。

R2 ping 一下R3后再查看 NHRP表(因为两台路由器间没有发包可能不会更新NHRP表):

R2:

R3:

 5、所有PC设置私有IP为源IP,可以访问R5环回,实现全网通。 

easy IP配置

R1:

[R1]acl 2000	
[R1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R1-acl-basic-2000]q
[R1]int s4/0/0
[R1-Serial4/0/0]nat outbound 2000

检验:

 

R2:

[R2]acl 2000	
[R2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[R2-acl-basic-2000]q
[R2]int s4/0/0
[R2-Serial4/0/0]nat outbound 2000

检验:

R3:

[R3]acl 2000	
[R3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[R3-acl-basic-2000]q
[R3]int s4/0/0
[R3-Serial4/0/0]nat outbound 2000

检验:

R4:

[R4]acl 2000
[R4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[R4-acl-basic-2000]q
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]nat outbound 2000

检验:

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

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

相关文章

如何修改IDEA的代码样式配置+代码格式化快捷键配置

目录 问题现象&#xff1a; 问题分析&#xff1a; 温馨提示&#xff1a; 1、IDEA的代码样式配置 1.1、Use tab character - Smart tabs 配置&#xff1a; 1.2、Tab Size 配置&#xff1a; 1.3、Indent 配置&#xff1a; 1.4、Continuation Indent 配置 1.5、应用并保存 2、…

openstack 不能调度到某主机上分析

dashboard显示有足够资源创建虚拟机 创建一个1c2g20g配置的虚拟机&#xff0c;在过滤时把10-197-0-2这个主机过滤掉了&#xff0c;日志如下&#xff1a; 2024-03-25 17:52:14.087 26 DEBUG nova.scheduler.filters.disk_filter [req-8f2f32fb-1efe-4e5d-81fc-618210c7c76d 773…

【LeetCode: 面试题 16.05. 阶乘尾数 + 阶乘】

&#x1f680; 算法题 &#x1f680; &#x1f332; 算法刷题专栏 | 面试必备算法 | 面试高频算法 &#x1f340; &#x1f332; 越难的东西,越要努力坚持&#xff0c;因为它具有很高的价值&#xff0c;算法就是这样✨ &#x1f332; 作者简介&#xff1a;硕风和炜&#xff0c;…

俄罗斯深陷芯片自主困境,良率仅5成 |百能云芯

俄罗斯的芯片产业一直以来都面临着诸多挑战&#xff0c;尤其是在当前的国际形势下&#xff0c;这些挑战更加凸显。随着俄乌冲突的爆发&#xff0c;西方国家对俄罗斯实施了一系列经济制裁&#xff0c;导致俄罗斯科技产业受到了严重影响。据了解&#xff0c;俄国最大的本土芯片厂…

Redis的数据类型String使用场景实战

Redis的数据类型String使用场景实战 String模型的使用场景 常见面试题&#xff1a;redis在你们项目是怎么使用的&#xff1f;String类型说一个&#xff0c;还有其他用处没&#xff1f; 知识回顾 // 获取redis的key为 WATCH_KEEPER_PREFIX "wka" 的值String wka …

Ubuntu修改自启动软件或程序

Ubuntu修改自启动软件或程序 在编译程序的时候发现速度很慢&#xff0c;查找发现自启动选项太多&#xff0c;cpu占用率越来越高&#xff0c;现在进行查询并修改权限。 1、查找当前进程 top2、选择相对于的服务查找是否自启动设置 systemctl list-unit-files该指令用以下显示…

关于style/class的几种写法

一. style写法 1. <div :style"{ width: 13px, height: 13px, borderRadius: 50%, backgroundColor: this.dataObj.status red ? red : this.dataObj.status yellow ? yellow : this.dataObj.status green ? #1eab75 : }"></div> 2. <div :st…

[Java、Android面试]_14_Retrofit的作用

本人今年参加了很多面试&#xff0c;也有幸拿到了一些大厂的offer&#xff0c;整理了众多面试资料&#xff0c;后续还会分享众多面试资料。 整理成了面试系列&#xff0c;由于时间有限&#xff0c;每天整理一点&#xff0c;后续会陆续分享出来&#xff0c;感兴趣的朋友可关注收…

二维数组中a[0] 和 a[0]的区别

在C语言中&#xff0c;二维数组是以连续内存块的形式存储的&#xff0c;其中每个元素都是数组。让我们来看看a[0]和&a[0]的区别&#xff1a; a[0]&#xff1a;这表示二维数组的第一个元素&#xff0c;也就是第一行的地址。在内存中&#xff0c;它代表的是第一行的起始地址。…

Qt使用事件过滤器

自己使用事件过滤器的总结 1、应用给事件管理器分发事件&#xff0c;事件管理器根据事件类别将事件发给对应的类。 2、事件过滤器在应用和事件管理器之间拦截事件派发给事件管理器的事件&#xff0c; 这个操作会给事件过滤器传递两个参数&#xff0c;一个是Object&#xff08;…

基于Arduino IDE 野火ESP8266模块 MQTT 的开发

一、库介绍 Arduino常用的MQTT库主要有PubSubClient。  PubSubClient库是一个广泛使用的MQTT客户端库&#xff0c;它基于MQTT 3.1.1版本&#xff0c;并且支持ESP8266和ESP32等Arduino兼容的硬件平台。PubSubClient库允许Arduino设备连接到MQTT服务器&#xff0c;发布和订阅MQT…

【每日算法】dfs解决迷宫问题

迷宫问题是比较基础的dfs类型算法题。主要是针对起点和终点来求解最小行走路径 这样的题目肯定是要有回溯过程&#xff0c;因为每一个节点&#xff0c;不是只走一个方向&#xff0c;是四个方向都要走到&#xff0c;才能够知道最终能否走到终点。这样的题目dfs基本框架就是&…

微信公众号新人欢迎语消息推送

问题记录 1.使用的vue2 对象新增属性不具备响应性 this.$set(item, miniTitle, item.title) this.$set(item, miniPagepath, item.pagepath) 2.使用wangeidtor4.6.0富文本组件&#xff0c;富文本组件更改后&#xff0c;值不会马上双绑到自己的值上面 使用onchange进行绑定 …

芒果YOLOv5改进87:轻量化检测头篇:LiteShiftHead 独家原创检测头 | 即插即用,大幅减少参数量,轻量化的同时精度更高效涨点,全网独家改进

💡本篇内容:芒果YOLOv5改进87:轻量化检测头篇:LiteShiftHead 独家原创检测头 | 即插即用,独家新颖更新,大幅减少参数量,轻量化的同时精度高效涨点,全网独家 芒果专栏提出多种原创的轻量化检测头 LiteShiftHead 结构,改进源码教程 | 详情如下🥇 同时本文将演示说清楚二…

Python 和 Go:一文了解

Python 和 Go 各具特色&#xff0c;能够互补。 有一个常见的误解认为 简单&#xff08;simple&#xff09;和 容易&#xff08;easy&#xff09;指的是同一件事。毕竟&#xff0c;如果某样东西易于使用&#xff0c;那么其内在机制必须也简单易懂&#xff0c;对吗&#xff1f;或…

1332多元bfs

/* 多元bfs就是从多个点开始&#xff0c;开始的时候多往初始队列放几个进去 距离数组中最好初始化为-1&#xff1b;然后再起点入队时赋值为0 */ #include<bits/stdc.h> using namespace std; int dx[4]{0,1,0,-1}; int dy[4]{1,0,-1,0}; int f[510][510],dist[510][510];…

math模块篇(五)

文章目录 math.remainder(x, y)math.sumprod(p, q)math.trunc(x)math.ulp(x)math.cbrt(x)math.exp(x)math.exp2(x)math.expm1(x) math.remainder(x, y) math.remainder(x, y) 是 Python 3.8 版本中新增的一个函数&#xff0c;用于计算两个数 x 和 y 相除后的余数。这个函数的行…

Python中的文件读取与保存

1、文件的读取 常用的函数&#xff1a; 1. open()&#xff1a;用于打开文件&#xff0c;可以指定不同的模式&#xff08;读取、写入、追加等&#xff09;来操作文件内容。 2. write()&#xff1a;用于将数据写入文件。 3. close()&#xff1a;用于关闭文件&#xff0c;确保文件…

C++ set 常用部分

文章目录 关键特性定义及初始化一些基本操作查找插入删除清空遍历lower_bound()、upper_bound()set与unordered_set的区别 关键特性 唯一性&#xff1a;Set容器内的元素都是唯一的&#xff0c;每个元素都是不同的有序性&#xff1a;Set容器内的元素总是排序的&#xff08;C中默…

electron+VUE Browserwindow与webview通信

仅做记录 前言&#xff1a; electronVUEVITE框架&#xff0c;用的是VUE3.0 主进程定义&#xff1a;用于接收webview发送的消息 ipcMain.on(MyWebviewMessage, (event, message) > {logger.info(收到webmsg message)//转发给渲染进程}) porelaod/webPreload.js定义 cons…