一、IP地址规划
根据要求进行IP地址规划,R1--R4要存在两个环回接口,用于模拟pc网段且地址要在192.168.1.0/24范围内。 R1—R4分别所连的两个环回接口可以进行手工汇总,将其划分为四个用户网段,再将R1---R4相连的的接口划分为骨干电路 ,每个骨干电路两端各占用两个ip。即为
二、拓扑设计
1、IP标识
路由配置:
R1:
[r1]interface LoopBack 1
[r1-LoopBack1]ip address 192.168.1.1 29
[r1-LoopBack1]display this
interface LoopBack1
ip address 192.168.1.1 255.255.255.248
[r1-LoopBack1]quit
[r1]interface LoopBack 2
[r1-LoopBack2]ip address 192.168.1.9 29
[r1-LoopBack2]display this
interface LoopBack2
ip address 192.168.1.9 255.255.255.248
[r1-LoopBack2]quit
[r1]interface GigabitEthernet0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.17 28
[r1-GigabitEthernet0/0/0]quit
[r1]interface GigabitEthernet0/0/1
[r1-GigabitEthernet0/0/1]ip address 192.168.1.33 28
[r1-GigabitEthernet0/0/1]quit
[r1]ip route-static 192.168.1.48 28 192.168.1.18
[r1]ip route-static 192.168.1.64 28 192.168.1.34[r1]ip route-static 192.168.1.80 28 192.168.1.18
[r1]ip route-static 192.168.1.96 28 192.168.1.34
[r1]ip route-static 192.168.1.112 28 192.168.1.18
[r1]ip route-static 192.168.1.112 28 192.168.1.34
[r1]ip route-static 192.168.1.128 28 192.168.1.18
[r1]ip route-static 192.168.1.128 28 192.168.1.34
[r1]ip route-static 192.168.1.144 28 192.168.1.18
[r1]ip route-static 192.168.1.144 28 192.168.1.34
[r1]ip route-static 0.0.0.0 0 192.168.1.18
[r1]ip route-static 0.0.0.0 0 192.168.1.34
R2:
[r2]interface LoopBack 1
[r2-LoopBack1]ip address 192.168.1.49 29
[r2-LoopBack1]display this
interface LoopBack1
ip address 192.168.1.49 255.255.255.248
[r2-LoopBack1]quit
[r2]interface LoopBack 2
[r2-LoopBack2]ip address 192.168.1.57 29
[r2-LoopBack2]display this
interface LoopBack2
ip address 192.168.1.57 255.255.255.248
[r2-LoopBack2]quit
[r2]interface GigabitEthernet0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.18 28
[r2-GigabitEthernet0/0/0]quit
[r2]interface GigabitEthernet0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.1.81 28
[r2-GigabitEthernet0/0/1]quit
[r2]ip route-static 192.168.1.0 28 192.168.1.17
[r2]ip route-static 192.168.1.112 28 192.168.1.82
[r2]ip route-static 0.0.0.0 0 192.168.1.82
R3:
[r3]interface LoopBack 1
[r3-LoopBack1]ip address 192.168.1.65 29
[r3-LoopBack1]display this
interface LoopBack1
ip address 192.168.1.65 255.255.255.248
[r3-LoopBack1]quit
[r3]interface LoopBack 2
[r3-LoopBack2]ip address 192.168.1.73 29
[r3-LoopBack2]display this
interface LoopBack2
ip address 192.168.1.73 255.255.255.248
[r3-LoopBack2]quit
[r3]interface GigabitEthernet0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.34 28
[r3-GigabitEthernet0/0/0]quit
[r3]interface GigabitEthernet0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.1.97 28
[r3-GigabitEthernet0/0/1]quit
[r3]ip route-static 192.168.1.48 28 192.168.1.33
[r3]ip route-static 192.168.1.48 28 192.168.1.98
[r3]ip route-static 192.168.1.0 28 192.168.1.33
[r3]ip route-static 192.168.1.112 28 192.168.1.98
[r3]ip route-static 192.168.1.112 28 192.168.1.98
[r3]ip route-static 192.168.1.16 28 192.168.1.33
[r3]ip route-static 192.168.1.128 28 192.168.1.98
[r3]ip route-static 192.168.1.128 28 192.168.1.9
[r3]ip route-static 0.0.0.0 0 192.168.1.98
R4:
[r4]interface LoopBack 1
[r4-LoopBack1]ip address 192.168.1.113 29
[r4-LoopBack1]display this
interface LoopBack1
ip address 192.168.1.113 255.255.255.248
[r4-LoopBack1]quit
[r4]interface LoopBack 2
[r4-LoopBack2]ip address 192.168.1.121 29
[r4-LoopBack2]display this
interface LoopBack2
ip address 192.168.1.121 255.255.255.248
[r4-LoopBack2]quit
[r4]interface GigabitEthernet0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.82 28
[r4-GigabitEthernet0/0/0]quit
[r4]interface GigabitEthernet0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.1.98 28
[r4-GigabitEthernet0/0/1]quit
[r4]interface GigabitEthernet0/0/2
[r4-GigabitEthernet0/0/2]ip address 192.168.1.129 28
[r4-GigabitEthernet0/0/2]quit
[r4]interface GigabitEthernet0/0/3
[r4-GigabitEthernet0/0/3]ip address 192.168.1.145 28
[r4-GigabitEthernet0/0/3]quit
[r4]ip route-static 192.168.1.64 28 192.168.1.97
[r4]ip route-static 192.168.1.32 28 192.168.1.97
[r4]ip route-static 192.168.1.48 28 192.168.1.81
[r4]ip route-static 192.168.1.16 28 192.168.1.81
[r4]ip route-static 192.168.1.0 28 192.168.1.81
[r4]ip route-static 192.168.1.0 28 192.168.1.97
[r4]ip route-static 0.0.0.0 0 192.168.1.146 preference 61
R5:
[r5]interface GigabitEthernet0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.1.146 28
[r5-GigabitEthernet0/0/0]quit
[r5]interface GigabitEthernet0/0/1
[r5-GigabitEthernet0/0/1]ip address 192.168.1.130 28
[r5-GigabitEthernet0/0/1]quit
[r5-LoopBack1]ip address 5.5.5.1 24
[r5-GigabitEthernet0/0/1]quit
[r5]ip route-static 192.168.1.0 24 192.168.1.129
[r5]ip route-static 192.168.1.0 24 192.168.1.145
[r5]ip route-static 192.168.1.0 24 192.168.1.145 preference 61
利用空接口来解决黑洞问题配置:
[r4]ip route-static 192.168.1.160 28 NULL 0
[r4]ip route-static 192.168.1.176 28 NULL 0
[r4]ip route-static 192.168.1.192 28 NULL 0
[r4]ip route-static 192.168.1.208 28 NULL 0
[r4]ip route-static 192.168.1.224 28 NULL 0
[r4]ip route-static 192.168.1.240 28 NULL 0
路由表命令配置
关闭前:
关闭后:
测试结果:
关闭1000m网线后,用R1 ping 5.5.5.0的环回接口