HCIP——HCIA回顾及静态实验

news2024/11/28 5:28:44

HCIP

  • HCIA
  • 一、知识回顾
    • 1、OSI七层参考模型:
    • 2、重要的几个协议报头格式
  • 二、静态实验
    • 1、实验拓扑图
    • 2、实验要求
    • 3、实验思路
    • 4、实验步骤
      • 1、给接口划分IP地址以及配置环回地址
      • 2、交换机配置划分VLAN
      • 3、配置静态路由
      • 4、配置DHCP服务
      • 5、测试
      • 6、优化

HCIA

1、七层参考模型及IP讲解
2、TCP三次握手讲解
3、TCP四次挥手讲解及抓包分析
4、DHCP协议讲解及抓包分析
5、静态综合实验讲解
7、静态路由讲解
8、RIP路由信息协议讲解
9、动态路由协议讲解
10、抓包进行分析RIP以及OSPF的包
11、动态路由OSPF配置综合实验讲解
12、Vlan虚拟局域网技术讲解
13、ACL访问控制列表讲解
14、NAT技术讲解
15、网络综合实验讲解

一、知识回顾

1、OSI七层参考模型:

物理层——定义电气电压接口规范光学特性
数据链路层

  • MAC媒介访问控制层
  • LLC逻辑链路层(为上层提供FCS校验)

网络层——通过IP地址进行逻辑寻址,代表设备路由器。

物理层,数据链路层以及网络层能不能全网可达?可以全网可达。

传输层——通过端口号区分不同的服务,数据分段,确认重传排序流控(只针对于TCP)。

  • TCP面向连接的可靠传输协议
    面向连接: 三次握手以及四次挥手(主要体现),
    可靠: 确认,重传,排序以及流控。
    常见的四层协议; TCPUDP
    常见的三层协议: IPICMPARP
  • UDP非面向连接的不可靠传输协议

会话层——建立,维持,终止会话进程。
表示层——编码解码,加密解密
应用层——实现人机交互的界面

数据封装以及解封装
以太网一类帧二类帧封装——IP——TCP/UDP——data数据包——FCS校验(逻辑链路层提供)

数据分段的标准,MYU最大传输单元1500字节,MSS最大段长度,1480。(原因是报头长度为20字节)

TCP-IP协议栈与OSI模型对比:

  • 相同点:
    1、都是模型化层次
    2、下层对上层提供服务支持
    3、每层协议彼此相互独立
  • 不同点:
    1、TCP-IP协议栈:先有协议后有模型,只是使用于TCP-IP网络。
    2、OSI七层参考模型:先有模型后有协议。
    3、层数不同

滑动窗口就是流控,什么是滑动窗口?其实是吞吐量的问题。

2、重要的几个协议报头格式

IPV4数据包结构:
在这里插入图片描述
在这里插入图片描述
IPV4数据包格式:

  • 版本(号): 这4比特规定了数据报的IP协议版本。通过查看版本号,路由器能够确定如何解释IP数据报的剩余部分。不同的IP版本使用不同的数据报格式。
  • 首部长度: 因为IPV4数据报可包含一些可变数量的选项(这些选项包括在IPV4数据报首部中),故需要用这4个比特来确定IP数据报中载荷(例如在这个数据报中被封装的运输层报文段)实际开始的地方。大多数IP数据报不包含选项,所以一般的IP数据报具有20字节的首部。
  • 服务类型: 服务类型(TOS)比特包含在IPV4首部中,以便使不同类型的IP数据报能相互与别开来,例如,将实时数据报(如用于IP电话应用)与非实时流量(如FTP)区分开也许是有用的。提供特定等级的服务是一个由网络管理员为路由器确定和配置的策略问题。
  • 数据报长度:

二、静态实验

1、实验拓扑图

在这里插入图片描述

2、实验要求

  • 1.全网可达
  • 2.拓扑中所需地址全部基于192.168.0.0/24划分所得
  • 3.静态路由(不许使用其他动态)
  • 4.R8环回需要汇总

3、实验思路

拓扑中所需地址基于192.168.0.0/24进行划分这里我们首先数图中需要多少个网段?

  • 骨干链路——6个网段
  • R1的环回上——1个网段
  • 两个vlan——两个网段

所以,我们首先进行划分网段

192.168.0.0/24需要划分9个网段——也就向后借位,借4128-64-32-16-8-4-2-1
这里我们可以看到第四位为16:
那么,9个网段分别为:
192.168.0.0/28——R1环回
192.168.0.16/28——骨干链路网段
192.168.0.32/28
192.168.0.48/28
192.168.0.64/28
192.168.0.80/28
192.168.0.96/28
192.168.0.112/28——两个vlan
192.1680.128/28
剩下的作为保留网段

而这里我们也需要对R1的环回进行划分,由实验要求的拓扑图可知,我们需要给它划分3个环回网段:

192.168.0.0/28划分为3个网段,我们需要向后借2位
也就成了:
192.168.0.0/30
192.168.0.64/30
192.168.0.128/30
同时剩下的作为保留网段

拓扑图如下:
在这里插入图片描述

4、实验步骤

在这里插入图片描述

1、给接口划分IP地址以及配置环回地址

