1.首先分析目前所需要的网段:直链6个+环回8个=14个,即2^4,骨干链路有两个IP地址,所以最小网络位可以是30位
2.分配环回电路的网关(因为是环回电路没有主机,可以用30位的网络位):
r1---192.168.1.0/31---192.168.1.4/31
r2---192.168.1.8/31---192.168.1.12/31
r3---192.168.1.16/31---192.168.1.20/31
r4---192.168.1.32/31---192.168.1.36/31
3.分配骨干电路网关(因为骨干电路ip不涉及汇总,所以我就一个一个往前推)
r1,r2之间---192.168.1.44/30
r1,r3之间---192.168.1.28/30
r2,r4之间---192.168.1.48/30
r3,r4之间---192.168.1.52/30
r4,r5之间千兆路由---192.168.1.56/30
r4,r5之间百兆路由---192.168.1.60/30
在ENSP中标记好如下图
4.接下来开始配接口IP
[R1-GigabitEthernet0/0/0]ip address 192.168.1.45 30
Dec 4 2021 18:25:12-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/1]ip address 192.168.1.29 30
Dec 4 2021 18:25:27-08:00 R1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state. ---r1两个接口的IP
[r2-GigabitEthernet0/0/0]ip address 192.168.1.6 30
Dec 3 2021 17:50:36-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/1]ip address 192.168.1.49 30
Dec 4 2021 18:28:14-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两个接口的IP
[r3-GigabitEthernet0/0/1]ip address 192.168.1.53 30
Dec 4 2021 18:28:48-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/0]ip address 192.168.1.30 30
Dec 4 2021 18:28:34-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两个接口的IP
[r4-GigabitEthernet0/0/0]ip address 192.168.1.54 30
Dec 4 2021 18:29:13-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/1]ip address 192.168.1.50 30
Dec 4 2021 18:29:34-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/2]ip address 192.168.1.57 30
Dec 4 2021 18:29:46-08:00 r4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[r4-GigabitEthernet4/0/0]ip address 192.168.1.61 30
Dec 4 2021 18:30:09-08:00 r4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet4/0/0 has entered the UP state. ---r4四个接口的IP
[r5-GigabitEthernet0/0/0]ip address 192.168.1.58 30
Dec 4 2021 18:30:48-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r5-GigabitEthernet0/0/1]ip address 192.168.1.62 30
Dec 4 2021 18:31:00-08:00 r5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state. ---r5两个接口的IP
5.开始给r1,r2,r3,r4加环回路由
[R1-LoopBack0]ip address 192.168.1.1 30
[R1-LoopBack1]ip address 192.168.1.5 30 ---r1环回路由
[r2-LoopBack0]ip address 192.168.1.9 30
[r2-LoopBack1]ip address 192.168.1.13 31---r2环回路由
[r3-LoopBack0]ip address 192.168.1.17 30
[r3-LoopBack1]ip address 192.168.1.21 30---r3环回路由
[r4-LoopBack0]ip address 192.168.1.33 30
[r4-LoopBack1]ip address 192.168.1.37 30---r4环回路由
[r5-LoopBack0]ip address 5.5.5.1 24 ---r5环回路由
6.写静态路由条目(下一跳)
[R1]ip route-static 192.168.1.48 30 192.168.1.46
[R1]ip route-static 192.168.1.52 30 192.168.1.30
[R1]ip route-static 192.168.1.56 30 192.168.1.46
[R1]ip route-static 192.168.1.60 30 192.168.1.30---r1下一跳
[r2]ip route-static 192.168.1.28 30 192.168.1.45
[r2]ip route-static 192.168.1.52 30 192.168.1.50
[r2]ip route-static 192.168.1.56 30 192.168.1.50
[r2]ip route-static 192.168.1.60 30 192.168.1.50---r2下一跳
[r3]ip route-static 192.168.1.44 30 192.168.1.29
[r3]ip route-static 192.168.1.48 30 192.168.1.54
[r3]ip route-static 192.168.1.60 30 192.168.1.54
[r3]ip route-static 192.168.1.56 30 192.168.1.54---r3下一跳
[r4]ip route-static 192.168.1.44 30 192.168.1.49
[r4]ip route-static 192.168.1.28 30 192.168.1.53
[r4]ip route-static 0.0.0.0 0 192.168.1.58
[r4]ip route-static 0.0.0.0 0 192.168.1.62 preference 61---r4下一跳以及到r5的缺省路由
[r5]ip route-static 192.168.1.48 30 192.168.1.57
[r5]ip route-static 192.168.1.52 30 192.168.1.61
[r5]ip route-static 192.168.1.28 30 192.168.1.61
[r5]ip route-static 192.168.1.44 30 192.168.1.57---r5下一跳
7.给所有路由器上的环回接口配置空接口防止路由黑洞(汇总)
[R1]ip route-static 192.168.1.0 29 NULL 0 ---r1空接口
[r2]ip route-static 192.168.1.8 29 NULL 0 ---r2空接口
[r3]ip route-static 192.168.1.16 29 NULL 0 ---r3空接口
[r4]ip route-static 192.168.1.32 29 NULL 0 ---r4空接口
8.配置可以到达每一个路由器上环回地址的路由条目(汇总)
[R1]ip route-static 192.168.1.8 29 192.168.1.46
[R1]ip route-static 192.168.1.16 29 192.168.1.30
[R1]ip route-static 192.168.1.32 29 192.168.1.46 ---r1到环回路由的路由汇总
[r2]ip route-static 192.168.1.0 29 192.168.1.45
[r2]ip route-static 192.168.1.32 29 192.168.1.50
[r2]ip route-static 192.168.1.16 29 192.168.1.45 ---r2到环回路由的路由汇总
[r3]ip route-static 192.168.1.0 29 192.168.1.29
[r3]ip route-static 192.168.1.32 29 192.168.1.54
[r3]ip route-static 192.168.1.8 29 192.168.1.29 ---r3到环回路由的路由汇总
[r4]ip route-static 192.168.1.16 29 192.168.1.53
[r4]ip route-static 192.168.1.8 29 192.168.1.49
[r4]ip route-static 192.168.1.0 29 192.168.1.49 ---r4到环回路由的路由汇总
[r5]ip route-static 192.168.1.32 29 192.168.1.57
[r5]ip route-static 192.168.1.8 29 192.168.1.57
[r5]ip route-static 192.168.1.16 29 192.168.1.57
[r5]ip route-static 192.168.1.0 29 192.168.1.57 ---r5到环回路由的路由汇总
9.r1,r2,r3,r4配置到5.5.5.0/24的缺省路由
[R1]ip route-static 0.0.0.0 0 192.168.1.58
[r2]ip route-static 0.0.0.0 0 192.168.1.58
[r3]ip route-static 0.0.0.0 0 192.168.1.58
为什么r4没有配呢,因为r4在最开始通5.5.5.0的时候已经配过缺省了测试:
[R1]ping 5.5.5.1PING 5.5.5.1: 56 data bytes, press CTRL_C to breakReply from 5.5.5.1: bytes=56 Sequence=1 ttl=253 time=30 msReply from 5.5.5.1: bytes=56 Sequence=2 ttl=253 time=30 msReply from 5.5.5.1: bytes=56 Sequence=3 ttl=253 time=40 msReply from 5.5.5.1: bytes=56 Sequence=4 ttl=253 time=30 msReply from 5.5.5.1: bytes=56 Sequence=5 ttl=253 time=30 ms[r2]ping 5.5.5.1PING 5.5.5.1: 56 data bytes, press CTRL_C to breakReply from 5.5.5.1: bytes=56 Sequence=1 ttl=254 time=30 msReply from 5.5.5.1: bytes=56 Sequence=2 ttl=254 time=30 msReply from 5.5.5.1: bytes=56 Sequence=3 ttl=254 time=30 msReply from 5.5.5.1: bytes=56 Sequence=4 ttl=254 time=20 msReply from 5.5.5.1: bytes=56 Sequence=5 ttl=254 time=30 ms[r3]ping 5.5.5.1PING 5.5.5.1: 56 data bytes, press CTRL_C to breakReply from 5.5.5.1: bytes=56 Sequence=1 ttl=254 time=50 msReply from 5.5.5.1: bytes=56 Sequence=2 ttl=254 time=20 msReply from 5.5.5.1: bytes=56 Sequence=3 ttl=254 time=20 msReply from 5.5.5.1: bytes=56 Sequence=4 ttl=254 time=10 msReply from 5.5.5.1: bytes=56 Sequence=5 ttl=254 time=30 ms<r4>ping 5.5.5.1PING 5.5.5.1: 56 data bytes, press CTRL_C to breakReply from 5.5.5.1: bytes=56 Sequence=1 ttl=255 time=30 msReply from 5.5.5.1: bytes=56 Sequence=2 ttl=255 time=30 msReply from 5.5.5.1: bytes=56 Sequence=3 ttl=255 time=10 msReply from 5.5.5.1: bytes=56 Sequence=4 ttl=255 time=30 msReply from 5.5.5.1: bytes=56 Sequence=5 ttl=255 time=20 ms
配置基本到这里就结束了,这里每一个数值都是经过我用了三天时间精准计算的,比如为什么骨干电路的网络位要是30位(一开始就解释过了),至于环回路由可能有人会有疑问为什么我不用29或者28的网络位,首先是因为环回路由只需要一个主机位,那么最小的网络位就是30,然后我又在30里面选出来了两两一组能汇总成29位网络位的网段,所以大家能看到我的每一个路由器上的两个30位环回接口能汇总成一个29位的网段
测试环节就不截图了哈,至于在哪里测试我会在下面详细去写
1.每一个下一跳(例如r1到1.48,1.52,1.56,1.60网段)
2.一定一定要测试r4能不能ping通5.5.5.1(很关键,作为新手的我开始没测试,后面出错了找不出问题)
3.配置完到每一个环回的缺省路由的时候测试看能不能ping通
4.r1到r3全部ping一下5.5.5.1,如果能通那么就意味这个实验就圆满结束了
本文链接:https://my.lmcjl.com/post/1435.html
4 评论