CLI举例:上下行连接路由器(路由引流)

news2024/10/7 20:29:50

CLI举例:上下行连接路由器(路由引流)

介绍了集群设备,上下行连接路由器的配置举例。

组网需求

如图1所示,上行网络使用BGP,下行网络使用OSPF,多数据中心统一通过路由器R4接入Internet。

希望本数据中心的流量优先由本数据中心FW承担。当某台FW故障时,流量能切换到其他FW上进行。

同时配置路由引流,实现业务组和路由协议联动:当下行流量切换时,路由协议根据业务组的状态调整发布路由的Cost值,使上行流量也同步切换。

图1 上下行连接路由器组网图

数据规划

项目

数据

说明

FW_A

  • GE1/0/1:10.1.2.1/24
  • GE1/0/2:10.2.2.1/24
  • Eth-Trunk1:10.1.5.1/24,加入接口:GE1/0/3和GE1/0/4
  • Eth-Trunk2:10.1.6.1/24,加入接口:GE1/0/5和GE1/0/6
  • Eth-Trunk3:10.1.7.1/24,加入接口:GE1/0/7和GE1/0/8
  • Tunnel1:10.1.10.1/24
  • Tunnel2:10.1.11.1/24
  • 业务组1:优先级100,绑定OSPF进程1
  • 业务组2:优先级80,绑定OSPF进程2
  • 业务组3:优先级90,绑定OSPF进程3
  • Eth-Trunk1:作为集群协商通道
  • Eth-Trunk2:作为集群备份通道
  • Eth-Trunk3:作为集群转发通道
  • 业务组1:对应DC1的业务
  • 业务组2:对应DC2的业务
  • 业务组3:对应DC3的业务
  • Tunnel1:与R2建立GRE通道,对端IP地址是10.1.10.2
  • Tunnel2:与R3建立GRE通道,对端IP地址是10.1.11.2

FW_B

  • GE1/0/1:10.1.3.1/24
  • GE1/0/2:10.2.3.1/24
  • Eth-Trunk1:10.1.5.2/24,加入接口:GE1/0/3和GE1/0/4
  • Eth-Trunk2:10.1.6.2/24,加入接口:GE1/0/5和GE1/0/6
  • Eth-Trunk3:10.1.7.2/24,加入接口:GE1/0/7和GE1/0/8
  • Tunnel1:10.1.12.1/24
  • Tunnel2:10.1.13.1/24
  • 业务组1:优先级90,绑定OSPF进程1
  • 业务组2:优先级100,绑定OSPF进程2
  • 业务组3:优先级80,绑定OSPF进程3
  • Eth-Trunk1:作为集群协商通道
  • Eth-Trunk2:作为集群备份通道
  • Eth-Trunk3:作为集群转发通道
  • 业务组1:对应DC1的业务
  • 业务组2:对应DC2的业务
  • 业务组3:对应DC3的业务
  • Tunnel1:与R1建立GRE通道,对端IP地址是10.1.12.2
  • Tunnel2:与R3建立GRE通道,对端IP地址是10.1.13.2

FW_C

  • GE1/0/1:10.1.4.1/24
  • GE1/0/2:10.2.4.1/24
  • Eth-Trunk1:10.1.5.3/24,加入接口:GE1/0/3和GE1/0/4
  • Eth-Trunk2:10.1.6.3/24,加入接口:GE1/0/5和GE1/0/6
  • Eth-Trunk3:10.1.7.3/24,加入接口:GE1/0/7和GE1/0/8
  • Tunnel1:10.1.14.1/24
  • Tunnel2:10.1.15.1/24
  • 业务组1:优先级80,绑定OSPF进程1
  • 业务组2:优先级90,绑定OSPF进程2
  • 业务组3:优先级100,绑定OSPF进程3
  • Eth-Trunk1:作为集群协商通道
  • Eth-Trunk2:作为集群备份通道
  • Eth-Trunk3:作为集群转发通道
  • 业务组1:对应DC1的业务
  • 业务组2:对应DC2的业务
  • 业务组3:对应DC3的业务
  • Tunnel1:与R1建立GRE通道,对端IP地址是10.1.14.2
  • Tunnel2:与R2建立GRE通道,对端IP地址是10.1.15.2