R1 实现代码:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]user	
[R1]user-in	
[R1]user-interface con	
[R1]user-interface console 0
[R1-ui-console0]id	
[R1-ui-console0]idle-timeout 0 0
[R1-ui-console0]quit
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip ad	
[R1-GigabitEthernet0/0/0]ip address 192.168.0.17 28
Jul 17 2023 15:58:00-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]int g0/0/1
[R1-GigabitEthernet0/0/1]ip ad	
[R1-GigabitEthernet0/0/1]ip address 192.168.0.97 28
Jul 17 2023 15:58:16-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R1-GigabitEthernet0/0/1]quit
[R1]int l	
[R1]int LoopBack 0
[R1-LoopBack0]ip ad	
[R1-LoopBack0]ip address 192.168.0.1 30
[R1-LoopBack0]int l 1
[R1-LoopBack1]ip ad	
[R1-LoopBack1]ip address 192.168.0.65 30
[R1-LoopBack1]int l 2
[R1-LoopBack2]ip ad	
[R1-LoopBack2]ip address 192.168.0.129 30
[R1-LoopBack2]quit
[R1]

查看结果:全up

[R1]display ip interface brief 
*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 1
The number of interface that is UP in Protocol is 6
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.0.17/28      up         up        
GigabitEthernet0/0/1              192.168.0.97/28      up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         192.168.0.1/30       up         up(s)     
LoopBack1                         192.168.0.65/30      up         up(s)     
LoopBack2                         192.168.0.129/30     up         up(s)     
NULL0                             unassigned           up         up(s)     
[R1]

R2 实现代码:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]use	
[R2]user-bind
[R2]user-group
[R2]user-interface con	
[R2]user-interface console 0
[R2-ui-console0]id	
[R2-ui-console0]idle-timeout 0 0
[R2-ui-console0]quit
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip ad	
[R2-GigabitEthernet0/0/0]ip address 192.168.0.18 28
Jul 17 2023 16:08:37-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]int g0/0/1
[R2-GigabitEthernet0/0/1]ip ad	
[R2-GigabitEthernet0/0/1]ip address 192.168.0.33 28
Jul 17 2023 16:08:54-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R2-GigabitEthernet0/0/1]quit
[R2]

查看结果:

[R2]dis	
[R2]display ip int	
[R2]display ip interface b	
[R2]display ip interface brief 
*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 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.0.18/28      up         up        
GigabitEthernet0/0/1              192.168.0.33/28      up         up        
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[R2]

R3 实现代码:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]USER	
[R3]user-bind
[R3]user-group
[R3]user-interface CON	
[R3]user-interface console 0
[R3-ui-console0]id	
[R3-ui-console0]idle-timeout 0 0
[R3-ui-console0]int g0/0/0
[R3-GigabitEthernet0/0/0]ip ad	
[R3-GigabitEthernet0/0/0]ip address 192.168.0.34 28
Jul 17 2023 16:11:15-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]int g0/0/1
[R3-GigabitEthernet0/0/1]ip ad	
[R3-GigabitEthernet0/0/1]ip address 192.168.0.82 28
Jul 17 2023 16:11:34-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R3-GigabitEthernet0/0/1]int g0/0/2
[R3-GigabitEthernet0/0/2]ip ad	
[R3-GigabitEthernet0/0/2]ip address 192.168.0.49 28
Jul 17 2023 16:12:05-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R3-GigabitEthernet0/0/2]int g4/0/0
[R3-GigabitEthernet4/0/0]ip ad	
[R3-GigabitEthernet4/0/0]ip address 192.168.0.65 28
[R3-GigabitEthernet4/0/0]
Jul 17 2023 16:12:31-08:00 R3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet4/0/0 has entered the UP state. 
[R3-GigabitEthernet4/0/0]quit
[R3]

查看结果:

[R3]dis	
[R3]display ip in	
[R3]display ip interface b	
[R3]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 3

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.0.34/28      up         up        
GigabitEthernet0/0/1              192.168.0.82/28      up         up        
GigabitEthernet0/0/2              192.168.0.49/28      up         up        
GigabitEthernet4/0/0              192.168.0.65/28      up         up        
GigabitEthernet4/0/1              unassigned           down       down      
GigabitEthernet4/0/2              unassigned           down       down      
GigabitEthernet4/0/3              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[R3]

R4 实现代码:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]us	
[R4]user-bind
[R4]user-group
[R4]user-interface con	
[R4]user-interface console 0
[R4-ui-console0]id	
[R4-ui-console0]idle-timeout 0 0
[R4-ui-console0]quit
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip ad	
[R4-GigabitEthernet0/0/0]ip address 192.168.0.81 28
Jul 17 2023 16:24:09-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]int g0/0/1
[R4-GigabitEthernet0/0/1]ip ad	
[R4-GigabitEthernet0/0/1]ip address 192.168.0.98 28
Jul 17 2023 16:24:27-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]int g0/0/2.1
[R4-GigabitEthernet0/0/2.1]ip ad	
[R4-GigabitEthernet0/0/2.1]ip address 192.168.0.113 28
[R4-GigabitEthernet0/0/2.1]int g0/0/2.2
[R4-GigabitEthernet0/0/2.2]ip ad	
[R4-GigabitEthernet0/0/2.2]ip address 192.168.0.129 28
[R4-GigabitEthernet0/0/2.2]quit
[R4]

查看结果:

[R4]dis	
[R4]display ip in	
[R4]display ip interface b	
[R4]display ip interface brief 
*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 0
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 3

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.0.81/28      up         up        
GigabitEthernet0/0/1              192.168.0.98/28      up         up        
GigabitEthernet0/0/2              unassigned           up         down      
GigabitEthernet0/0/2.1            192.168.0.113/28     up         down      
GigabitEthernet0/0/2.2            192.168.0.129/28     up         down      
NULL0                             unassigned           up         up(s)     
[R4]

