最终配置图
配置要求
步骤1配置网关
R1
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[r1-GigabitEthernet0/0/1]ip address 192.168.1.14 30
R2
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
r2-GigabitEthernet0/0/1]ip address 192.168.1.5 30
R3
[r3-GigabitEthernet0/0/0]ip address 192.168.1.9 30
[r3-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[r3-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[r3-GigabitEthernet0/0/1]ip address 192.168.1.6 30
R4
[r4-GigabitEthernet0/0/1]ip address 192.168.1.129 27
[r4-GigabitEthernet0/0/2]ip address 192.168.1.10 30
[r4-GigabitEthernet0/0/0]ip address 192.168.1.13 30
R5
[r5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[r5-GigabitEthernet0/0/1]ip address 192.168.1.22 30
步骤2配置环形接口
R1
[r1-LoopBack0]ip address 192.168.1.33 28
[r1-LoopBack1]ip address 192.168.1.49 28
R2
[r2-LoopBack1]ip address 192.168.1.81 28
[r2-LoopBack0]ip address 192.168.1.65 28
R3
[r3-LoopBack0]ip address 192.168.1.97 28
[r3-LoopBack0]ip address 192.168.1.96 28
R5
[r5-LoopBack0]ip address 5.5.5.5 24
[r5-LoopBack1]ip address 6.6.6.6 24
步骤3添加路由表
R1
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.13
[r1]ip route-static 192.168.1.4 30 192.168.1.2
[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.13
[r1]ip route-static 192.168.1.8 30 192.168.1.13
[r1]ip route-static 192.168.1.128 27 192.168.1.13
R2
[r2]ip route-static 192.168.1.96 27 192.168.1.6
[r2]ip route-static 192.168.1.16 30 192.168.1.6
[r2]ip route-static 192.168.1.8 30 192.168.1.6
[r2]ip route-static 192.168.1.128 27 192.168.1.6
[r2]ip route-static 192.168.1.128 27 192.168.1.1
[r2]ip route-static 192.168.1.12 30 192.168.1.1
[r2]ip route-static 192.168.1.32 27 192.168.1.1
R3
[r3]ip route-static 192.168.1.128 27 192.168.1.10
[r3]ip route-static 192.168.1.12 30 192.168.1.10
[r3]ip route-static 192.168.1.32 27 192.168.1.10
[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
R4
[r4]ip route-static 192.168.1.32 27 192.168.1.14
[r4]ip route-static 192.168.1.0 30 192.168.1.14
[r4]ip route-static 192.168.1.64 27 192.168.1.14
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]ip route-static 192.168.1.4 30 192.168.1.9
[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
R5
[r5]ip route-static 192.168.1.32 27 192.168.1.21 preference 70
[r5]ip route-static 192.168.1.12 30 192.168.1.21 preference 70
[r5]ip route-static 192.168.1.0 30 192.168.1.21 preference 70
[r5]ip route-static 192.168.1.64 27 192.168.1.21 preference 70
[r5]ip route-static 192.168.1.4 30 192.168.1.21 preference 70
[r5]ip route-static 192.168.1.8 30 192.168.1.21 preference 70
[r5]ip route-static 192.168.1.96 27 192.168.1.21 preference 70
[r5]ip route-static 192.168.1.128 27 192.168.1.21 preference 70
[r5]ip route-static 192.168.1.96 27 192.168.1.17
[r5]ip route-static 192.168.1.4 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.128 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.0 30 192.168.1.17
[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
步骤4配置缺省路由
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.13
R2
[r2]ip route-static 0.0.0.0 0 192.168.1.6
R3
[r3]ip route-static 0.0.0.0 0 192.168.1.18
R4
[r4]ip route-static 0.0.0.0 0 192.168.1.9
步骤5配置空接口
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]dhcp enable
[r4]ip pool 1111
[r4-ip-pool-1111]network 192.168.1.128 mask 27
[r4-ip-pool-1111]gateway-list 192.168.1.129
[r4-ip-pool-1111]dns-list 8.8.8.8
正常不正常怎么走
[r3]ip route-static 0.0.0.0 0 192.168.1.22 preference 61