操作步骤
  1. 完成网络基本配置。包括配置接口IP地址、接口加入安全区域和路由。

    以下配置需要在每个集群成员上执行。下面给出FW_A上的配置,FW_B/C的配置请参考。

    # 配置各接口的IP地址。
    
    <FW_A> system-view 
    [FW_A] interface GigabitEthernet 1/0/1
    [FW_A-GigabitEthernet1/0/1] ip address 10.1.2.1 24
    [FW_A-GigabitEthernet1/0/1] quit 
    [FW_A] interface GigabitEthernet 1/0/2
    [FW_A-GigabitEthernet1/0/2] ip address 10.1.1.1 24
    [FW_A-GigabitEthernet1/0/2] quit
    [FW_A] interface Eth-Trunk 1
    [FW_A-Eth-Trunk1] ip address 10.1.5.1 24
    [FW_A-Eth-Trunk1] trunkport GigabitEthernet 1/0/3 to 1/0/4
    [FW_A-Eth-Trunk1] quit
    [FW_A] interface Eth-Trunk 2
    [FW_A-Eth-Trunk2] ip address 10.1.6.1 24
    [FW_A-Eth-Trunk2] trunkport GigabitEthernet 1/0/5 to 1/0/6
    [FW_A-Eth-Trunk2] quit
    [FW_A] interface Eth-Trunk 3
    [FW_A-Eth-Trunk3] ip address 10.1.7.1 24
    [FW_A-Eth-Trunk3] trunkport GigabitEthernet 1/0/7 to 1/0/8
    [FW_A-Eth-Trunk3] quit
    # 将各接口加入相应的安全区域。
    
    [FW_A] firewall zone trust
    [FW_A-zone-trust] add interface GigabitEthernet 1/0/2
    [FW_A-zone-trust] quit
    [FW_A] firewall zone dmz
    [FW_A-zone-dmz] add interface Eth-Trunk 1
    [FW_A-zone-dmz] add interface Eth-Trunk 2
    [FW_A-zone-dmz] add interface Eth-Trunk 3
    [FW_A-zone-dmz] add interface Tunnel 1
    [FW_A-zone-dmz] add interface Tunnel 2
    [FW_A-zone-dmz] quit
    [FW_A] firewall zone untrust
    [FW_A-zone-untrust] add interface GigabitEthernet 1/0/1
    [FW_A-zone-untrust] quit
    # 配置GRE隧道。
    
    [FW_A] interface Tunnel 1
    [FW_A-Tunnel1] ip address 10.1.10.1 255.255.255.0
    [FW_A-Tunnel1] tunnel-protocol gre
    [FW_A-Tunnel1] source 10.2.2.1
    [FW_A-Tunnel1] destination 10.2.3.2
    [FW_A-Tunnel1] quit
    [FW_A] interface Tunnel 2
    [FW_A-Tunnel2]  ip address 10.1.11.1 255.255.255.0
    [FW_A-Tunnel2] tunnel-protocol gre
    [FW_A-Tunnel2] source 10.2.2.1
    [FW_A-Tunnel2] destination 10.2.4.2
    [FW_A-Tunnel2] quit
    # 配置OSPF,保证路由可达。
    
    [FW_A] ospf 1
    [FW_A-ospf-1] area 0.0.0.1
    [FW_A-ospf-1-area-0.0.0.1] network 10.2.2.0 0.0.0.255
    [FW_A-ospf-1-area-0.0.0.1] quit
    [FW_A-ospf-1] quit
    [FW_A] ospf 2
    [FW_A-ospf-2] area 0.0.0.1
    [FW_A-ospf-2-area-0.0.0.1] network 10.1.10.0 0.0.0.255
    [FW_A-ospf-2-area-0.0.0.1] quit
    [FW_A-ospf-2] quit
    [FW_A] ospf 3
    [FW_A-ospf-3] area 0.0.0.1
    [FW_A-ospf-3-area-0.0.0.1] network 10.1.11.0 0.0.0.255
    [FW_A-ospf-3-area-0.0.0.1] quit
    [FW_A-ospf-3] quit
    # 配置BGP,保证路由可达。
    
    [FW_A] bgp 10
    [FW_A-bgp] router-id 1.1.1.1
    [FW_A-bgp] peer 10.1.2.2 as-number 10
    [FW_A-bgp] ipv4-family unicast
    [FW_A-bgp-af-ipv4] undo synchronization
    [FW_A-bgp-af-ipv4] import-route ospf 1
    [FW_A-bgp-af-ipv4] import-route ospf 2
    [FW_A-bgp-af-ipv4] import-route ospf 3
    [FW_A-bgp-af-ipv4] peer 10.1.2.2 enable
    [FW_A-bgp-af-ipv4] quit
    [FW_A-bgp] quit

  2. 开启集群功能。

    以下配置需要在每个集群成员上执行。
    
    # 配置集群协商参数。
    
    [FW_A] cluster id 1000
    [FW_A] cluster detect-interval 2
    [FW_A] cluster timer holding-multiplier 4
    [FW_A] cluster timer hello 2
    [FW_A] cluster backup node-num 2
    [FW_A] cluster preempt delay 70
    [FW_A] cluster ip-list node 1 negotiation 10.1.5.1 backup 10.1.6.1 forward 10.1.7.1
    [FW_A] cluster ip-list node 2 negotiation 10.1.5.2 backup 10.1.6.2 forward 10.1.7.2
    [FW_A] cluster ip-list node 3 negotiation 10.1.5.3 backup 10.1.6.3 forward 10.1.7.3
    [FW_A] cluster node bind 1
    [FW_A] cluster standby config enable
    [FW_A] cluster session fast-sync enable
    [FW_A] cluster enable

  3. 配置业务组,将业务组关联到OSPF进程,实现路由引流。

    以下配置请在集群管理主上配置,会自动同步到集群其他成员。
    
    C_No1_M[FW_A] business-group 1
    C_No1_M[FW_A-business-group-1] node 1 priority 100
    C_No1_M[FW_A-business-group-1] node 2 priority 90
    C_No1_M[FW_A-business-group-1] node 3 priority 80
    C_No1_M[FW_A-business-group-1] bind ospf 1
    C_No1_M[FW_A-business-group-1] quit
    C_No1_M[FW_A] business-group 2
    C_No1_M[FW_A-business-group-2] node 1 priority 80
    C_No1_M[FW_A-business-group-2] node 2 priority 100
    C_No1_M[FW_A-business-group-2] node 3 priority 90
    C_No1_M[FW_A-business-group-2] bind ospf 2
    C_No1_M[FW_A-business-group-2] quit
    C_No1_M[FW_A] business-group 3
    C_No1_M[FW_A-business-group-3] node 1 priority 90
    C_No1_M[FW_A-business-group-3] node 2 priority 80
    C_No1_M[FW_A-business-group-3] node 3 priority 100
    C_No1_M[FW_A-business-group-3] bind ospf 3
    C_No1_M[FW_A-business-group-3] quit

  4. 配置安全策略。

    以下配置请在集群管理主上配置,会自动同步到集群其他成员。
    
    # 配置安全策略,允许内网用户访问外网。
    
    C_No1_M[FW_A] security-policy
    C_No1_M[FW_A-policy-security] rule name policy_sec1 
    C_No1_M[FW_A-policy-security-rule-policy_sec1] source-zone trust
    C_No1_M[FW_A-policy-security-rule-policy_sec1] destination-zone untrust
    C_No1_M[FW_A-policy-security-rule-policy_sec1] source-address 10.4.0.0 16
    C_No1_M[FW_A-policy-security-rule-policy_sec1] action permit
    C_No1_M[FW_A-policy-security-rule-policy_sec1] quit
    # 配置安全策略,允许FW与上下行路由器交互OSPF/BGP报文。
    
    C_No1_M[FW_A-policy-security] rule name policy_sec2
    C_No1_M[FW_A-policy-security-rule-policy_sec2] source-zone local
    C_No1_M[FW_A-policy-security-rule-policy_sec2] destination-zone trust untrust
    C_No1_M[FW_A-policy-security-rule-policy_sec2] action permit
    C_No1_M[FW_A-policy-security-rule-policy_sec2] quit
    C_No1_M[FW_A-policy-security] rule name policy_sec3
    C_No1_M[FW_A-policy-security-rule-policy_sec3] source-zone trust untrust
    C_No1_M[FW_A-policy-security-rule-policy_sec3] destination-zone local
    C_No1_M[FW_A-policy-security-rule-policy_sec3] action permit
    C_No1_M[FW_A-policy-security-rule-policy_sec3] quit
    # 配置Local和DMZ的域间安全策略,允许封装后的GRE报文通过域间安全策略。
    
    C_No1_M[FW_A-policy-security] rule name policy2
    C_No1_M[FW_A-policy-security-rule-policy2] source-zone local dmz
    C_No1_M[FW_A-policy-security-rule-policy2] destination-zone dmz local
    C_No1_M[FW_A-policy-security-rule-policy2] action permit
    C_No1_M[FW_A-policy-security-rule-policy2] quit
    C_No1_M[FW_A-policy-security] quit

  5. 配置路由器R1,具体配置命令请参考路由器的相关文档。

    R1上接口IP等基础配置略。R2/R3上的配置与R1类似,请参考以下配置。
    
    # 配置GRE隧道。Tunnel 1和FW_B建立GRE隧道;Tunnel 2和FW_C建立GRE隧道。
    
    <R1> system-view
    [R1] interface Tunnel 1
    [R1-Tunnel1] ip address 10.1.12.2 24
    [R1-Tunnel1] tunnel-protocol gre
    [R1-Tunnel1] source 10.2.2.2
    [R1-Tunnel1] destination 10.2.3.1
    [R1-Tunnel1] quit
    [R1] interface Tunnel 2
    [R1-Tunnel2] ip address 10.1.14.2 24
    [R1-Tunnel2] tunnel-protocol gre
    [R1-Tunnel2] source 10.2.2.2
    [R1-Tunnel2] destination 10.2.4.1
    [R1-Tunnel2] quit
    # 配置OSPF。
    
    [R1] ospf 1
    [R1-ospf-1] import-route static type 1
    [R1-ospf-1] area 0.0.0.1
    [R1-ospf-1-area-0.0.0.1] network 10.2.2.0 0.0.0.255
    [R1-ospf-1-area-0.0.0.1] quit
    [R1-ospf-1] area 0.0.0.2
    [R1-ospf-1-area-0.0.0.2] network 10.1.12.0 0.0.0.255
    [R1-ospf-1-area-0.0.0.2] quit
    [R1-ospf-1] area 0.0.0.3
    [R1-ospf-1-area-0.0.0.3] network 10.1.14.0 0.0.0.255
    [R1-ospf-1-area-0.0.0.3] quit
    [R1-ospf-1] quit

  6. 配置路由器R4。具体配置命令请参考路由器的相关文档。

    R4上接口IP等基础配置略。
    
    <R4> system-view
    [R4] bgp 10
    [R4-bgp] router-id 4.4.4.4
    [R4-bgp] peer 10.1.2.1 as-number 10
    [R4-bgp] peer 10.1.3.1 as-number 10
    [R4-bgp] peer 10.1.4.1 as-number 10
    [R4-bgp] quit