R5 实现代码:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R5
[R5]user	
[R5]user-bind
[R5]user-group
[R5]user-interface con	
[R5]user-interface console 0
[R5-ui-console0]i	
[R5-ui-console0]idle-timeout 0 0
[R5-ui-console0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip ad	
[R5-GigabitEthernet0/0/1]ip address 192.168.0.66 28
Jul 17 2023 16:27:58-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R5-GigabitEthernet0/0/1]int g0/0/0
[R5-GigabitEthernet0/0/0]ip ad	
[R5-GigabitEthernet0/0/0]ip address 192.168.0.50 28
Jul 17 2023 16:28:22-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R5-GigabitEthernet0/0/0]int g0/0/2
[R5-GigabitEthernet0/0/2]ip ad	
[R5-GigabitEthernet0/0/2]ip address 100.1.1.2 24
[R5-GigabitEthernet0/0/2]
Jul 17 2023 16:28:39-08:00 R5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R5-GigabitEthernet0/0/2]quit
[R5]

查看结果:

[R5]dis		
[R5]display ip in	
[R5]display ip interface b	
[R5]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 0

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.0.50/28      up         up        
GigabitEthernet0/0/1              192.168.0.66/28      up         up        
GigabitEthernet0/0/2              100.1.1.2/24         up         up        
NULL0                             unassigned           up         up(s)     
[R5]

R6 实现代码:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R6
[R6]user	
[R6]user-bind
[R6]user-group
[R6]user-interface
[R6]user-interface con	
[R6]user-interface console 0
[R6-ui-console0]i	
[R6-ui-console0]idle-timeout 0 0
[R6-ui-console0]int g0/0/0
[R6-GigabitEthernet0/0/0]ip ad	
[R6-GigabitEthernet0/0/0]ip address 100.1.1.1 24
Jul 17 2023 16:30:48-08:00 R6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R6-GigabitEthernet0/0/0]quit
[R6]dis	

查看结果:

[R6]dis	
[R6]display ip in	
[R6]display ip interface b	
[R6]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 2
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.1.1.1/24         up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[R6]

2、交换机配置划分VLAN

SW1 实现代码:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW	
[Huawei]sys SW1
[SW1]vlan b	
[SW1]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int g0
Jul 17 2023 16:35:23-08:00 SW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095./0/1
[SW1-GigabitEthernet0/0/1]p	
[SW1-GigabitEthernet0/0/1]port l	
[SW1-GigabitEthernet0/0/1]port link-t	
[SW1-GigabitEthernet0/0/1]port link-type a	
[SW1-GigabitEthernet0/0/1]port link-type access 
[SW1-GigabitEthernet0/0/1]p	
[SW1-GigabitEthernet0/0/1]port de	
[SW1-GigabitEthernet0/0/1]port default vlan 2
[SW1-GigabitEthernet0/0/1]int g0/0
Jul 17 2023 16:35:43-08:00 SW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095./2
[SW1-GigabitEthernet0/0/2]p	
[SW1-GigabitEthernet0/0/2]port l	
[SW1-GigabitEthernet0/0/2]port link-t	
[SW1-GigabitEthernet0/0/2]port link-type a	
[SW1-GigabitEthernet0/0/2]port link-type access 
[SW1-GigabitEthernet0/0/2]p	
[SW1-GigabitEthernet0/0/2]port de	
[SW1-GigabitEthernet0/0/2]port default vlan 3
[SW1-GigabitEthernet0/0/2]
Jul 17 2023 16:36:03-08:00 SW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.
[SW1-GigabitEthernet0/0/2]int g0/0/3
[SW1-GigabitEthernet0/0/3]p	
[SW1-GigabitEthernet0/0/3]port l	
[SW1-GigabitEthernet0/0/3]port link-t	
[SW1-GigabitEthernet0/0/3]port link-type t	
[SW1-GigabitEthernet0/0/3]port link-type trunk 
[SW1-GigabitEthernet0/0/3]p	
[SW1-GigabitEthernet0/0/3]port t	
[SW1-GigabitEthernet0/0/3]port trunk a	
[SW1-GigabitEthernet0/0/3]port trunk allow-pass 
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[SW1-GigabitEthernet0/0/3]quit
[SW1]

输出结果:

[SW1]dis	
[SW1]display vlan	
[SW1]display vlan 
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:GE0/0/3(U)      GE0/0/4(U)      GE0/0/5(D)      GE0/0/6(D)      
                GE0/0/7(D)      GE0/0/8(D)      GE0/0/9(D)      GE0/0/10(D)     
                GE0/0/11(D)     GE0/0/12(D)     GE0/0/13(D)     GE0/0/14(D)     
                GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     
                GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     
                GE0/0/23(D)     GE0/0/24(D)                                     

2    common  UT:GE0/0/1(U)                                                      
             TG:GE0/0/3(U)                                                      

3    common  UT:GE0/0/2(U)                                                      

             TG:GE0/0/3(U)                                                      


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------

1    enable  default       enable  disable    VLAN 0001                         
2    enable  default       enable  disable    VLAN 0002                         
3    enable  default       enable  disable    VLAN 0003                         
[SW1]

