1.除R5的环回地址固定以外,整个其他所有网段基于192.168.1.0/24进行合理的IP地址划分
(1)数广播域-----------骨干链路6个,环回网段8个-----------14个广播域
从主机位借位-------1位划分2个,2位4个,3位8个,4位16个------呈2的n次方递进
(2) 每条骨干链路分配2个IP----------6条 /30的网段-------至少要1条/27的掩码-----可划分出8条
环回网段-------4条IP
共4+1=5个网段
192.168.1.0/24
192.168.1.000 00000/27------192.168.1.000 00000/27 -------骨干链路------划分为/30的网段--8条
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 011 00/30---192.168.1.12/30
192.168.1.000 100 00/30---192.168.1.16/30
192.168.1.000 101 00/30---192.168.1.20/30
192.168.1.000 110 00/30
192.168.1.000 111 00/30
192.168.1.001 00000/27 --------R1环回 ---192.168.1.32/27
192.168.1.001 0 0000/28---192.168.1.32/28
192.168.1.001 1 0000/28---192.168.1.48/28
192.168.1.010 00000/27---------R2环回---192.168.1.64/27
192.168.1.010 0 0000/28---192.168.1.64/28
192.168.1.010 1 0000/28---192.168.1.80.28
192.168.1.011 00000/27---------R3环回---192.168.1.96/27
192.168.1.011 0 0000/28---192.168.1.96/28
192.168.1.011 1 0000/28---192.168.1.112/28
192.168.1.100 00000/27---------R4环回---192.168.1.128/27
192.168.1.100 0 0000/28---192.168.1.128/28
192.168.1.100 1 0000/28---192.168.1.144/28
192.168.1.101 00000/27
192.168.1.110 00000/27
192.168.1.111 00000/27
【节约IP地址】
【R1】
[Huawei]sys r1
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
[r1]int l0
[r1-LoopBack0]ip add 192.168.1.33 28
[r1]int l1
[r1-LoopBack1]ip add 192.168.1.49 28
【R2】
[Huawei]sys r2
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r2]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
[r2]int l0
[r2-LoopBack0]ip add 192.168.1.65 28
[r2]int l1
[r2-LoopBack1]ip add 192.168.1.81 28
[r2-LoopBack1]dis ip int b
【R3】
[Huawei]sys r3
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
[r3]int l0
[r3-LoopBack0]ip add 192.168.1.97 28
[r3]int l1
[r3-LoopBack1]ip add 192.168.1.113 28
[r3-LoopBack1]dis ip int b
【R4】
[Huawei]sys r4
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.10 30
[r4]int g 0/0/2
[r4-GigabitEthernet0/0/2]ip add 192.168.1.14 30
[r4]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.17 30
[r4]int g 4/0/0
[r4-GigabitEthernet4/0/0]ip add 192.168.1.21 30
[r4]int l0
[r4-LoopBack0]ip add 192.168.1.129 28
[r4]int l1
[r4-LoopBack1]ip add 192.168.1.145 28
[r4-LoopBack1]dis ip int b
【R5】
[Huawei]sys r5
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
[r5]int g 0/0/1
[r5-GigabitEthernet0/0/1]ip add 192.168.1.22 30
[r5]int l0
[r5-LoopBack0]ip add 5.5.5.1 24
[r5]dis ip int b
【R1】
先写环回,再写骨干链路
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.128 27 192.168.1.2
[r1]ip route-static 192.168.1.128 27 192.168.1.6
[r1]ip route-static 192.168.1.12 30 192.168.1.6
[r1]ip route-static 192.168.1.96 27 192.168.1.6
[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.6
[r1]dis ip routing-table
【R2】
[r2]ip route-static 192.168.1.128 27 192.168.1.10
[r2]ip route-static 192.168.1.12 30 192.168.1.10
[r2]ip route-static 192.168.1.96 27 192.168.1.10
[r2]ip route-static 192.168.1.96 27 192.168.1.1
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]ip route-static 192.168.1.16 30 192.168.1.10
[r2]dis ip routing-table
【R3】
[r3]ip route-static 192.168.1.32 27 192.168.1.5
[r3]ip route-static 192.168.1.0 30 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.14
[r3]ip route-static 192.168.1.8 30 192.168.1.14
[r3]ip route-static 192.168.1.128 27 192.168.1.14
[r3]ip route-static 192.168.1.16 30 192.168.1.14
[r3]dis ip routing-table
【R4】
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[r4]ip route-static 192.168.1.32 27 192.168.1.9
[r4]ip route-static 192.168.1.32 27 192.168.1.13
[r4]ip route-static 192.168.1.4 30 192.168.1.13
[r4]ip route-static 192.168.1.96 27 192.168.1.13
[r4]dis ip routing-table
【R5】
[r5]ip route-static 192.168.1.32 27 192.168.1.17
[r5]ip route-static 192.168.1.64 27 192.168.1.17
[r5]ip route-static 192.168.1.128 27 192.168.1.17
[r5]ip route-static 192.168.1.96 27 192.168.1.17
[r5]ip route-static 192.168.1.0 30 192.168.1.17
[r5]ip route-static 192.168.1.8 30 192.168.1.17
[r5]ip route-static 192.168.1.12 30 192.168.1.17
[r5]ip route-static 192.168.1.4 30 192.168.1.17
[r5]dis ip routing-table
【R1】
[r1]ip route-static 0.0.0.0 0 192.168.1.2
[r1]ip route-static 0.0.0.0 0 192.168.1.6
【R2】
[r2]ip route-static 0.0.0.0 0 192.168.1.10
【R3】
[r3]ip route-static 0.0.0.0 0 192.168.1.14
【R4】
[r4]ip route-static 0.0.0.0 0 192.168.1.18
【R1】
[r1]ip route-static 192.168.1.32 27 NULL 0
【R2】
[r2]ip route-static 192.168.1.64 27 NULL 0
【R3】
[r3]ip route-static 192.168.1.96 27 NULL 0
【R4】
[r4]ip route-static 192.168.1.128 27 NULL 0
【R1】
[r1]ip route-static 192.168.1.20 30 192.168.1.2
[r1]ip route-static 192.168.1.20 30 192.168.1.6
【R2】
[r2]ip route-static 192.168.1.20 30 192.168.1.10
【R3】
[r3]ip route-static 192.168.1.20 30 192.168.1.14
【R4】
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61 --------将优先级该低---数值该大
【R5】
[r5]dispiay this
ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 preference 61
ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 61
ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 preference 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 preference 61
ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 preference 61
ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 preference 61
ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 preference 61
ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 preference 61
[r5]dispiay this
[r5]dis ip routing-table protocol static