结果验证
  1. 在集群管理主上执行display cluster negotiation status命令,查看集群协商的状态信息。
    C_No1_M<FW_A> display cluster negotiation status
    
    ID    status   health   version   join                 leave                    
    ------------------------------------------------------------                    
    3     slave    10000    A         2018/02/20 16:56:14  NA                       
    2     slave    10000    A         2018/02/20 16:56:17  NA      
    1*    master   10000    A         2018/02/20 16:55:32  NA
    以上信息表示集群1000已经建立,存在3个成员,版本一致,健康度均是10000。
    
    在管理主上执行display business-group brief命令,检查业务组信息。
    
    C_No1_M<FW_A> display business-group brief
    TotalBG:3   Master:1    Slave:2    Invalid:0   Init:0                           
    BGID   State      TopThree         IP_num  Pre_Preempt  next_master             
    ------------------------------------------------------------------------------- 
      1   master      1 2 3               0        NO            -                  
      2   slave       2 3 1               0        NO            -                  
      3   slave       3 1 2               0        NO            -

  2. 以上信息表示:FW_A作为业务组1的主设备;作为业务组2、3的备设备;每个业务组的排序符合预期。

  3. 在R4上查看路由表,正常情况下去DC1的下一跳地址是10.1.2.1。当FW_A故障后,通往DC1的下一跳地址变成10.1.3.1,即通过FW_B转发。