SW2 实现代码:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW2
[SW2]int g0/0/
Jul 17 2023 16:38:55-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 4, the c
hange loop count is 0, and the maximum number of records is 4095.1
[SW2-GigabitEthernet0/0/1]p	
[SW2-GigabitEthernet0/0/1]quit
[SW2]vlan b	
[SW2]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]p	
[SW2-GigabitEthernet0/0/1]port l	
[SW2-GigabitEthernet0/0/1]port link-
Jul 17 2023 16:39:15-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.t	
[SW2-GigabitEthernet0/0/1]port link-type t	
[SW2-GigabitEthernet0/0/1]port link-type trunk 
[SW2-GigabitEthernet0/0/1]p	
[SW2-GigabitEthernet0/0/1]port t	
[SW2-GigabitEthernet0/0/1]port trunk a	
[SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
Jul 17 2023 16:39:25-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.
[SW2-GigabitEthernet0/0/1]int g0/0/2
[SW2-GigabitEthernet0/0/2]p	
[SW2-GigabitEthernet0/0/2]port l	
[SW2-GigabitEthernet0/0/2]port link-t	
[SW2-GigabitEthernet0/0/2]port link-type a	
[SW2-GigabitEthernet0/0/2]port link-type access 
Jul 17 2023 16:39:35-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.
[SW2-GigabitEthernet0/0/2]p	
[SW2-GigabitEthernet0/0/2]port de	
[SW2-GigabitEthernet0/0/2]port default vlan 2
[SW2-GigabitEthernet0/0/2]int g0/0
Jul 17 2023 16:39:45-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095./2
[SW2-GigabitEthernet0/0/2]int g0/0/3
[SW2-GigabitEthernet0/0/3]p	
[SW2-GigabitEthernet0/0/3]port l	
[SW2-GigabitEthernet0/0/3]port link-t	
[SW2-GigabitEthernet0/0/3]port link-type a	
[SW2-GigabitEthernet0/0/3]port link-type access 
[SW2-GigabitEthernet0/0/3]p	
[SW2-GigabitEthernet0/0/3]port	
[SW2-GigabitEthernet0/0/3]portsw
Jul 17 2023 16:39:55-08:00 SW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 10, the 
change loop count is 0, and the maximum number of records is 40
Error: The interface is already a L2 interface.
[SW2-GigabitEthernet0/0/3]p	
[SW2-GigabitEthernet0/0/3]port de	
[SW2-GigabitEthernet0/0/3]port default v	
[SW2-GigabitEthernet0/0/3]port default vlan 3
[SW2-GigabitEthernet0/0/3]quit
[SW2]

查看结果:

[SW2]dis	
[SW2]display vlan
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:GE0/0/1(U)      GE0/0/4(D)      GE0/0/5(D)      GE0/0/6(D)      
                GE0/0/7(D)      GE0/0/8(D)      GE0/0/9(D)      GE0/0/10(D)     
                GE0/0/11(D)     GE0/0/12(D)     GE0/0/13(D)     GE0/0/14(D)     
                GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     
                GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     
                GE0/0/23(D)     GE0/0/24(D)                                     

2    common  UT:GE0/0/2(U)                                                      
             TG:GE0/0/1(U)                                                      

3    common  UT:GE0/0/3(U)                                                      

             TG:GE0/0/1(U)                                                      


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------

1    enable  default       enable  disable    VLAN 0001                         
2    enable  default       enable  disable    VLAN 0002                         
3    enable  default       enable  disable    VLAN 0003                         
[SW2]

3、配置静态路由

R1 实现代码:

[R1]ip ro	
[R1]ip route
[R1]ip route-static 192.168.0.32 28 192.168.0.18
[R1]ip route-static 192.168.0.64 28 192.168.0.18
[R1]ip route-static 192.168.0.48 28 192.168.0.18
[R1]ip route-static 100.1.1.0 24 192.168.0.18
[R1]ip route-static 100.1.1.0 24 192.168.0.98
[R1]ip route-static 192.168.0.48 28 192.168.0.98
[R1]ip route-static 192.168.0.64 28 192.168.0.98
[R1]ip route-static 192.168.0.80 28 192.168.0.98
[R1]ip route-static 192.168.0.112 28 192.168.0.98
[R1]ip route-static 192.168.0.128 28 192.168.0.98
[R1]

R2 实现代码:

[R2]ip ro	
[R2]ip route
[R2]ip route-static 192.168.0.0 28 192.168.0.17
[R2]ip route-static 192.168.0.96 28 192.168.0.17
[R2]ip route-static 192.168.0.112 28 192.168.0.17
[R2]ip route-static 192.168.0.128 28 192.168.0.17
[R2]ip route-static 192.168.0.128 28 192.168.0.34
[R2]ip route-static 192.168.0.112 28 192.168.0.34
[R2]ip route-static 192.168.0.80 28 192.168.0.34
[R2]ip route-static 192.168.0.64 28 192.168.0.34
[R2]ip route-static 192.168.0.48 28 192.168.0.34
[R2]ip route-static 100.1.1.0 24 192.168.0.34
[R2]

R3 实现代码:

[R3]ip ro	
[R3]ip route
[R3]ip route-static 192.168.0.16 28 192.168.0.33
[R3]ip route-static 192.168.0.0 28 192.168.0.33
[R3]ip route-static 192.168.0.0 28 192.168.0.81
[R3]ip route-static 192.168.0.96 28 192.168.0.81
[R3]ip route-static 192.168.0.112 28 192.168.0.81
[R3]ip route-static 192.168.0.128 28 192.168.0.81
[R3]ip route-static 100.1.1.0 24 192.168.0.66
[R3]ip route-static 100.1.1.0 24 192.168.0.50
[R3]

R4实现代码:

[R4]ip ro	
[R4]ip route
[R4]ip route-static 192.168.0.0 28 192.168.0.97
[R4]ip route-static 192.168.0.16 28 192.168.0.97
[R4]ip route-static 192.168.0.32 28 192.168.0.82
[R4]ip route-static 192.168.0.64 28 192.168.0.82         	
[R4]ip route-static 100.1.1.0 24 192.168.0.82
[R4]

R5 实现代码:

[R5]ip ro	
[R5]ip route
[R5]ip route-static 192.168.0.32 28 192.168.0.65
[R5]ip route-static 192.168.0.32 28 192.168.0.49
[R5]ip route-static 192.168.0.80 28 192.168.0.49
[R5]ip route-static 192.168.0.80 28 192.168.0.65
[R5]ip route-static 192.168.0.16 28 192.168.0.65
[R5]ip route-static 192.168.0.16 28 192.168.0.49
[R5]ip route-static 192.168.0.96 28 192.168.0.49
[R5]ip route-static 192.168.0.96 28 192.168.0.65
[R5]ip route-static 192.168.0.0 28 192.168.0.65
[R5]ip route-static 192.168.0.0 28 192.168.0.49
[R5]ip route-static 192.168.0.112 28 192.168.0.49
[R5]ip route-static 192.168.0.112 28 192.168.0.65
[R5]ip route-static 192.168.0.128 28 192.168.0.65
[R5]ip route-static 192.168.0.128 28 192.168.0.49
[R5]

R6实现代码:

[R6]ip ro	
[R6]ip route
[R6]ip route-static 192.168.0.64 28 100.1.1.2
[R6]ip route-static 192.168.0.48 28 100.1.1.2
[R6]ip route-static 192.168.0.32 28 100.1.1.2
[R6]ip route-static 192.168.0.80 28 100.1.1.2
[R6]ip route-static 192.168.0.96 28 100.1.1.2
[R6]ip route-static 192.168.0.16 28 100.1.1.2
[R6]ip route-static 192.168.0.0 28 100.1.1.2
[R6]ip route-static 192.168.0.112 28 100.1.1.2
[R6]ip route-static 192.168.0.128 28 100.1.1.2
[R6]

查看结果:
R1路由表:

[R1]dis	
[R1]display ip ro	
[R1]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 26       Routes : 29       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      100.1.1.0/24  Static  60   0          RD   192.168.0.18    GigabitEthernet 0/0/0
                    Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.0/30  Direct  0    0           D   192.168.0.1     LoopBack0
    192.168.0.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
    192.168.0.3/32  Direct  0    0           D   127.0.0.1       LoopBack0
   192.168.0.16/28  Direct  0    0           D   192.168.0.17    GigabitEthernet 0/0/0
   192.168.0.17/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
   192.168.0.31/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
   192.168.0.32/28  Static  60   0          RD   192.168.0.18    GigabitEthernet 0/0/0
   192.168.0.48/28  Static  60   0          RD   192.168.0.18    GigabitEthernet 0/0/0
                    Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1
   192.168.0.64/28  Static  60   0          RD   192.168.0.18    GigabitEthernet 0/0/0
                    Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1
   192.168.0.64/30  Direct  0    0           D   192.168.0.65    LoopBack1
   192.168.0.65/32  Direct  0    0           D   127.0.0.1       LoopBack1
   192.168.0.67/32  Direct  0    0           D   127.0.0.1       LoopBack1
   192.168.0.80/28  Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1
   192.168.0.96/28  Direct  0    0           D   192.168.0.97    GigabitEthernet 0/0/1
   192.168.0.97/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1
  192.168.0.111/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1
  192.168.0.112/28  Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1
  192.168.0.128/28  Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1
  192.168.0.128/30  Direct  0    0           D   192.168.0.129   LoopBack2
  192.168.0.129/32  Direct  0    0           D   127.0.0.1       LoopBack2
  192.168.0.131/32  Direct  0    0           D   127.0.0.1       LoopBack2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[R1]

R2路由表:

[R2]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 18       Routes : 20       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      100.1.1.0/24  Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.0/28  Static  60   0          RD   192.168.0.17    GigabitEthernet 0/0/0
   192.168.0.16/28  Direct  0    0           D   192.168.0.18    GigabitEthernet 0/0/0
   192.168.0.18/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
   192.168.0.31/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
   192.168.0.32/28  Direct  0    0           D   192.168.0.33    GigabitEthernet 0/0/1
   192.168.0.33/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1
   192.168.0.47/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1
   192.168.0.48/28  Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1
   192.168.0.64/28  Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1
   192.168.0.80/28  Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1
   192.168.0.96/28  Static  60   0          RD   192.168.0.17    GigabitEthernet 0/0/0
  192.168.0.112/28  Static  60   0          RD   192.168.0.17    GigabitEthernet 0/0/0
                    Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1
  192.168.0.128/28  Static  60   0          RD   192.168.0.17    GigabitEthernet 0/0/0
                    Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[R2]

R3路由表:

[R3]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 22       Routes : 24       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      100.1.1.0/24  Static  60   0          RD   192.168.0.66    GigabitEthernet 4/0/0
                    Static  60   0          RD   192.168.0.50    GigabitEthernet 0/0/2
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.0/28  Static  60   0          RD   192.168.0.33    GigabitEthernet 0/0/0
                    Static  60   0          RD   192.168.0.81    GigabitEthernet 0/0/1
   192.168.0.16/28  Static  60   0          RD   192.168.0.33    GigabitEthernet 0/0/0
   192.168.0.32/28  Direct  0    0           D   192.168.0.34    GigabitEthernet 0/0/0
   192.168.0.34/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
   192.168.0.47/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
   192.168.0.48/28  Direct  0    0           D   192.168.0.49    GigabitEthernet 0/0/2
   192.168.0.49/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/2
   192.168.0.63/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/2
   192.168.0.64/28  Direct  0    0           D   192.168.0.65    GigabitEthernet 4/0/0
   192.168.0.65/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 4/0/0
   192.168.0.79/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 4/0/0
   192.168.0.80/28  Direct  0    0           D   192.168.0.82    GigabitEthernet 0/0/1
   192.168.0.82/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1
   192.168.0.95/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1
   192.168.0.96/28  Static  60   0          RD   192.168.0.81    GigabitEthernet 0/0/1
  192.168.0.112/28  Static  60   0          RD   192.168.0.81    GigabitEthernet 0/0/1
  192.168.0.128/28  Static  60   0          RD   192.168.0.81    GigabitEthernet 0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[R3]

R4路由表:

[R4]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 16       Routes : 16       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      100.1.1.0/24  Static  60   0          RD   192.168.0.82    GigabitEthernet 0/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.0/28  Static  60   0          RD   192.168.0.97    GigabitEthernet 0/0/1
   192.168.0.16/28  Static  60   0          RD   192.168.0.97    GigabitEthernet 0/0/1
   192.168.0.32/28  Static  60   0          RD   192.168.0.82    GigabitEthernet 0/0/0
   192.168.0.48/28  Static  60   0          RD   192.168.0.82    GigabitEthernet 0/0/0
   192.168.0.64/28  Static  60   0          RD   192.168.0.82    GigabitEthernet 0/0/0
   192.168.0.80/28  Direct  0    0           D   192.168.0.81    GigabitEthernet 0/0/0
   192.168.0.81/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
   192.168.0.95/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
   192.168.0.96/28  Direct  0    0           D   192.168.0.98    GigabitEthernet 0/0/1
   192.168.0.98/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1
  192.168.0.111/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[R4]

R5路由表:

[R5]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 20       Routes : 27       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      100.1.1.0/24  Direct  0    0           D   100.1.1.2       GigabitEthernet 0/0/2
      100.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/2
    100.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/2
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.0/28  Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1
                    Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0
   192.168.0.16/28  Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1
                    Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0
   192.168.0.32/28  Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1
                    Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0
   192.168.0.48/28  Direct  0    0           D   192.168.0.50    GigabitEthernet 0/0/0
   192.168.0.50/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
   192.168.0.63/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
   192.168.0.64/28  Direct  0    0           D   192.168.0.66    GigabitEthernet 0/0/1
   192.168.0.66/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1
   192.168.0.79/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1
   192.168.0.80/28  Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0
                    Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1
   192.168.0.96/28  Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0
                    Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1
  192.168.0.112/28  Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0
                    Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1
  192.168.0.128/28  Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1
                    Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[R5]

R6路由表:

[R6]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 16       Routes : 16       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      100.1.1.0/24  Direct  0    0           D   100.1.1.1       GigabitEthernet 0/0/0
      100.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
    100.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.0.0/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0
   192.168.0.16/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0
   192.168.0.32/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0
   192.168.0.48/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0
   192.168.0.64/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0
   192.168.0.80/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0
   192.168.0.96/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0
  192.168.0.112/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0
  192.168.0.128/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[R6]

其实这里已经可以检测上面路由器之间是否通没通,用R1去pingR6:

[R1]ping 100.1.1.1
  PING 100.1.1.1: 56  data bytes, press CTRL_C to break
    Request time out
    Reply from 100.1.1.1: bytes=56 Sequence=2 ttl=252 time=80 ms
    Reply from 100.1.1.1: bytes=56 Sequence=3 ttl=252 time=40 ms
    Reply from 100.1.1.1: bytes=56 Sequence=4 ttl=252 time=30 ms
    Reply from 100.1.1.1: bytes=56 Sequence=5 ttl=252 time=40 ms

  --- 100.1.1.1 ping statistics ---
    5 packet(s) transmitted
    4 packet(s) received
    20.00% packet loss
    round-trip min/avg/max = 30/47/80 ms

[R1]

4、配置DHCP服务

R4实现代码:

[R4]dh	
[R4]dhcp en	
[R4]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[R4]ip p	
[R4]ip policy-based-route
[R4]ip pool 1
#Info: It's successful to create an IP address pool.
[R4-ip-pool-1]net	
[R4-ip-pool-1]netbios-type
[R4-ip-pool-1]network 192.168.0.112 m	
[R4-ip-pool-1]network 192.168.0.112 mask 28
[R4-ip-pool-1]g	
[R4-ip-pool-1]gateway-list 192.168.0.113
[R4-ip-pool-1]dn	
[R4-ip-pool-1]dns-list 8.8.8.8
[R4-ip-pool-1]quit
[R4]ip p	
[R4]ip policy-based-route
[R4]ip pool 2
Info: It's successful to create an IP address pool.
[R4-ip-pool-2]n	
[R4-ip-pool-2]nbns-list
[R4-ip-pool-2]netbios-type
[R4-ip-pool-2]network 192.168.0.128 m	
[R4-ip-pool-2]network 192.168.0.128 mask 28
[R4-ip-pool-2]g	
[R4-ip-pool-2]gateway-list 192.168.0.129
[R4-ip-pool-2]dn	
[R4-ip-pool-2]dns-list 8.8.8.8
[R4-ip-pool-2]quit
[R4]int g0/0/2.1
[R4-GigabitEthernet0/0/2.1]dh	
[R4-GigabitEthernet0/0/2.1]dhcp s	
[R4-GigabitEthernet0/0/2.1]dhcp select g	
[R4-GigabitEthernet0/0/2.1]dhcp select global 
[R4-GigabitEthernet0/0/2.1]int g0/0/2.2
[R4-GigabitEthernet0/0/2.2]dhcp select global 
[R4-GigabitEthernet0/0/2.2]quit
[R4]int g0/0/2.1
[R4-GigabitEthernet0/0/2.1]do	
[R4-GigabitEthernet0/0/2.1]dot1q t	
[R4-GigabitEthernet0/0/2.1]dot1q termination v	
[R4-GigabitEthernet0/0/2.1]dot1q termination vid 2
Jul 17 2023 17:47:36-08:00 R4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/2.1 has entered the UP state. 
[R4-GigabitEthernet0/0/2.1]int g0/0/2.2
[R4-GigabitEthernet0/0/2.2]do	
[R4-GigabitEthernet0/0/2.2]dot1q t	
[R4-GigabitEthernet0/0/2.2]dot1q termination v	
[R4-GigabitEthernet0/0/2.2]dot1q termination vid 3
Jul 17 2023 17:48:04-08:00 R4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/2.2 has entered the UP state. 
[R4-GigabitEthernet0/0/2.2]quit
[R4]int g0/0/2.1
[R4-GigabitEthernet0/0/2.1]arp t	
[R4-GigabitEthernet0/0/2.1]arp b	
[R4-GigabitEthernet0/0/2.1]arp broadcast en	
[R4-GigabitEthernet0/0/2.1]arp broadcast enable 
[R4-GigabitEthernet0/0/2.1]int g0/0/2.2
[R4-GigabitEthernet0/0/2.2]arp b	
[R4-GigabitEthernet0/0/2.2]arp broadcast en	
[R4-GigabitEthernet0/0/2.2]arp broadcast enable 
[R4-GigabitEthernet0/0/2.2]quit
[R4]

5、测试

在这里插入图片描述

6、优化

1、配置缺省路由
R1实现代码:

[R1]ip ro	
[R1]ip route
[R1]ip route-static 0.0.0.0 0 192.168.0.18
[R1]ip route-static 0.0.0.0 0 192.168.0.98
[R1]

R2实现代码:

[R2]ip ro	
[R2]ip route
[R2]ip route-static 0.0.0.0 0 192.168.0.34
[R2]

R3实现代码:

[R3]ip ro	
[R3]ip route
[R3]ip route-static 0.0.0.0 0 192.168.0.66
[R3]ip route-static 0.0.0.0 0 192.168.0.50
[R3]

R4实现代码:

[R4]ip ro	
[R4]ip route
[R4]ip route-static 0.0.0.0 0 192.168.0.82
[R4]

R5实现代码:

[R5]
[R5]ip ro	
[R5]ip route
[R5]ip route-static 0.0.0.0 0 100.1.1.1
[R5]

2、配置空接口防环
R1实现代码:

[R1]ip ro	
[R1]ip route
[R1]ip route-static 192.168.0.0 28 NU	
[R1]ip route-static 192.168.0.0 28 NULL 0
[R1]

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

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

相关文章

遭黑客攻击后反而涨了千百倍?

近期&#xff0c;遭遇黑客攻击后的某数字藏品平台悄悄“复活”&#xff0c;引发业界关注。复出后&#xff0c;该平台上的数字藏品持续暴涨&#xff0c;大部分涨幅均超过百倍&#xff0c;少数藏品甚至超过了千倍。事出反常必有妖。这波涨势难免令人怀疑其中是否存在投机炒作行为…

常用API学习05(Java)

Runtime Runtime表示当前虚拟机的运行环境&#xff0c;Runtime的方法我们不能自己直接去new。 public static Runtime getRuntime() 当前系统的运行环境对象 public void exit(int status) 停止虚拟机 public int availableProcessors() 获得cpu的线程数 publ…

UEC++:间接属性引用

1. 优点&#xff1a;优化内存和时间加载问题&#xff1b; 2. 实现&#xff1a;4.18之前使用的是FStringAssetReference&#xff1a; 所有资源文件都能拾取&#xff01;&#xff01;&#xff01; 结果&#xff1a; 3. 实现&#xff1a; 设置音频文件&#xff1a;

ping的工作原理

ICMP包头格式&#xff1a; icmp报文封装在IP包内&#xff0c;工作在网络层&#xff0c;是IP协议帮手。 查询报文类型 可向对端主机发送回送请求的消息&#xff08;类型 8&#xff09;也可接收对端主机发回来的回送应答消息&#xff08;类型 0&#xff09; 查询报文又增添了标…

怎么通过UI自动化方式获取文章信息?

出于学习研究&#xff0c;对某账号的文章、视频分析一翻&#xff0c;尝试使用自动化方式看能否获取相应信息。 获取某号的文章有多重方法&#xff1a; 第一种是通过搜狗浏览器搜索账号&#xff08;这种方式每天只能获取一篇文章&#xff0c;基本上没啥用。&#xff09;&#…

手把手教你写通讯录(含动态版)

目录 一、框架 二、实现 1.初始化通讯录 2.增加联系人 3.打印通讯录 4.删除联系人 5.修改联系人 6.查找联系人 7.退出通讯录 8.拓展&#xff1a;通讯录排序 9.全代码 三、动态版 1.结构体修改 2.初始化修改 3.扩容实现 4.善后函数 5.全代码 一、框架 实现通讯录…

IntelliJ IDEA 版本控制

IntelliJ IDEA 版本控制&#xff08;VCS&#xff09;日常使用方法备忘 1、搁置更改 2、移至另一个更改列表 对于工程项目中的配置文件&#xff0c;已经在本地修改但是不能提交&#xff0c;如果在提交项目代码时全选变更的文件&#xff0c;可能会误提交配置文件&#xff0c;此…

语音芯片播放消耗电流过大,导致MCU复位

1、问题 在多次遇到播放声音时突然黑屏&#xff0c;单片机复位或者语音播放不全现象&#xff0c;之前使用示波器测量播放声音时供电电池电压&#xff0c;电池电压的确被拉低。之前的解决方案是使用南孚电池&#xff0c;先把供电电压给高一些&#xff0c;这样即使把电压拉低&am…

Mybatis中表关系查询结果集映射

文章目录 前言1. 实体类设计1.1 用户表1.2 地址表1.3 博客表1.4 粉丝互关表 2.插入数据3.表关联查询3.1 一对一关系3.2 一对多关系3.3 多对多关系 前言 resultMap 元素是 MyBatis 中最重要最强大的元素。它可以让你从 90% 的 JDBC ResultSets 数据提取代码中解放出来&#xff…

人工智能数学基础--概率与统计15:多维随机变量/向量

一、多维随机变量定义 一般地,设X(X1,X2,,X,)为一个n维向量&#xff0c;其每个分量,即X1、、Xn都是一维随机变量&#xff0c;则称X是一个n维随机向量或n 维随机变量。 与随机变量一样&#xff0c;随机向量也有离散型和连续型之分。 二、离散型多维随机向量 一个随机向量X(X…

程序环境和预处理超详细讲解

目录 程序的翻译环境和执行环境 详解编译链接 翻译环境 编译本身也分为几个阶段 运行环境 预处理&#xff08;预编译&#xff09;详解 预定义符号 #define #define 定义标识符 #define 定义宏 #define 替换规则 #和## ## 的作用 带副作用的宏参数 宏和函数对比 …

git如何撤销commit(未push)

文章目录 前言undo commitreset current branch to here Undo Commit&#xff0c;Revert Commit&#xff0c;Drop Commit的区别 是否删除对代码的修改是否删除Commit记录是否会新增Commit记录Undo Commit不会未Push会&#xff0c;已Push不会不会Revert Commit会不会会Drop Com…

看看去年蓝桥考了什么,第十三届蓝桥杯省赛(C/C++ 大学B组)题解

文章目录 A&#xff1a;九进制转十进制问题描述运行限制题目思路代码演示 B&#xff1a;顺子日期问题描述运行限制题目思路代码演示 C&#xff1a;刷题统计问题描述评测用例规模与约定运行限制题目思路代码演示 D&#xff1a;修剪灌木问题描述评测用例规模与约定运行限制题目思…

【广州华锐互动】VR地铁消防逃生路线演练系统

随着城市轨道交通的不断发展&#xff0c;事故应急演练的重要性也越来越受到重视。而VR技术的应用&#xff0c;为地铁消防逃生路线演练带来了许多亮点&#xff0c;包括以下几个方面&#xff1a; 首先&#xff0c;VR技术可以提供高度真实的模拟场景。在传统的事故应急演练中&…

t-date-time-picker如何默认当前年月

打开小程序展示当前年月&#xff0c;效果图如下 实现方法&#xff1a;使用new Date().toISOString().slice(0, 7)截取7位即可

卡尔曼滤波:再也不用瑟瑟发抖了

本文来自公众号“AI大道理” —————— 目标跟踪中&#xff0c;在数据关联后往往要进行卡尔曼滤波。 数据关联算法得到了每个目标的观测数据。 卡尔曼滤波使用关联的观测数据来估计目标的状态&#xff0c;并预测目标的未来位置和速度等信息。 目标跟踪过程中&#xff0c;…

0基础学习VR全景平台篇 第62篇:基本功能-如何发布VR视频

戳我先了解“全景视频上传规范” 1、点击【上传】按钮&#xff0c;打开本地文件夹&#xff0c;上传符合要求的全景视频素材&#xff0c;可以选择单个或多个视频同时上传。 2、视频上传成功以后&#xff0c;需要处理一段时间&#xff0c;请耐心等待。 视频处理好以后&#xff0…

编程语言有哪些?介绍常见的编程语言

&#xff08;又是水文章的一天&#xff09;&#xff1a;&#xff09; 在当今数字化时代&#xff0c;编程语言成为了连接人类与计算机的关键工具。无论是网页开发、移动应用程序还是大规模软件开发&#xff0c;选择合适的编程语言对于开发人员来说至关重要。本文将介绍一些常见的…

Cesium-源码打包1.106

在有Cesium源码打包的需求下&#xff0c;可以这样进行&#xff0c; 1.106的源码目录结构如下&#xff1a; 1.在下载的源码目录中运行 npm install 出现node_modules文件夹&#xff0c;然后我们就可以根据需求去修改源码&#xff0c;本文用的版本是1.106&#xff0c; packag…

C语言--动态内存管理(图解)

文章目录 C程序的内存开辟为什么存在动态内存分配动态内存分配函数malloc和freecallocrealloc 常见的动态内存错误对空指针的解引用操作对动态开辟空间的越界访问对非动态开辟内存使用free释放使用free释放一块动态开辟内存的一部分对同一块动态内存多次释放动态开辟内存忘记释…