HCIP——HCIA回顾及静态实验

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 1Interface                         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 1Interface                         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 3Interface                         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 3Interface                         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 0Interface                         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 2Interface                         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: PublicDestinations : 26       Routes : 29       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface100.1.1.0/24  Static  60   0          RD   192.168.0.18    GigabitEthernet 0/0/0Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.0.0/30  Direct  0    0           D   192.168.0.1     LoopBack0192.168.0.1/32  Direct  0    0           D   127.0.0.1       LoopBack0192.168.0.3/32  Direct  0    0           D   127.0.0.1       LoopBack0192.168.0.16/28  Direct  0    0           D   192.168.0.17    GigabitEthernet 0/0/0192.168.0.17/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0192.168.0.31/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0192.168.0.32/28  Static  60   0          RD   192.168.0.18    GigabitEthernet 0/0/0192.168.0.48/28  Static  60   0          RD   192.168.0.18    GigabitEthernet 0/0/0Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1192.168.0.64/28  Static  60   0          RD   192.168.0.18    GigabitEthernet 0/0/0Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1192.168.0.64/30  Direct  0    0           D   192.168.0.65    LoopBack1192.168.0.65/32  Direct  0    0           D   127.0.0.1       LoopBack1192.168.0.67/32  Direct  0    0           D   127.0.0.1       LoopBack1192.168.0.80/28  Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1192.168.0.96/28  Direct  0    0           D   192.168.0.97    GigabitEthernet 0/0/1192.168.0.97/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1192.168.0.111/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1192.168.0.112/28  Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1192.168.0.128/28  Static  60   0          RD   192.168.0.98    GigabitEthernet 0/0/1192.168.0.128/30  Direct  0    0           D   192.168.0.129   LoopBack2192.168.0.129/32  Direct  0    0           D   127.0.0.1       LoopBack2192.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: PublicDestinations : 18       Routes : 20       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface100.1.1.0/24  Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.0.0/28  Static  60   0          RD   192.168.0.17    GigabitEthernet 0/0/0192.168.0.16/28  Direct  0    0           D   192.168.0.18    GigabitEthernet 0/0/0192.168.0.18/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0192.168.0.31/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0192.168.0.32/28  Direct  0    0           D   192.168.0.33    GigabitEthernet 0/0/1192.168.0.33/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1192.168.0.47/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1192.168.0.48/28  Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1192.168.0.64/28  Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1192.168.0.80/28  Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1192.168.0.96/28  Static  60   0          RD   192.168.0.17    GigabitEthernet 0/0/0192.168.0.112/28  Static  60   0          RD   192.168.0.17    GigabitEthernet 0/0/0Static  60   0          RD   192.168.0.34    GigabitEthernet 0/0/1192.168.0.128/28  Static  60   0          RD   192.168.0.17    GigabitEthernet 0/0/0Static  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: PublicDestinations : 22       Routes : 24       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface100.1.1.0/24  Static  60   0          RD   192.168.0.66    GigabitEthernet 4/0/0Static  60   0          RD   192.168.0.50    GigabitEthernet 0/0/2127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.0.0/28  Static  60   0          RD   192.168.0.33    GigabitEthernet 0/0/0Static  60   0          RD   192.168.0.81    GigabitEthernet 0/0/1192.168.0.16/28  Static  60   0          RD   192.168.0.33    GigabitEthernet 0/0/0192.168.0.32/28  Direct  0    0           D   192.168.0.34    GigabitEthernet 0/0/0192.168.0.34/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0192.168.0.47/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0192.168.0.48/28  Direct  0    0           D   192.168.0.49    GigabitEthernet 0/0/2192.168.0.49/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/2192.168.0.63/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/2192.168.0.64/28  Direct  0    0           D   192.168.0.65    GigabitEthernet 4/0/0192.168.0.65/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 4/0/0192.168.0.79/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 4/0/0192.168.0.80/28  Direct  0    0           D   192.168.0.82    GigabitEthernet 0/0/1192.168.0.82/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1192.168.0.95/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1192.168.0.96/28  Static  60   0          RD   192.168.0.81    GigabitEthernet 0/0/1192.168.0.112/28  Static  60   0          RD   192.168.0.81    GigabitEthernet 0/0/1192.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: PublicDestinations : 16       Routes : 16       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface100.1.1.0/24  Static  60   0          RD   192.168.0.82    GigabitEthernet 0/0/0127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.0.0/28  Static  60   0          RD   192.168.0.97    GigabitEthernet 0/0/1192.168.0.16/28  Static  60   0          RD   192.168.0.97    GigabitEthernet 0/0/1192.168.0.32/28  Static  60   0          RD   192.168.0.82    GigabitEthernet 0/0/0192.168.0.48/28  Static  60   0          RD   192.168.0.82    GigabitEthernet 0/0/0192.168.0.64/28  Static  60   0          RD   192.168.0.82    GigabitEthernet 0/0/0192.168.0.80/28  Direct  0    0           D   192.168.0.81    GigabitEthernet 0/0/0192.168.0.81/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0192.168.0.95/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0192.168.0.96/28  Direct  0    0           D   192.168.0.98    GigabitEthernet 0/0/1192.168.0.98/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1192.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: PublicDestinations : 20       Routes : 27       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface100.1.1.0/24  Direct  0    0           D   100.1.1.2       GigabitEthernet 0/0/2100.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/2100.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/2127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.0.0/28  Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0192.168.0.16/28  Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0192.168.0.32/28  Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0192.168.0.48/28  Direct  0    0           D   192.168.0.50    GigabitEthernet 0/0/0192.168.0.50/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0192.168.0.63/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0192.168.0.64/28  Direct  0    0           D   192.168.0.66    GigabitEthernet 0/0/1192.168.0.66/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1192.168.0.79/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/1192.168.0.80/28  Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1192.168.0.96/28  Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1192.168.0.112/28  Static  60   0          RD   192.168.0.49    GigabitEthernet 0/0/0Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1192.168.0.128/28  Static  60   0          RD   192.168.0.65    GigabitEthernet 0/0/1Static  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: PublicDestinations : 16       Routes : 16       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface100.1.1.0/24  Direct  0    0           D   100.1.1.1       GigabitEthernet 0/0/0100.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0100.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet 0/0/0127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.0.0/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0192.168.0.16/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0192.168.0.32/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0192.168.0.48/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0192.168.0.64/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0192.168.0.80/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0192.168.0.96/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0192.168.0.112/28  Static  60   0          RD   100.1.1.2       GigabitEthernet 0/0/0192.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.1PING 100.1.1.1: 56  data bytes, press CTRL_C to breakRequest time outReply from 100.1.1.1: bytes=56 Sequence=2 ttl=252 time=80 msReply from 100.1.1.1: bytes=56 Sequence=3 ttl=252 time=40 msReply from 100.1.1.1: bytes=56 Sequence=4 ttl=252 time=30 msReply from 100.1.1.1: bytes=56 Sequence=5 ttl=252 time=40 ms--- 100.1.1.1 ping statistics ---5 packet(s) transmitted4 packet(s) received20.00% packet lossround-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.hqwc.cn/news/27341.html

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