配置脚本

本例中,集群成员上的配置基本一致。主要差异在:接口IP和本设备对应集群节点ID。

下面配置文件以FW_A为例,差异部分会加粗显示,请注意替换。

#
cluster id 1000
cluster detect-interval 2
cluster timer holding-multiplier 4
cluster timer hello 2
cluster backup node-num 2
cluster preempt delay 70
cluster standby config enable
cluster session fast-sync enable
cluster preempt
cluster ip-list node 1 negotiation 10.1.5.1 backup 10.1.6.1 forward 10.1.7.1
cluster ip-list node 2 negotiation 10.1.5.2 backup 10.1.6.2 forward 10.1.7.2
cluster ip-list node 3 negotiation 10.1.5.3 backup 10.1.6.3 forward 10.1.7.3
cluster node bind 1
cluster enable
#
 business-group 1
  node 1 priority 100
  node 2 priority 90
  node 3 priority 80
  bind ospf 1
 business-group 2
  node 1 priority 80
  node 2 priority 100
  node 3 priority 90
  bind ospf 2
 business-group 3
  node 1 priority 90
  node 2 priority 80
  node 3 priority 100
  bind ospf 3
#
ospf 1
 area 0.0.0.1
  network 10.2.2.0 0.0.0.255
#
ospf 2
 area 0.0.0.1
  network 10.1.10.0 0.0.0.255
