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、网络综合实验讲解
物理层——定义电气电压接口规范光学特性
数据链路层
MAC
媒介访问控制层LLC
逻辑链路层(为上层提供FCS
校验)网络层——通过IP
地址进行逻辑寻址,代表设备路由器。
物理层,数据链路层以及网络层能不能全网可达?可以全网可达。
传输层——通过端口号区分不同的服务,数据分段,确认重传排序流控(只针对于TCP)。
TCP
面向连接的可靠传输协议TCP
,UDP
IP
,ICMP
,ARP
UDP
非面向连接的不可靠传输协议会话层——建立,维持,终止会话进程。
表示层——编码解码,加密解密
应用层——实现人机交互的界面
数据封装以及解封装
以太网一类帧二类帧封装——IP——TCP/UDP——data数据包——FCS校验(逻辑链路层提供)
数据分段的标准,MYU最大传输单元1500字节,MSS最大段长度,1480。(原因是报头长度为20字节)
TCP-IP协议栈与OSI模型对比:
滑动窗口就是流控,什么是滑动窗口?其实是吞吐量的问题。
IPV4数据包结构:
IPV4数据包格式:
注意到一个IP数据报由总长为20字节的首部(假设无选项)。如果数据报承载一个TCP报文段,则每个(无分片的)数据报共承载了总长40字节的首部(20字节的IP首部加上20字节的TCP首部)以及应用层报文。
UDP数据报结构:
TCP数据报结构:
与UDP一样,首部包含了源端口号与目的端口号,它被用于多路复用/分解来自或送到上层应用的数据,另外,同UDP一样,TCP同样有检验和字段。
拓扑中所需地址基于192.168.0.0/24进行划分这里我们首先数图中需要多少个网段?
所以,我们首先进行划分网段
192.168.0.0/24需要划分9个网段——也就向后借位,借4位
128-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.168。0.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
同时剩下的作为保留网段
R1 实现代码:
<Huawei>sys
[Huawei]sys R1
[R1]user-interface console 0
[R1-ui-console0]idle-timeout 0 0
[R1-ui-console0]quit
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.0.17 28
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.0.97 28
[R1-GigabitEthernet0/0/1]quit
[R1]int LoopBack 0
[R1-LoopBack0]ip address 192.168.0.1 30
[R1-LoopBack0]int l 1
[R1-LoopBack1]ip address 192.168.0.65 30
[R1-LoopBack1]int l 2
[R1-LoopBack2]ip address 192.168.0.129 30
[R1-LoopBack2]quit
[R1]
查看结果:全up
[R1]display ip interface brief
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 R2
[R2]user-interface console 0
[R2-ui-console0]idle-timeout 0 0
[R2-ui-console0]quit
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.0.18 28
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.0.33 28
[R2-GigabitEthernet0/0/1]quit
[R2]
查看结果:
[R2]display ip interface brief
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-interface console 0
[R3-ui-console0]idle-timeout 0 0
[R3-ui-console0]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.0.34 28
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.0.82 28
[R3-GigabitEthernet0/0/1]int g0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.0.49 28
[R3-GigabitEthernet0/0/2]int g4/0/0
[R3-GigabitEthernet4/0/0]ip address 192.168.0.65 28
[R3-GigabitEthernet4/0/0]quit
[R3]
查看结果:
[R3]display ip interface brief
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
[Huawei]sys R4
[R4]user-interface console 0
[R4-ui-console0]idle-timeout 0 0
[R4-ui-console0]quit
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.0.81 28
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.0.98 28
[R4-GigabitEthernet0/0/1]int g0/0/2.1
[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 address 192.168.0.129 28
[R4-GigabitEthernet0/0/2.2]quit
[R4]
查看结果:
[R4]display ip interface brief
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
[Huawei]sys R5
[R5]user-interface console 0
[R5-ui-console0]idle-timeout 0 0
[R5-ui-console0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.0.66 28
[R5-GigabitEthernet0/0/1]int g0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.0.50 28
[R5-GigabitEthernet0/0/0]int g0/0/2
[R5-GigabitEthernet0/0/2]ip address 100.1.1.2 24
[R5-GigabitEthernet0/0/2]quit
[R5]
查看结果:
[R5]display ip interface brief
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
[Huawei]sys R6
[R6]user-interface console 0
[R6-ui-console0]idle-timeout 0 0
[R6-ui-console0]int g0/0/0
[R6-GigabitEthernet0/0/0]ip address 100.1.1.1 24
[R6-GigabitEthernet0/0/0]quit
[R6]dis
查看结果:
[R6]display ip interface brief
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]
SW1 实现代码:
<Huawei>sys
[Huawei]sys SW1
[SW1]vlan b
[SW1]vlan batch 2 3
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 2
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 3
[SW1-GigabitEthernet0/0/2]int g0/0/3
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3
[SW1-GigabitEthernet0/0/3]quit
[SW1]
输出结果:
[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
[Huawei]sys SW2
[SW2]vlan batch 2 3
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]port link-type trunk
[SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
[SW2-GigabitEthernet0/0/1]int g0/0/2
[SW2-GigabitEthernet0/0/2]port link-type access
[SW2-GigabitEthernet0/0/2]port default vlan 2
[SW2-GigabitEthernet0/0/2]int g0/0/3
[SW2-GigabitEthernet0/0/3]port link-type access
[SW2-GigabitEthernet0/0/3]port default vlan 3
[SW2-GigabitEthernet0/0/3]quit
[SW2]
查看结果:
[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]
R1 实现代码:
[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
R2 实现代码:
[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
R3 实现代码:
[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
R4实现代码:
[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
R5 实现代码:
[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
R6实现代码:
[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
查看结果:
R1路由表:
[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]
R4实现代码:
[R4]dhcp enable
[R4]ip pool 1
[R4-ip-pool-1]network 192.168.0.112 mask 28
[R4-ip-pool-1]gateway-list 192.168.0.113
[R4-ip-pool-1]quit
[R4]ip pool 2
[R4-ip-pool-2]network 192.168.0.128 mask 28
[R4-ip-pool-2]gateway-list 192.168.0.129
[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]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]dot1q termination vid 2
[R4-GigabitEthernet0/0/2.1]int g0/0/2.2
[R4-GigabitEthernet0/0/2.2]dot1q termination vid 3
[R4-GigabitEthernet0/0/2.2]quit
[R4]int g0/0/2.1
[R4-GigabitEthernet0/0/2.1]arp broadcast enable
[R4-GigabitEthernet0/0/2.1]int g0/0/2.2
[R4-GigabitEthernet0/0/2.2]arp broadcast enable
[R4-GigabitEthernet0/0/2.2]quit
[R4]
1、配置缺省路由
R1实现代码:
[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
R2实现代码:
[R2]ip route-static 0.0.0.0 0 192.168.0.34
R3实现代码:
[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
R4实现代码:
[R4]ip route-static 0.0.0.0 0 192.168.0.82
R5实现代码:
[R5]ip route-static 0.0.0.0 0 100.1.1.1
2、配置空接口防环
R1实现代码:
[R1]ip route-static 192.168.0.0 28 NU
[R1]ip route-static 192.168.0.0 28 NULL 0