相关文章

K8S安全风险及防护建议

Kubernetes&#xff08;K8S&#xff09;是一个可移植、可扩展的开源平台&#xff0c;用于管理容器化的工作负载和服务&#xff0c;方便进行声明式配置和自动化。一个Kubernetes集群通常包含跨多台计算机运行的控制平面和多个工作节点&#xff08;node&#xff09;&#xff0c;控…

基于 rsync 像 macOS 的 Time Machine 一样备份您的 Linux 服务器

一、前言 Time Machine 这东西用过 macOS 的都知道&#xff0c;可以说是数据备份神器。 前几天我误删了几个文件&#xff0c;还好我有设置 Time Machine 自动备份&#xff0c;于是我打开 Time Machine&#xff0c;点几下鼠标&#xff0c;文件就回来了&#xff01; 我想要是 …

《遗留系统现代化》读书笔记(基础篇)

你现在所写的每一行代码&#xff0c;都是未来的遗留系统 为什么要对遗留系统进行现代化&#xff1f; 什么是遗留系统&#xff1f; 判断遗留系统的几个维度&#xff1a;代码、架构、测试、DevOps 以及技术和工具。时间长短并不是衡量遗留系统的标准。代码质量差、架构混乱、没…

JavaWeb(2)——HTML、CSS、JS 快速入门