#
ospf 3
 area 0.0.0.1
  network 10.1.11.0 0.0.0.255
#
bgp 10
 router-id 1.1.1.1
 peer 10.1.2.2 as-number 10
 ipv4-family unicast
  undo synchronization
  import-route ospf 1
  import-route ospf 2
  import-route ospf 3
  peer 10.1.2.2 enable
#
firewall zone trust
 set priority 85
 add interface GigabitEthernet 1/0/2
# 
firewall zone untrust
 set priority 5
 add interface GigabitEthernet 1/0/1
# 
firewall zone dmz
 set priority 50
 add interface Eth-Trunk1
 add interface Eth-Trunk2
 add interface Eth-Trunk3
 add interface Tunnel1
 add interface Tunnel2
#
interface GigabitEthernet 1/0/1
 ip address 10.1.2.1 255.255.255.0
#
interface GigabitEthernet 1/0/2
 ip address 10.2.2.1 255.255.255.0
#
interface GigabitEthernet 1/0/3
 eth-trunk 1
#
interface GigabitEthernet 1/0/4
 eth-trunk 1
#
interface GigabitEthernet 1/0/5
 eth-trunk 2
#
interface GigabitEthernet 1/0/6
 eth-trunk 2
#
interface GigabitEthernet 1/0/7
 eth-trunk 3
#
interface GigabitEthernet 1/0/8
 eth-trunk 3
#
interface Eth-Trunk1
 ip address 10.1.5.1 255.255.255.0
#
interface Eth-Trunk2
 ip address 10.1.6.1 255.255.255.0
#
interface Eth-Trunk3
 ip address 10.1.7.1 255.255.255.0
#
interface Tunnel1
 ip address 10.1.10.1 255.255.255.0
 tunnel-protocol gre
 source 10.2.2.1
 destination 10.2.3.2
#
interface Tunnel2
 ip address 10.1.11.1 255.255.255.0
 tunnel-protocol gre
 source 10.2.2.1
 destination 10.2.4.2
#
security-policy
 rule name policy_sec1
  source-zone trust
  destination-zone untrust
  source-address 10.4.0.0 16
  action permit
 rule name policy_sec2
  source-zone local
  destination-zone local
  destination-zone untrust
  action permit    
 rule name policy_sec3
  source-zone untrust
  source-zone trust
  destination-zone local
  action permit
 rule name policy2
  source-zone local
  source-zone dmz
  destination-zone local
  destination-zone dmz
  action permit
#

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

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

相关文章

C++位图和布隆过滤器(含哈希切割)

