例图:
要求:
1. 全网可达 192.168.1.0/ 24进行IP地址分配
2. R5作为DHCP服务器为pc分配IP地址
3. 路由上均具备2个环回地址
4. R4与R5之间正常走1000M,备用走100M
5. 全网尽量负载均衡
6. 减少路由表数量,并避免环路产生
7. 全网可达
分析:
1.对IP地址进行划分,七个网段分别为:
192.168.1.0/27
192.168.1.32/27
192.168.1.64/27
192.168.1.96/27
192.168.1.128/27
192.168.1.160/27
192.168.192 /26
2.开启DHCP服务,划分连接池 x,配置dhcp,激活接口DHCP功能---dhcp select global
3.配置本地环回
4. 浮动静态路由,修改优先级将一条线路的优先级改大为61 作为备用
配置:
R1配置基本路由信息:
//IP
[r1-GigabitEthernet0/0/0]ip address 192.168.1.2 27
[r1-GigabitEthernet0/0/1]ip address 192.168.1.33 27
//静态
[r1]ip route-static 192.168.1.96 27 192.168.1.34
[r1]ip route-static 192.168.1.128 27 192.168.1.34
[r1]ip route-static 192.168.1.160 27 192.168.1.34
[r1]ip route-static 192.168.1.192 26 192.168.1.34
//环回
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 1.1.1.1 32
R2配置基本路由信息:
//ip
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 27
[r1-GigabitEthernet0/0/1]ip address 192.168.1.65 27
//静态
[r1]ip route-static 192.168.1.32 27 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.2
[r1]ip route-static 192.168.1.128 27 192.168.1.2
[r1]ip route-static 192.168.1.160 27 192.168.1.2
[r1]ip route-static 192.168.1.192 26 192.168.1.2
//环回
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 2.2.2.2 32
R3配置基本路由信息:
//IP
[r3-GigabitEthernet0/0/0]ip address 192.168.1.66 27
[r3-GigabitEthernet0/0/1]ip address 192.168.1.97 27
//静态
[r3]IP route-static 192.168.1.32 27 192.168.1.98
[r3]IP route-static 192.168.1.160 27 192.168.1.98
[r3]IP route-static 192.168.1.128 27 192.168.1.98
[r3]IP route-static 192.168.1.192 26 192.168.1.98
[r3]IP route-static 192.168.1.0 27 192.168.1.65
//环回
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 3.3.3.3 32
R4配置基本路由信息:
//ip
[r4-GigabitEthernet0/0/0]ip address 192.168.1.34 27
[r4-GigabitEthernet0/0/1]ip address 192.168.1.98 27
[r4-GigabitEthernet0/0/2]ip address 192.168.1.161 27
[r4-GigabitEthernet4/0/0]ip address 192.168.1.129 27
//静态
[r4]IP route-static 192.168.1.192 26 192.168.1.200
//更改静态优先级
[r4]IP route-static 192.168.1.192 26 192.168.1.162 preference 61
[r4]ip route-static 192.168.1.0 27 192.168.1.33
[r4]ip route-static 192.168.1.64 27 192.168.1.97
//环回
[r4]interface LoopBack 0
[r4-LoopBack0]ip address 4.4.4.4 32
R5配置基本路由信息:
//ip
[r5-GigabitEthernet0/0/0]ip address 192.168.1.162 27
[r5-GigabitEthernet0/0/2]ip address 192.168.1.200 27
[r5-GigabitEthernet0/0/1]ip address 192.168.1.193 26
//配置DHCP 连接池
[r5]ip pool x
[r5-ip-pool-x]network 192 168.1.192 26
[r5-ip-pool-x]network 192.168.1.192 mask 255.255.255.192
[r5-ip-pool-x]gateway-list
[r5-ip-pool-x]gateway-list 192.168.1.193
[r5-ip-pool-x]dns-list 8.8.8.8 114.114.114.114
[r5-GigabitEthernet0/0/1]dhcp select global
//静态
[r5]ip route-static 192.168.1.0 27 192.168.1.129
[r5]ip route-static 192.168.1.32 27 192.168.1.129
[r5]ip route-static 192.168.1.64 27 192.168.1.129
[r5]ip route-static 192.168.1.96 27 192.168.1.129
[r5]ip route-static 192.168.1.0 27 192.168.1.161
[r5]ip route-static 192.168.1.32 27 192.168.1.161
[r5]ip route-static 192.168.1.64 27 192.168.1.161
[r5]ip route-static 192.168.1.96 27 192.168.1.161
//环回
[r5]interface LoopBack 0
[r5-LoopBack0]ip address 5.5.5.5 32
结果图:
DHCP
全网可达