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.mzph.cn/news/1164.shtml

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

相关文章

51单片机学习--独立按键控制LED

功能&#xff1a;按下K1时D1亮&#xff0c;松开时D1灭&#xff0c;P3_1对应K1 , P2_0对应D1 #include <REGX52.H>void main() {while(1) {if(P3_1 0) //按下K1{P2_0 0;}else{P2_0 1;}}} 按下按钮和松开按钮时会有抖动&#xff0c;所以需要用延时函数来避免抖动造成的…

短视频抖音账号矩阵系统源码开发分享

引用&#xff1a;MySQL数据库&#xff0c;NGINX&#xff0c;PHP7.4&#xff0c;MySQL5.7&#xff0c;redis 媒体组件 组件 描述 image 图片 图片。支持 JPG、PNG、SVG、WEBP、GIF 等格式。 video 视频 视频组件。相关 API 请参考 tt.createVideoContext。 开发背景&…

手机快充协议

高通:QC2.0、QC3.0、QC3.5、QC4.0、QC5.0、 FCP、SCP、AFC、SFCP、 MTKPE1.1/PE2.0/PE3.0、TYPEC、PD2.0、PD3.0/3.1、VOOC 支持 PD3.0/PD2.0 支持 QC3.0/QC2.0 支持 AFC 支持 FCP 支持 PE2.0/PE1.1 联发科的PE&#xff08;Pump Express&#xff09;/PE 支持 SFCP 在PP…

计算机网络——三次握⼿、四次挥手

TCP 三次握手 1、第⼀个SYN报⽂&#xff1a; 客户端随机初始化序列号client_isn&#xff0c;放进TCP⾸部序列号段&#xff0c; 然后把SYN置1。把SYN报⽂发送给服务端&#xff0c;表⽰发起连接&#xff0c; 之后客户端处于SYN-SENT状态。 2、第⼆个报⽂SYNACK报⽂&#xff1a; …

MQTT协议在物联网环境中的应用及代码实现解析(一)

MQTT协议全称是Message Queuing Telemetry Transport&#xff0c;翻译过来就是消息队列遥测传输协议&#xff0c;它是物联网常用的应用层协议&#xff0c;运行在TCP/IP中的应用层中&#xff0c;依赖TCP协议&#xff0c;因此它具有非常高的可靠性&#xff0c;同时它是基于TCP协议…

TCP/IP协议是什么?

78. TCP/IP协议是什么&#xff1f; TCP/IP协议是一组用于互联网通信的网络协议&#xff0c;它定义了数据在网络中的传输方式和规则。作为前端工程师&#xff0c;了解TCP/IP协议对于理解网络通信原理和调试网络问题非常重要。本篇文章将介绍TCP/IP协议的概念、主要组成部分和工…

深度学习 / 数据处理:如何处理偏态数据

1 前言 当我们使用一个线性回归模型时&#xff0c;通常这个模型是在很大假设的前提下才有一个很好的结果&#xff1a; 1、假设预测因子和预测目标之间的关系是线性的2、数据不存在外在噪声&#xff1a;不存在一些极端的数据3、非共线性&#xff08; collinearity&#xff09;…

新增进程管理、SSH会话管理功能,1Panel开源面板v1.4.0发布

2023年7月17日&#xff0c;现代化、开源的Linux服务器运维管理面板1Panel正式发布v1.4.0版本。 在这个版本中&#xff0c;1Panel新增了进程管理和SSH会话管理功能&#xff1b;支持容器编辑和升级&#xff0c;数据库兼容MySQL 5.6&#xff1b;备份账号可以添加微软OneDrive&…

github简单使用

留个链接等着吃灰 链接github的使用 举例 先选择需要上传的文件夹 比如db -main文件夹 gitbash 打开shell 进行如下的操作 一般都得写的东西 git init git remote add origin 想要上传的地址 git pull 将远程库拉过来 如果远程没有文件的话 那么shell就显示没有文件 git …

【Vue】 在 vue 中使用 iframe 挂载 html 文件

文章目录 首先需要将要挂载的html文件放到public 文件夹中 路径的引用形式 <iframe ref"sheet" src"/luckysheet.html" width"100%" height"100%"></iframe>通过绑定 ref 获取到 iframe&#xff0c;data为我需要传递的数…