文章目录 C位图和布隆过滤器&#xff08;含哈希切割&#xff09;1、位图&#xff08;Bitmap&#xff09;1.1、位图的概念1.2、位图的使用1.3、位图的模拟实现1.4、位图相关面试题 2、布隆过滤器&#xff08;Bloom Filter&#xff09;2.1、布隆过滤器的概念2.2、布隆过滤器的插入…

【通信原理笔记】【三】模拟信号调制——3.5 角度调制(FM、PM)与其频谱特性

文章目录 前言一、相位与频率二、PM和FM的数学表示三、FM的频谱四、FM信号的带宽——卡松公式总结 前言 在之前介绍的几种调制方式中&#xff0c;我提到信噪比时计算的是用户解调后的信噪比&#xff0c;然而在北邮通信原理课中考虑的是解调器输入的信噪比&#xff0c;即考虑的…

一键破解WB多条带--Swissprot数据库

WB条带不符合预期&#xff1f; 不要着急扔掉结果&#xff0c;有可能是重要信息忽略了哟&#xff01;Swissprot带你了解蛋白大小的前因后果。 UniProtKB/Swiss-Prot (reviewed) 是一个高质量人工注释且非冗余的蛋白序列数据库。其中包含各类实验结果、计算得到的特征信息和文献…

损失函数-交叉熵 梯度下降

文章目录 1、交叉熵的简单例子1.2、Classification Error&#xff08;分类错误率&#xff09;1.3、Mean Squared Error (均方误差)1.4、交叉熵损失函数1.5、二分类 2、什么是梯度下降法&#xff1f;2.2、梯度下降法的运行过程2.3、二元函数的梯度下降 1、交叉熵的简单例子 参考…

动力与智能的碰撞:高效控制下的Profinet与EtherCAT逆变器融合

在实施工业自动化解决方案时&#xff0c;特别是当涉及到西门子S7-1200/1500系列PLC的集成时&#xff0c;一个常见的问题就是是确保不同通信协议之间的兼容性。在这种情况下&#xff0c;我们面临的是将这些PLC与支持EtherCAT通信功能的逆变器设备相连接的需求。西门子PLC通常利用…

浏览器密码框明文密文兼容edge的问题

在网页中注册会员的时候&#xff0c;经常需要输入用户名&#xff08;账号&#xff09;和密码&#xff0c;在输入密码的时候&#xff0c;为了防止用户输错密码&#xff0c;经常会给密码框加一个小功能&#xff0c;就是点击密码框右侧闭着的小眼睛&#xff0c;可以让密文变成明文…

蓝桥杯真题 买不到的数目 结论题 数论

&#x1f468;‍&#x1f3eb; 题目地址 &#x1f468;‍&#x1f3eb; 数论&#xff1a;pxpy 不能表示的最大数为pq-p-q的证明 最大能表示的数为&#xff1a; p q − p − q ( p − 1 ) ( q − 1 ) pq-p-q(p-1)(q-1) pq−p−q(p−1)(q−1) 则最大不能表示的数为 ( p − …

Tubi 十岁啦!

Tubi 今年十岁了&#xff0c;这十年不可思议&#xff0c;充满奇迹&#xff01; 从硅谷一个名不见经传的创业小作坊&#xff0c;转变成为四分之一美国电视家庭提供免费流媒体服务的北美领先的平台&#xff1b; 从费尽心力终于签下第一笔内容合作协议&#xff0c;到现在与 450 …

实验:基于Red Hat Enterprise Linux系统建立RAID磁盘阵列

目录 一. 实验目的 二. 实验内容 三. 实验设计描述及实验结果 什么是磁盘阵列&#xff08;RAID&#xff09; 1. 为虚拟机添加4块大小为20G的硬盘nvme0n【2-5】&#xff0c;将nvme0n【2、3、4】三块硬盘 建立为raid5并永久挂载&#xff0c;将RAID盘全部空间制作逻辑卷&#…

软件开发自媒体获客避坑:啥都能干=啥都抓不着=啥都干不了。

我就结合我的经验谈一下粗浅的看法&#xff0c;权当抛砖引玉了。 一、自媒体流量本质是一种泛流量 自媒体流量通常指的是通过自媒体平台&#xff08;如微信公众号、微博、知乎等&#xff09;获取的泛流量。泛流量是指广泛的、来自不同渠道的流量&#xff0c;包括通过搜索引擎…

