先进行IP地址的规划 1
192.168.1.0/24
192.168.1.0/27 骨干
192.168.1.0/30 192.168.1.4/30 192.168.1.8/30 192.168.1.16 /30 192.168.1.20/30 192.168.1.24/30 192.168.1.32/30
192.168.1.32/27 R1 192.168.1.32/28 192.168.1.48/28
192.168.1.64/27 R2 192.168.1.64/28 192.168.1.80/28
192.168.1.96/27 R3
192.168.1.128/27 R4 192.168.1.128/28 192.168.1.144/28
192.168.1.160/27 R5
配置:
R1的环回地址:
[r1-LoopBack0]ip add 192.168.1.33 28
[r1-LoopBack1]ip add 192.168.1.49 28
R2的环回地址
[r2-GigabitEthernet0/0/1]int lo 0
[r2-LoopBack0]ip add 192.168.1.33 28
[r2-LoopBack0]int lo1
[r2-LoopBack1]ip add 192.168.1.81 28
R4的环回地址:[r4]int lo0
[r4-LoopBack0]ip add 192.168.1.129 28
[r4-LoopBack0]int lo1
[r4-LoopBack1]ip add 192.168.1.145 28
R5的环回
[r5-LoopBack0]ip add 192.168.1.161 27
[r5-LoopBack0]
R6的环回
骨干:
R1
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[r1-GigabitEthernet0/0/1]ip add 192.168.1.18 30
R2
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r2-GigabitEthernet0/0/1]ip add 192.168.1.5 30
R3:
[r3-GigabitEthernet0/0/0]ip add 192.168.1.9 30
[r3-GigabitEthernet0/0/1]ip add 192.168.1.17 30
R4
[r4-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[r4-GigabitEthernet0/0/1]ip add 192.168.1.10 30
[r4-GigabitEthernet0/0/2]ip add 192.168.1.21 30
[r4-Ethernet4/0/0]ip add 192.168.1.25 30
R5:
[r5-GigabitEthernet0/0/0]ip add 192.168.1.22 30
[r5-Ethernet4/0/0]ip add 192.168.1.26 30
[r5-GigabitEthernet0/0/1]ip add 56.1.1.1 24
R6
[r6-GigabitEthernet0/0/0]ip add 56.1.1.2 24
dhcp服务器配置:
[r3-GigabitEthernet0/0/2]ip add 192.168.1.97 27
[r3]dhcp enable
[r3]ip pool qq
[r3-ip-pool-qq]network 192.168.1.96 mask 27
[r3-ip-pool-qq]gateway-list 192.168.1.97
[r3-ip-pool-qq]dns-list 114.114.114.114 8.8.8.8
[r3-GigabitEthernet0/0/2]dhcp select global
配置缺省路由
[r1]ip route-static 0.0.0.0 0 192.168.1.2
[r2]ip route-static 0.0.0.0 0 192.168.1.21
[r3]ip route-static 0.0.0.0 0 192.168.1.25
[r4]ip route-static 0.0.0.0 0 192.168.1.22
[r5]ip route-static 0.0.0.0 0 56.1.1.2
选路最佳避免环路
[r1]ip route-static 192.168.1.64 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.96 27 192.168.1.17
[r1]ip route-static 192.168.1.8 30 192.168.1.17
R2:
[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.1
[r2]ip route-static 192.168.1.128 27 192.168.1.6
[r2]ip route-static 192.168.1.8 30 192.168.1.6
[r2]ip route-static 192.168.1.96 27 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.6
R3:
[r3]ip route-static 192.168.1.32 27 192.168.1.18
[r3]ip route-static 192.168.1.0 30 192.168.1.18
[r3]ip route-static 192.168.1.64 27 192.168.1.18
[r3]ip route-static 192.168.1.4 30 192.168.1.10
[r3]ip route-static 192.168.1.128 27 192.168.1.10
R4:
[r4]ip route-static 192.168.1.96 27 192.168.1.9
[r4]ip route-static 192.168.1.16 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.0 30 192.168.1.5
[r4]ip route-static 192.168.1.64 27 192.168.1.5
R5:
[r5]ip route-static 192.168.1.4 30 192.168.1.21
[r5]ip route-static 192.168.1.64 27 192.168.1.21
[r5]ip route-static 192.168.1.0 30 192.168.1.21
[r5]ip route-static 192.168.1.32 27 192.168.1.21
[r5]ip route-static 192.168.1.16 30 192.168.1.21
[r5]ip route-static 192.168.1.96 27 192.168.1.21
[r5]ip route-static 192.168.1.8 30 192.168.1.21
R6
[r6]ip route-static 192.168.1.20 30 56.1.1.1
[r6]ip route-static 192.168.1.4 30 56.1.1.1
[r6]ip route-static 192.168.1.0 30 56.1.1.1
[r6]ip route-static 192.168.1.8 30 56.1.1.1
[r6]ip route-static 192.168.1.16 30 56.1.1.1
正常时候1000 不正常100
[r4]ip route-static 192.168.1.24 30 192.168.1.26 preference 61
避免环路 空接口
[r1]ip route-static 192.168.1.32 27 NULL 0
[r2]ip route-static 192.168.1.64 27 NULL 0
[r3]ip route-static 192.168.1.96 27 NULL 0
nat