Vscode自定义注释模板

首先安装插件Doxygen Documentation Generator&#xff0c;安装完成之后点击Doxygen插件的设置&#xff0c;按照下面的步骤打开settings.json进行编辑&#xff1a; 在settings.json中追加如下代码&#xff1a; "doxdocgen.file.copyrightTag": ["Copyright (C),…

Python一行命令搭建HTTP服务器并外网访问+-+内网穿透

文章目录 1.前言2.本地http服务器搭建2.1.Python的安装和设置2.2.Python服务器设置和测试 3.cpolar的安装和注册3.1 Cpolar云端设置3.2 Cpolar本地设置 4.公网访问测试5.结语 转载自远程内网穿透的文章&#xff1a;【Python】快速简单搭建HTTP服务器并公网访问「cpolar内网穿透…

FlinkCDC第四部分-同步mysql到mysql,ctrl就完事~(flink版本1.17.1)

本文介绍了不同源单表-单表同步&#xff0c;不同源多表-单表同步。 注&#xff1a;此版本支持火焰图 Flink版本&#xff1a;1.17.1 环境&#xff1a;Linux CentOS 7.0、jdk1.8 基础文件&#xff1a; flink-1.17.1-bin-scala_2.12.tgz、 flink-connector-jdbc-3.0.0-1.16.…

人工智能与Chat GPT

一本书全面掌握ChatGPT&#xff0c;既有向ChatGPT提问的技巧&#xff0c; 也有构建自己的ChatGPT模型的方法&#xff0c;涵盖开发背景、关联技术、使用方法、应用形式、实用案例等 人工智能是我们这个时代最热门的话题&#xff0c;人们既希望它能代替我们做一些工作&#xff0c…

云原生——Docker容器化实战

❄️作者介绍&#xff1a;奇妙的大歪❄️ &#x1f380;个人名言&#xff1a;但行前路&#xff0c;不负韶华&#xff01;&#x1f380; &#x1f43d;个人简介&#xff1a;云计算网络运维专业人员&#x1f43d; 前言 "Docker"一词指代了多个概念&#xff0c;包括开源…

uniapp调接口出现跨域问题。

今天在写uniapp项目的时候&#xff0c;使用在线模拟接口的时候&#xff0c;出现跨域问题。 【问题描述】&#xff1a; ①在内嵌浏览器运行&#xff0c;不会出现跨域问题&#xff0c;好像是内嵌浏览器自动去掉了跨域问题。 ②在外部浏览器调用的时候会出现跨域问题。&#xf…

IDEA 搭建Android 开发环境

项目实战 废话不多说开始创建先第一个 Android 项目 步骤一 FILE → New → Project 步骤二-选择 Android 项目模板 选那个安卓机器人,如果没有这个选项,需要升级IDEA版本或者安装安卓插件 选择*Basic Activity* Next-下一步 步骤三-项目初始化 名称、包名、安装位置自行调整…

3DE重客户端安装

3DE重客户端安装 一、百度网盘下载路径二、详细安装步骤 一、百度网盘下载路径 https://pan.baidu.com/s/16TltMRbrWuSe7p-Vn1x4Dw?pwdfku7 提取码&#xff1a;fku7 二、详细安装步骤 1、将\3deinstall\2022x_install_GA目录下的所有.tar文件全选解压 2.点击\3deinstall\…

ubuntu 20.04, 22.04网络配置比较

1.ubuntu 20.04网络配置&#xff0c;配置静态IP&#xff1a;切换roote用户&#xff0c;vi /etc/netplan/00-installer-config.yaml&#xff0c;修改网络配置&#xff0c;格式如下&#xff1a; network: ethernets: ens33: dhcp4: false addresses: [172.22.…

切换.net Framework 版本后,出现NuGet 包是使用不同于当前目标框架的目标框架安装的,可能需要重新安装

问题现象&#xff1a; 由于添加新的dll文件&#xff0c;依赖的.NET Framework版本与当前的不一致&#xff0c;在vs 中切换了目标框架版本后&#xff0c;运行程序&#xff0c;出现以下的warnning信息&#xff1a; 一些 NuGet 包是使用不同于当前目标框架的目标框架安装的&#…