需求:13个广播域
为什么是13?
R1、R2、R4 各外接两个 共6个
R1、R2、R3、R4、R5间相互连接 共7个
总共13个广播域
将R1、R2、R4中的各自两个用户网段合二为一 3个
R3下用户网段1个 再将所有骨干链路合为1个
从而将需求由13个降为5个网段
一、子网划分
1.192.168.1.0 27 骨干链路
骨干链路中需要两个IP 所以主机位为2 掩码为30
192.168.1.000 000 00 30 -> 192.168.1.0 30
192.168.1.000 001 00 30 -> 192.168.1.4 30
192.168.1.000 010 00 30 -> 192.168.1.8 30
...
192.168.1.000 111 00 30 -> 192.168.1.28 30
2.192.168.1.32 27 R1环回
使用后再对该网段进行子网划分 分成两个网段交予用户网段使用
192.168.1.001 0 0000 28 -> 192.168.1.32 28
192.168.1.001 1 0000 28 -> 192.168.1.48 28
所以R1一共三个IP 分别为192.168.1.32 27;192.168.1.32 28;192.168.1.48 28
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]int lo0
[R1-LoopBack0]ip add 192.168.1.33 28
[R1-LoopBack0]int lo1
[R1-LoopBack1]ip add 192.168.1.49 28[R1-LoopBack1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
Jul 12 2023 21:01:18-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.9 30
Jul 12 2023 21:01:29-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
3.192.168.1.64 27 R2环回
192.168.1.010 0 0000 28 -> 192.168.1.64 28
192.168.1.010 1 0000 28 -> 192.168.1.80 28
同上,R2网段有 192.168.1.64 27;192.168.1.64 28; 192.168.1.80 28
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]int lo0
[R2-LoopBack0]ip add 192.168.1.65 28
[R2-LoopBack0]int lo1
[R2-LoopBack1]ip add 192.168.1.81 28
[R2-LoopBack1]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
Jul 12 2023 21:06:35-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/0]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.1.5 30
Jul 12 2023 21:07:02-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
4.192.168.1.96 27 R4环回
192.168.1.011 0 0000 28 -> 192.168.1.96 28
192.168.1.011 1 0000 28 -> 192.168.1.112 28
同上......
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]int lo0
[R4-LoopBack0]ip add 192.168.1.97 28
[R4-LoopBack0]int lo1
[R4-LoopBack1]ip add 192.168.1.113 28
[R4-LoopBack1]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.1.6 30
Jul 12 2023 21:10:38-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/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.1.17 30
[R4-GigabitEthernet0/0/1]
Jul 12 2023 21:11:18-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/1]int g 0/0/2
[R4-GigabitEthernet0/0/2]ip add 192.168.1.21 30
[R4-GigabitEthernet0/0/2]
Jul 12 2023 21:11:31-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-GigabitEthernet0/0/2]int g 3/0/0
[R4-GigabitEthernet3/0/0]ip add 192.168.1.13 30
[R4-GigabitEthernet3/0/0]
Jul 12 2023 21:11:52-08:00 R4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet3/0/0 has entered the UP state.
5.192.168.1.128 27 R3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.1.14 30
Jul 12 2023 21:17:03-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.1.10 30
Jul 12 2023 21:17:18-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R3-GigabitEthernet0/0/0]int g 0/0/2
[R3-GigabitEthernet0/0/2]ip add 192.168.1.129 27
[R3-GigabitEthernet0/0/2]
Jul 12 2023 21:17:33-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
6. R5环回
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R5
[R5]int lo0
[R5-LoopBack0]ip add 5.5.5.5 24
[R5-LoopBack0]int lo1
[R5-LoopBack1]ip add 6.6.6.6 24
[R5-LoopBack1]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
Jul 12 2023 21:19:53-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/0]int g 0/0/1
[R5-GigabitEthernet0/0/1]ip add 192.168.1.22 30
Jul 12 2023 21:20:04-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
二、路由配置
R1:
R2、R2R3间骨干链路、R4(两条路)、R5(两条路)、R3R4骨干链路、R3
[R1]ip route-static
[R1]ip route-static 192.168.1.96 27 192.168.1.2
[R1]ip route-static 192.168.1.4 30 192.168.1.2
[R1]ip route-static 192.168.1.64 27 192.168.1.2
[R1]ip route-static 192.168.1.64 27 192.168.1.10
[R1]ip route-static 192.168.1.16 30 192.168.1.2
[R1]ip route-static 192.168.1.16 30 192.168.1.10[R1]ip route-static 192.168.1.12 30 192.168.1.10
[R1]ip route-static 192.168.1.128 27 192.168.1.10
R2:
R4、R1、R4与R5之间骨干链路、R3与R4的骨干链路、R3、R1与R3的链路
R3:
R1、R2、R4、R1与R2的链路、R2与R4的链路、R4与R5的链路
R4:
R1、R2、R3、R1与R2、R2与R3
R5:
R1、R2、R3、R4、R1与R2、R2与R4、R3与R4、R1与R3
三、访问外网——缺省
R1
ip route-static 0.0.0.0 0 192.168.1.2
ip route-static 0.0.0.0 0 192.168.1.10
R2
ip route-static 0.0.0.0 0 192.168.1.6
R3
ip route-static 0.0.0.0 0 192.168.1.14
R4
ip route-static 0.0.0.0 0 192.168.1.18
若R1中IP遗弃 应在R1上写空接口进行防环
ip route-static 192.168.1.32 27 NULL 0
其他类似
R2:ip route-static 192.168.1.64 27 NULL 0
R3:R3无汇总,所以不需要配置
R4:ip route-static 192.168.1.96 27 NULL 0
四、当0/0/2关闭时,走3/0/0通道
浮动静态路由:
ip-route-static 0.0.0.0 0 192.168.1.22 preference 61——更改优先级
优先级数值越大,优先级反而越小
对R5配置路由 使其可以通过3/0/0访问
R1可通过双通道访问外网,但数据包仅可以从0/0/2通道发送,应配置相关路由
ip-route-static 192.168.1.32 27 192.168.1.21 preference 61
ip-route-static 192.168.1.64 27 192.168.1.21 preference 61
ip-route-static 192.168.1.96 27 192.168.1.21 preference 61
ip-route-static 192.168.1.128 27 192.168.1.21 preference 61