一、JavaScript快速入门 JavaScript | MDN (mozilla.org) 一个完整的JavaScript实现由3个不同部分组成&#xff1a;核心&#xff08;ECMAScript&#xff09;、文档对象模型&#xff08;DOM&#xff09;和浏览器对象模型&#xff08;BOM&#xff09;&#xff0c;如图所示。 EC…

大数据与视频技术的融合趋势将带来怎样的场景应用?

视频技术和AI技术的融合是一种新兴的技术趋势&#xff0c;它将改变视频行业的运作方式。视频技术和AI技术的融合主要包括以下几个方面&#xff1a; 1&#xff09;人脸识别技术 人脸识别技术是AI技术的一个重要应用场景。它可以通过对视频中的人脸进行识别和分析&#xff0c;实…

常用语言的线程模型(Java、go、C++、python3) | 京东云技术团队

背景知识 软件是如何驱动硬件的&#xff1f; 硬件是需要相关的驱动程序才能执行&#xff0c;而驱动程序是安装在操作系统内核中。如果写了一个程序A&#xff0c;A程序想操作硬件工作&#xff0c;首先需要进行系统调用&#xff0c;由内核去找对应的驱动程序驱使硬件工作。而驱动…

Spring源码学习-MVC的WEB源码解析

目录 SpringMVC官方文档SpringMVC的父子容器父子关系的定义自定义快速启动器启动过程容器创建的过程容器刷新启动 父子容器示例图 网络请求链路分析DispatcherServlet请求链路 DispatcherServlet详解(MVC核心功能类)DispatcherServlet九大组件九大组件的初始化默认策略初始化时…

Linux网络基础 — 网络层

目录 IP协议 IP协议报头格式 网段划分 特殊的IP地址 IP地址的数量限制 私有IP地址和公网IP地址 路由 补充 网络层 在复杂的环境中确定一个合适的路径。 IP协议 ip具有将数据从 主机A 跨网络送到 主机B 的能力。 主机: 配有IP地址&#xff0c;但是不进行路由控制的设备…

二、DDL-3.数据类型

分为3种&#xff1a;数值类型、字符串类型、日期时间类型。 一、数值类型 【案例】 年龄&#xff1a; age TINYINT UNSIGNED——范围&#xff08;0&#xff0c;255&#xff09;够用 分数&#xff1a;score double(4,1)——分数0-100有小数&#xff0c;4—最高位数&#xff0…

LabVIEW实现基于DCT的野生动物监测无线图像传输

LabVIEW实现基于DCT的野生动物监测无线图像传输 针对野生动物物种数量不断下降的情况&#xff0c;需改进以增强当前野生动物监测系统的能力。目前的系统要求工人进入森林以收集存储在存储卡中的图像数据。这项任务风险很大&#xff0c;而且耗费大量时间。系统也无法提供实时报…

[C语言]if语句详解

C语言初阶系列 分支语句和循环语句&#xff08;1&#xff09; 目录 C语言初阶系列 前言 一&#xff0c;什么是语句&#xff1f; 1.1如何理解语句&#xff1f; 二&#xff0c;分支语句&#xff08;选择结构&#xff09; 2.1,if语句 2.2,if语句的错误的条件写法 2.2,if语…

python opencv 级联Haar多目标检测

一、基于OpenCV的haar分类器实现笑脸检测 1、Haar分类器介绍 &#x1f680;Haar分类器是一种基于机器学习的目标检测算法&#xff0c;它使用Haar特征描述图像中的目标。Haar特征是基于图像亮度的局部差异计算得出的&#xff0c;可以用来描述目标的边缘、角落和线条等特征。 使用…