面试官为什么喜欢考察Vue底层原理

&#x1f90d; 前端开发工程师、技术日更博主、已过CET6 &#x1f368; 阿珊和她的猫_CSDN博客专家、23年度博客之星前端领域TOP1 &#x1f560; 牛客高级专题作者、打造专栏《前端面试必备》 、《2024面试高频手撕题》 &#x1f35a; 蓝桥云课签约作者、上架课程《Vue.js 和 E…

C语言面试题之检查二叉树平衡性

检查二叉树平衡性 实例要求 1、实现一个函数&#xff0c;检查二叉树是否平衡&#xff1b;2、在这个问题中&#xff0c;平衡树的定义如下&#xff1a;任意一个节点&#xff0c;其两棵子树的高度差不超过 1&#xff1b; 示例 1: 给定二叉树 [3,9,20,null,null,15,7]3/ \9 20/…

OSPF数据报文格式

OSPF协议是跨层封装的协议&#xff0c;跨四层封装&#xff0c;直接将应用层的数据封装在网络层协议后面&#xff0c;IP协议包中协议号字段对应的数值为——89 OSPF的头部信息&#xff1a; ——所有数据包公有的信息 版本&#xff1a;OSPF版本 在IPV4中一般使用OSPFV2&#xf…

【3GPP】【核心网】核心网/蜂窝网络重点知识面试题二(超详细)

1. 欢迎大家订阅和关注&#xff0c;3GPP通信协议精讲&#xff08;2G/3G/4G/5G/IMS&#xff09;知识点&#xff0c;专栏会持续更新中.....敬请期待&#xff01; 目录 1. 对于主要的LTE核心网接口&#xff0c;给出运行在该接口上数据的协议栈&#xff0c;并给出协议特征 2. 通常…

ShardingSphere-ShardingSphere读写分离和数据脱敏

文章目录 一、读写分离1.1 读写分离1.2 读写分离应用方案1.3 分表+读写分离1.4 分库分表+读写分离二、ShardingSphere-JDBC读写分离2.1 创建SpringBoot并添加依赖2.2 创建实体类2.3 创建mapper2.4 配置读写分离2.5 测试测试插入数据测试读测试事务一致性测试负载均衡一、读写分…

BP实战之猫狗分类数据集

目录 补充知识 python类里面的魔法方法 transforms.Resize() python里面的OS库 BP实战之猫狗分类数据集 猫狗数据集 注意事项 使用类创建自己的猫狗分类数据集 代码 实例化对象尝试 代码 结果 利用DataLoader加载数据集 BP神经网络的搭建以及对象的使用 运行结果…

【PyQt5篇】使用QtDesigner添加控件和槽

文章目录 &#x1f354;使用QtDesigner进行设计&#x1f6f8;在代码中添加信号和槽 &#x1f354;使用QtDesigner进行设计 我们首先使用QtDesigner设计界面 得到代码login.ui <?xml version"1.0" encoding"UTF-8"?> <ui version"4.0&q…

【Qt】:窗口

窗口 一.概述二.菜单栏1.一个简单的菜单2.添加快捷键3.嵌套子菜单4.添加下划线5.添加图标 三.工具栏1.创建一个简单的工具栏2.设置工具栏的停靠位置 四.状态栏五.浮动窗口 一.概述 Qt窗口是通过QMainWindow类来实现的。 QMainWindow是一个为用户提供主窗口程序的类&#xff0c…

经典本地影音播放器纯净无广告版

MPC-BE&#xff08;Media Player Classic Black Edition&#xff09;是来自 MPC-HC&#xff08;Media Player Classic Home Cinema&#xff09;的俄罗斯开发者重新编译优化后的一款经免费的经典全能影音播放器&#xff0c;纯净无广告&#xff0c;启动速度快&#xff0c;占用消耗…

ES7-10:async和await、异步迭代..

1-ES7新特性 indexof如果没有就返回-1&#xff0c;有就返回索引 如果仅仅查找数据是否在数组中,建议使用includes,如果是查找数据的索引位置,建议使用indexOf更好一些 2-ES8-async和await 所有的需要异步处理的Promise对象都写在async中await等待结果 async、await 使异步操…