实验需求:
1.全网可达
2.基于192.168.0.0/24划分网段
3.静态路由
4.R8环回汇总
步骤
1. 网段划分
(1)192.168.0.00 000000/26----骨干链路(6条链路,6个网段,向主机位再借3位)
192.168.0.00 000000/29---192.168.0.0/29
192.168.0.00 001000/29---192.168.0.8/29
192.168.0.00 010000/29---192.168.0.16/29
192.168.0.00 011000/29---192.168.0.24/29
192.168.0.00 100000/29---192.168.0.3229
192.168.0.00 101000/29---192.168.0.40/29
(其实可以再次划分,30位掩码的情况下可以减少IP地址的浪费,当时写的时候没有注意)
192.168.0.00 110000/29---192.168.0.48/29
192.168.0.00 111000/29---192.168.0.56/29
(2)192.168.0.01 000000/26----R1环回---192.168.0.64/26
3个环回向主机借2位:
192.168.0.01 000000/28---L0---192.168.0.64/28
192.168.0.01 010000/28---L1---192.168.0.80/28
192.168.0.01 100000/28---L2---192.168.0.128/28
192.168.0.01 110000/28
(3)192.168.0.10 000000/26----dhcp服务---192.168.0.128/26
需要两个vlan网段,向主机为借1位即可:
192.168.0.10 0 00000---vlan2---192.168.0.128/27
192.168.0.10 1 00000---vlan3---192.168.0.160/27
(4)192.168.0.11 000000/26---保留---192.168.0.192/26
2.配置ip
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.0.1 29 //配置0/0/0接口
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.0.17 29 //配置0/0/1接口
[R1-GigabitEthernet0/0/1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.0.65 28 //配置R1的环回接口L0
[R1-LoopBack0]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.0.81 28 //配置R1的环回接口L1
[R1-LoopBack0]interface LoopBack 2
[R1-LoopBack1]ip address 192.168.0.129 28 //配置R1的环回接口L2
r2
r3
r4
r5
isp
3. vlan划分
lsw1
lsw2
r3
4.r3配置dhcp
[R3]dhcp enable
[R3]ip pool a
[R3-ip-pool-a]network 192.168.0.128 mask 27
[R3-ip-pool-a]gateway-list 192.168.0.129
[R3-ip-pool-a]dns-list 144.144.144.144 8.8.8.8
[R3-ip-pool-a]q
[R3]int g0/0/2.1
[R3-GigabitEthernet0/0/2.1]dhcp select global
[R3]ip pool b
[R3-ip-pool-b]network 192.168.0.160 mask 27
[R3-ip-pool-b]gateway-list 192.168.0.161
[R3-ip-pool-b]dns-list 144.144.144.144 8.8.8.8
[R3-ip-pool-b]q
[R3]int g0/0/2.2
[R3-GigabitEthernet0/0/2.2]dhcp select global
5.静态路由
r1
r2
r3
r4
r5