实验要求:
1、全网用192.168.1.0/24进行IP地址分配
2、R7作为DHCP服务器为PC分配IP地址
3、路由上均具备2个环回地址
4、R6与R7之间正常走1000M,备份走100M
5、全网尽量负载均衡
6、减少路由表数量,并避免环路产生
7、全网可达
下图仅为实验参考,具体搭建时路由器名称会有改变
实验分析:
1:全网使用192.168.1.0/24进行IP分配,实验中共有17个广播域,可对其进行子网划分。
2:R7作为DHCP服务器分配IP地址,在R7上实现配置端口IP,配置地址池,启动DHCP服务等操作,然后再在pc端启动DHCP服务,即可自动获取IP。
3:使用interface LoopBack 命令在每个路由器创建两个环回接口。
4:在R6与R7之间,先实现等价路由,再对100M的路线配置优先值。
5:在进行子网划分时,每个子网底下的主机分配均衡。
6:在配置下一跳时理清逻辑,进行合理配置,仅配置一条线路即可。
7:在每个路由器配置好路由表,实现全网可达。
实验过程:
子网划分
1 、192.168.1.0000 0000——192.168.1.0/29
2、192.168.1.0000 1000——192.168.1.8/29
3、 192.168.1.0001 0000——192.168.1.16/29
4 、192.168.1.0001 1000——192.168.1.24/29
5 、192.168.1.0010 0000——192.168.1.32/29
6 、192.168.1.0010 1000——192.168.1.40/29
7 、192.168.1.0011 0000——192.168.1.48/29
8 、192.168.1.0011 1000——192.168.1.56/29
9 、192.168.1.0100 0000——192.168.1.64/29
10、 192.168.1.0100 1000——192.168.1.72/29
11、 192.168.1.0101 0000——192.168.1.80/29
12、 192.168.1.0101 1000——192.168.1.88/29
13、 192.168.1.0110 0000——192.168.1.96/29
14、 192.168.1.0110 1000——192.168.1.104/29
15、 192.168.1.0111 0000——192.168.1.112/29
16 、192.168.1.0111 1000——192.168.1.120/29
17 、192.168.1.1000 0000 ——192.168.1.128/29
18 、192.168.1.1000 1000——192.168.1.136/29
19 、192.168.1.1001 0000——192.168.1.144/29
20 、192.168.1.1001 1000——192.168.1.152/29
21 、192.168.1.1010 0000——192.168.1.160/29
22 、192.168.1.1010 1000——192.168.1.168/29
23 、192.168.1.1011 0000——192.168.1.176/29
24 、192.168.1.1011 1000——192.168.1.188/29
25 、192.168.1.1100 0000——192.168.1.196/29
26 、192.168.1.1100 1000——192.168.1.204/29
27 、192.268.1.1101 0000——192.168.1.212/29
28 、192.168.1.1101 1000——192.168.1.220/29
29 、192.168.1.1110 0000——192.168.1.228/29
30 、192.168.1.1110 1000——192.168.1.236/29
31 、192.168.1.1111 0000——192.168.1.244/29
32 、192.168.1.1111 1000——192.168.1.252/29
对实验图进行标号:
对路由器进行配置:
配置ar5:
环回接口0:
[ar5]interface LoopBack 0
[ar5-LoopBack0]ip address 192.168.1.9 29
环回接口1:
[ar5]interface LoopBack 1
[ar5-LoopBack1]ip address 192.168.1.17 29
配置接口0/0/0:
[ar5]interface GigabitEthernet 0/0/0
[ar5-GigabitEthernet0/0/0]ip address 192.168.1.1 29
配置接口0/0/1:
[ar5]interface GigabitEthernet 0/0/1
[ar5-GigabitEthernet0/0/1]ip address 192.168.1.25 29
查看配置:
[ar5]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/29 up up
GigabitEthernet0/0/1 192.168.1.25/29 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.9/29 up up(s)
LoopBack1 192.168.1.17/29 up up(s)
NULL0 unassigned up up(s)
配置ar7:
环回接口0:
[ar7]interface LoopBack 0
[ar7-LoopBack0]ip address 192.168.1.33 29
环回接口1:
[ar7]interface LoopBack 1
[ar7-LoopBack1]ip address 192.168.1.41 29
配置接口0/0/0:
[ar7]interface GigabitEthernet 0/0/0
[ar7-GigabitEthernet0/0/0]ip address 192.168.1.2 29
配置接口0/0/1:
[ar7]interface GigabitEthernet 0/0/1
[ar7-GigabitEthernet0/0/1]ip address 192.168.1.49 29
查看配置:
[ar7]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.2/29 up up
GigabitEthernet0/0/1 192.168.1.49/29 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.33/29 up up(s)
LoopBack1 192.168.1.41/29 up up(s)
NULL0 unassigned up up(s)
配置ar8:
环回接口0:
[ar8]interface LoopBack 0
[ar8-LoopBack0]ip address 192.168.1.65 29
环回接口1:
[ar8]interface LoopBack 1
[ar8-LoopBack1]ip address 192.168.1.73 29
配置接口0/0/0:
[ar8]interface GigabitEthernet 0/0/0
[ar8-GigabitEthernet0/0/0]ip address 192.168.1.26 29
配置接口0/0/1:
[ar8]interface GigabitEthernet 0/0/1
[ar8-GigabitEthernet0/0/1]ip address 192.168.1.57 29
查看配置:
[ar8]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.26/29 up up
GigabitEthernet0/0/1 192.168.1.57/29 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.65/29 up up(s)
LoopBack1 192.168.1.73/29 up up(s)
NULL0 unassigned up up(s)
配置ar6:
环回接口0:
[ar6]interface LoopBack 0
[ar6-LoopBack0]ip address 192.168.1.89 29
环回接口1:
[ar6]interface LoopBack 1
[ar6-LoopBack1]ip address 192.168.1.81 29
配置接口0/0/0:
[ar6]interface GigabitEthernet 0/0/0
[ar6-GigabitEthernet0/0/0]ip address 192.168.1.50 29
配置接口0/0/1:
[ar6]interface GigabitEthernet 0/0/1
[ar6-GigabitEthernet0/0/1]ip address 192.168.1.58 29
接口配置0/0/2:
[ar6]interface GigabitEthernet 0/0/2
[ar6-GigabitEthernet0/0/2]ip address 192.168.1.97 29
接口配置4/0/0:
[ar6]interface GigabitEthernet 4/0/0
[ar6-GigabitEthernet4/0/0]ip address 192.168.1.105 29
查看配置:
[ar6]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.50/29 up up
GigabitEthernet0/0/1 192.168.1.58/29 up up
GigabitEthernet0/0/2 192.168.1.97/29 up up
GigabitEthernet4/0/0 192.168.1.105/29 up up
LoopBack0 192.168.1.89/29 up up(s)
LoopBack1 192.168.1.81/29 up up(s)
NULL0 unassigned up up(s)
配置ar9:
环回接口0:
[ar9]interface LoopBack 0
[ar9-LoopBack0]ip address 192.168.1.121 29
环回接口1:
[ar9]interface LoopBack 1
[ar9-LoopBack1]ip address 192.168.1.113 29
配置接口0/0/0:
[ar9]interface GigabitEthernet 0/0/0
[ar9-GigabitEthernet0/0/0]ip address192.168.1.98 29
配置接口0/0/1:
[ar9]interface GigabitEthernet 0/0/1
[ar9-GigabitEthernet0/0/1]ip address 192.168.1.129 29
配置接口0/0/2:
[ar9]interface GigabitEthernet 0/0/2
[ar9-GigabitEthernet0/0/2]ip address 192.168.1.106 29
查看配置:
[ar9]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.98/29 up up
GigabitEthernet0/0/1 192.168.1.129/29 up up
GigabitEthernet0/0/2 192.168.1.106/29 up up
GigabitEthernet4/0/0 unassigned down down
LoopBack0 192.168.1.121/29 up up(s)
LoopBack1 192.168.1.113/29 up up(s)
NULL0 unassigned up up(s)
R9作为DHCP服务器为pc分配地址
[ar9]dhcp enable
[ar9]ip pool aa
[ar9-ip-pool-aa]network 192.168.1.128 mask 29
[ar9-ip-pool-aa]gateway-list 192.168.1.129
[ar9-ip-pool-aa]dns-list 8.8.8.8
[ar9]interface GigabitEthernet 0/0/1
[ar9-GigabitEthernet0/0/1]dhcp select global
查看配置:
[ar9]display ip pool
Pool-name : aa
Pool-No : 0
Position : Local Status : Unlocked
Gateway-0 : 192.168.1.129
Mask : 255.255.255.248
VPN instance : --
IP address Statistic
Total :5
Used :2 Idle :3
Expired :0 Conflict :0 Disable :0
查看pc配置:
配置浮动静态路由
[ar6]ip route-static 192.168.1.120 29 192.168.1.98
[ar6]ip route-static 192.168.1.112 29 192.168.1.98
[ar6]ip route-static 192.168.1.128 29 192.168.1.98
[ar6]ip route-static 192.168.1.120 29 192.168.1.106 preference 70
[ar6]ip route-static 192.168.1.112 29 192.168.1.106 preference 70
[ar6]ip route-static 192.168.1.128 29 192.168.1.106 preference 70
查看配置:
192.168.1.112/29 Static 70 0 R 192.168.1.106 GigabitEthernet
4/0/0
192.168.1.120/29 Static 70 0 R 192.168.1.106 GigabitEthernet
4/0/0
192.168.1.128/29 Static 70 0 R 192.168.1.106 GigabitEthernet
4/0/0
全网可达
ar5:
ar5---ar7:
[ar5]ip route-static 192.168.1.32 29 192.168.1.2
[ar5]ip route-static 192.168.1.40 29 192.168.1.2
[ar5]ip route-static 192.168.1.48 29 192.168.1.2
ar7---ar6:
[ar5]ip route-static 192.168.1.88 29 192.168.1.50
[ar5]ip route-static 192.168.1.80 29 192.168.1.50
[ar5]ip route-static 192.168.1.96 29 192.168.1.50
[ar5]ip route-static 192.168.1.104 29 192.168.1.50
ar5---ar8:
[ar5]ip route-static 192.168.1.64 29 192.168.1.26
[ar5]ip route-static 192.168.1.72 29 192.168.1.26
[ar5]ip route-static 192.168.1.56 29 192.168.1.26
ar8---ar6:
[ar5]ip route-static 192.168.1.88 29 192.168.1.58
[ar5]ip route-static 192.168.1.80 29 192.168.1.58
[ar5]ip route-static 192.168.1.96 29 192.168.1.58
[ar5]ip route-static 192.168.1.104 29 192.168.1.58
ar6---ar9:
[ar5]ip route-static 192.168.1.120 29 192.168.1.98
[ar5]ip route-static 192.168.1.112 29 192.168.1.98
[ar5]ip route-static 192.168.1.128 29 192.168.1.98
[ar5]ip route-static 192.168.1.120 29 192.168.1.106
[ar5]ip route-static 192.168.1.112 29 192.168.1.106
[ar5]ip route-static 192.168.1.128 29 192.168.1.106
ar7:
ar7---ar5:
[ar7]ip route-static 192.168.1.8 29 192.168.1.1
[ar7]ip route-static 192.168.1.16 29 192.168.1.1
[ar7]ip route-static 192.168.1.24 29 192.168.1.1
ar5---ar8:
[ar7]ip route-static 192.168.1.64 29 192.168.1.26
[ar7]ip route-static 192.168.1.72 29 192.168.1.26
[ar7]ip route-static 192.168.1.56 29 192.168.1.26
ar7---ar6:
[ar7]ip route-static 192.168.1.88 29 192.168.1.50
[ar7]ip route-static 192.168.1.80 29 192.168.1.50
[ar7]ip route-static 192.168.1.96 29 192.168.1.50
[ar7]ip route-static 192.168.1.104 29 192.168.1.50
ar6---ar8:
[ar7]ip route-static 192.168.1.24 29 192.168.1.57
[ar7]ip route-static 192.168.1.64 29 192.168.1.57
[ar7]ip route-static 192.168.1.72 29 192.168.1.5
ar6---ar9:
[ar7]ip route-static 192.168.1.120 29 192.168.1.98
[ar7]ip route-static 192.168.1.112 29 192.168.1.98
[ar7]ip route-static 192.168.1.128 29 192.168.1.98
[ar7]ip route-static 192.168.1.120 29 192.168.1.106
[ar7]ip route-static 192.168.1.112 29 192.168.1.106
[ar7]ip route-static 192.168.1.128 29 192.168.1.106
ar6:
ar6---ar7:
[ar6]ip route-static 192.168.1.32 29 192.168.1.49
[ar6]ip route-static 192.168.1.40 29 192.168.1.49
[ar6]ip route-static 192.168.1.0 29 192.168.1.49
ar7---ar5:
[ar6]ip route-static 192.168.1.8 29 192.168.1.1
[ar6]ip route-static 192.168.1.16 29 192.168.1.1
[ar6]ip route-static 192.168.1.24 29 192.168.1.1
ar6---ar8:
[ar6]ip route-static 192.168.1.64 29 192.168.1.57
[ar6]ip route-static 192.168.1.72 29 192.168.1.57
[ar6]ip route-static 192.168.1.24 29 192.168.1.57
ar6---ar9:
[ar6]ip route-static 192.168.1.120 29 192.168.1.98
[ar6]ip route-static 192.168.1.112 29 192.168.1.98
[ar6]ip route-static 192.168.1.128 29 192.168.1.98
[ar6]ip route-static 192.168.1.128 29 192.168.1.106
[ar6]ip route-static 192.168.1.120 29 192.168.1.106
[ar6]ip route-static 192.168.1.112 29 192.168.1.106
ar8:
ar8---ar5:
[ar8]ip route-static 192.168.1.8 29 192.168.1.25
[ar8]ip route-static 192.168.1.16 29 192.168.1.25
[ar8]ip route-static 192.168.1.0 29 192.168.1.25
ar5---ar7:
[ar8]ip route-static 192.168.1.32 29 192.168.1.2
[ar8]ip route-static 192.168.1.40 29 192.168.1.2
[ar8]ip route-static 192.168.1.48 29 192.168.1.2
ar8---ar6:
[ar8]ip route-static 192.168.1.88 29 192.168.1.58
[ar8]ip route-static 192.168.1.80 29 192.168.1.58
[ar8]ip route-static 192.168.1.96 29 192.168.1.58
[ar8]ip route-static 192.168.1.104 29 192.168.1.58
ar6---ar9:
[ar8]ip route-static 192.168.1.120 29 192.168.1.98
[ar8]ip route-static 192.168.1.112 29 192.168.1.98
[ar8]ip route-static 192.168.1.128 29 192.168.1.98
[ar8]ip route-static 192.168.1.120 29 192.168.1.106
[ar8]ip route-static 192.168.1.112 29 192.168.1.106
[ar8]ip route-static 192.168.1.128 29 192.168.1.106
ar9:
ar9---ar6:
[ar9]ip route-static 192.168.1.48 29 192.168.1.97
[ar9]ip route-static 192.168.1.88 29 192.168.1.97
[ar9]ip route-static 192.168.1.80 29 192.168.1.97
[ar9]ip route-static 192.168.1.56 29 192.168.1.97
[ar9]ip route-static 192.168.1.56 29 192.168.1.105
[ar9]ip route-static 192.168.1.80 29 192.168.1.105
[ar9]ip route-static 192.168.1.88 29 192.168.1.105
[ar9]ip route-static 192.168.1.48 29 192.168.1.105
ar6---ar7:
[ar9]ip route-static 192.168.1.32 29 192.168.1.49
[ar9]ip route-static 192.168.1.40 29 192.168.1.49
[ar9]ip route-static 192.168.1.0 29 192.168.1.49
ar7---ar5:
[ar9]ip route-static 192.168.1.8 29 192.168.1.1
[ar9]ip route-static 192.168.1.16 29 192.168.1.1
[ar9]ip route-static 192.168.1.24 29 192.168.1.1
ar6---ar8:
[ar9]ip route-static 192.168.1.64 29 192.168.1.57
[ar9]ip route-static 192.168.1.72 29 192.168.1.57
[ar9]ip route-static 192.168.1.24 29 192.168.1.57
ar8---ar5:
[ar9]ip route-static 192.168.1.8 29 192.168.1.25
[ar9]ip route-static 192.168.1.16 29 192.168.1.25
[ar9]ip route-static 192.168.1.0 29 192.168.1.25
测试结果:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.