题目:
如图所示
全网可达;
拓扑中所需地址全部基于192.168.0.0/24划分所得;
静态路由(不许使用其他动态);
R8环回需要汇总。
1、IP地址规划
192.168.0.0/24
根据题目,可以先分为4个网段,需要向主机位借2位,2^2=4
R8-R11骨干:
192.168.0.00 000000/26 = 192.168.0.0/26
R8-R7: 192.168.0.00 0000 00/30 = 192.168.0.0/30
R8-R10: 192.168.0.00 0001 00/30 = 192.168.0.4/30
R7-R9: 192.168.0.00 0010 00/30 = 192.168.0.8/30
R10-R9: 192.168.0.00 0011 00/30 = 192.168.0.12/30
R9-R11 100M: 192.168.0.00 0100 00/30 = 192.168.0.16/30
R9-R11 1000M: 192.168.0.00 0101 00/30 = 192.168.0.20/30
预留
192.168.0.00 0110 00/30 = 192.168.0.24/30
…………
R8环回网段:
192.168.0.01 000000/26 = 192.168.0.64/26
环回1:192.168.0.01 00 0000/28 = 192.168.0.64/28
环回2:192.168.0.01 01 0000/28 = 192.168.0.80/28
环回3:192.168.0.01 10 0000/28 = 192.168.0.96/28
预留:192.168.0.0.01 11 0000/28 = 192.168.0.112/28
R10用户网段:
192.168.0.10 000000/26 = 192.168.0.128/26
VLAN2: 192.168.0.10 0 00000/27 = 192.168.0.128/27
VLAN3: 192.168.0.10 1 00000/27 = 192.168.0.160/27
预留:
192.168.0.192/26
如图所示:
2、配置接口IP地址
R8
<Huawei>system-view
[Huawei]sysname R8
[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ip address 192.168.0.1 30
[R8-GigabitEthernet0/0/0]int g0/0/1
[R8-GigabitEthernet0/0/1]ip address 192.168.0.5 30
[R8-GigabitEthernet0/0/1]int lo0
[R8-LoopBack0]ip address 192.168.0.65 28
[R8-LoopBack0]int lo1
[R8-LoopBack1]ip address 192.168.0.81 28
[R8-LoopBack1]int lo2
[R8-LoopBack2]ip address 192.168.0.97 28
R7
<Huawei>system-view
[Huawei] sysname R7
[R7]int g0/0/1
[R7-GigabitEthernet0/0/1]ip address 192.168.0.2 30
[R7-GigabitEthernet0/0/1]int g0/0/0
[R7-GigabitEthernet0/0/0]ip address 192.168.0.9 30
R10
<Huawei>system-view
[Huawei]sysname R10
[R10]int g0/0/1
[R10-GigabitEthernet0/0/1]ip address 192.168.0.6 30
[R10-GigabitEthernet0/0/1]int g0/0/0
[R10-GigabitEthernet0/0/0]ip address 192.168.0.13 30
R9
<Huawei>system-view
[Huawei]sysname R9
[R9]int g0/0/1
[R9-GigabitEthernet0/0/1]ip address 192.168.0.10 30
[R9-GigabitEthernet0/0/1]int g0/0/0
[R9-GigabitEthernet0/0/0]ip address 192.168.0.14 30
[R9-GigabitEthernet0/0/0]int g0/0/2
[R9-GigabitEthernet0/0/2]ip address 192.168.0.21 30
[R9-GigabitEthernet0/0/2]int e4/0/0
[R9-Ethernet4/0/0]ip address 192.168.0.17 30
R11
<Huawei>system-view
[Huawei]sysname R11
[R11]int g0/0/0
[R11-GigabitEthernet0/0/0]ip address 192.168.0.22 30
[R11-GigabitEthernet0/0/0]int e4/0/0
[R11-Ethernet4/0/0]ip address 192.168.0.18 30
[R11-Ethernet4/0/0]int g0/0/1
[R11-GigabitEthernet0/0/1]ip address 100.1.1.1 24
ISP
<Huawei>system-view
[Huawei]sysname ISP
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip address 100.1.1.2 24
3、划分VLAN
SW1
<Huawei>system-view
[Huawei]sysname SW1
[SW1]vlan batch 2 to 3
[SW1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 2
[SW1-GigabitEthernet0/0/2]int g0/0/3
[SW1-GigabitEthernet0/0/3]port link-type access
[SW1-GigabitEthernet0/0/3]port default vlan 3
[SW1-GigabitEthernet0/0/3]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to 3
[SW1-GigabitEthernet0/0/1]int g0/0/4
[SW1-GigabitEthernet0/0/4]port link-type trunk
[SW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 to 3
SW2
<Huawei>system-view
[Huawei]sysname SW1
[SW1]vlan batch 2 to 3
[SW1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 2
[SW1-GigabitEthernet0/0/2]int g0/0/3
[SW1-GigabitEthernet0/0/3]port link-type access
[SW1-GigabitEthernet0/0/3]port default vlan 3
[SW1-GigabitEthernet0/0/3]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to 3
4、配置R10单臂路由
[R10]int g0/0/2.1
[R10-GigabitEthernet0/0/2.1]ip address 192.168.0.129 27
[R10-GigabitEthernet0/0/2.1]dot1q termination vid 2
[R10-GigabitEthernet0/0/2.1]arp broadcast enable
[R10-GigabitEthernet0/0/2.1]int g0/0/2.2
[R10-GigabitEthernet0/0/2.2]ip address 192.168.0.161 27
[R10-GigabitEthernet0/0/2.2]dot1q termination vid 3
[R10-GigabitEthernet0/0/2.2]arp broadcast enable
5、配置PC机
PC1
PC2
PC3
PC4
6、配置静态路由
R8
[R8]ip route-static 192.168.0.8 30 192.168.0.2
[R8]ip route-static 192.168.0.20 30 192.168.0.2
[R8]ip route-static 192.168.0.12 30 192.168.0.6
[R8]ip route-static 192.168.0.20 30 192.168.0.6
[R8]ip route-static 192.168.0.128 26 192.168.0.6
R7
[R7]ip route-static 192.168.0.64 26 192.168.0.1
[R7]ip route-static 192.168.0.4 30 192.168.0.1
[R7]ip route-static 192.168.0.128 26 192.168.0.1
[R7]ip route-static 192.168.0.20 30 192.168.0.10
[R7]ip route-static 192.168.0.12 30 192.168.0.10
[R7]ip route-static 192.168.0.128 26 192.168.0.10
R10
[R10]ip route-static 192.168.0.64 26 192.168.0.5
[R10]ip route-static 192.168.0.0 30 192.168.0.5
[R10]ip route-static 192.168.0.8 30 192.168.0.14
[R10]ip route-static 192.168.0.20 30 192.168.0.14
R9
[R9]ip route-static 192.168.0.0 30 192.168.0.9
[R9]ip route-static 192.168.0.64 26 192.168.0.9
[R9]ip route-static 192.168.0.4 30 192.168.0.13
[R9]ip route-static 192.168.0.128 26 192.168.0.13
[R9]ip route-static 192.168.0.64 26 192.168.0.13
R11
[R11]ip route-static 192.168.0.0 30 192.168.0.21
[R11]ip route-static 192.168.0.4 30 192.168.0.21
[R11]ip route-static 192.168.0.8 30 192.168.0.21
[R11]ip route-static 192.168.0.1230 192.168.0.21
[R11]ip route-static 192.168.0.64 26 192.168.0.21
[R11]ip route-static 192.168.0.128 26 192.168.0.21
7、防止环回
到R8的环回进行了汇总,需要在R8上面定义一个空接口防止环路。
[R8]ip route-static 192.168.0.64 26 NULL 0
8、缺省路由
为了实现全网可达,需要每个路由器上写一条缺省指向公网
R8
[R8]ip route-static 0.0.0.0 0 192.168.0.2
[R8]ip route-static 0.0.0.0 0 192.168.0.6
R7
[R7]ip route-static 0.0.0.0 0 192.168.0.10
R10
[R10]ip route-static 0.0.0.0 0 192.168.0.14
R9
[R9]ip route-static 0.0.0.0 0 192.168.0.22
R11
[R11]ip route-static 0.0.0.0 0 100.1.1.2
9、修改静态路由的优先级
修改R9-R11之间100M为备用链路
#R8
[R8]ip route-static 192.168.0.16 30 192.168.0.2 preference 65
[R8]ip route-static 192.168.0.16 30 192.168.0.6 preference 65
#R7
[R7]ip route-static 192.168.0.16 30 192.168.0.10 preference 65
#R10
[R10]ip route-static 192.168.0.16 30 192.168.0.14 preference 65
#R9
[R9]ip route-static 0.0.0.0 0 192.168.0.18 preference 65
#R11
[R11]ip route-static 192.168.0.0 30 192.168.0.17 preference 65
[R11]ip route-static 192.168.0.4 30 192.168.0.17 preference 65
[R11]ip route-static 192.168.0.8 30 192.168.0.17 preference 65
[R11]ip route-static 192.168.0.12 30 192.168.0.17 preference 65
[R11]ip route-static 192.168.0.64 26 192.168.0.17 preference 65
[R11]ip route-static 192.168.0.128 26 192.168.0.17 preference 65
当断开1000M链路,检查100M是否可用。
10、测试全网可达
PC1
PC4
R1