Top

  1. OSPF 路由表管理
  2. OSPF 路由过滤之 route-policy
  3. OSPF 路由过滤之 LSA 过滤
  4. IPv6 协议解析
  5. IPv6 静态路由配置
  6. IPv6 动态路由之 OSPFv3 配置

1 OSPF 路由表管理

1.1 需求

1)为了提高企业内网的稳定性,在骨干区域增加了冗余设备和线路

2)为了更好的利用这些线路,需要优化这些数据的转发路径

3)在区域 0 中,存在多个数据转发路径;R8 作为 R3/4 的备份设备

4)最优的数据转发路径为:R2—R3—R4—R5

5)确保 R1 和 R6 之间使用最优路径转发数据

1.2 方案

搭建实验环境,如图 - 1 所示。

CASE - 图1

图 - 1

1.3 步骤

实现此案例需要按照如下步骤进行。

1)配置 OSPF - R1

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R1
  4. 4. \[R1\]interface GigabitEthernet 0/0/0
  5. 5. \[R1-GigabitEthernet0/0/0\]ip add 192.168.12.1 24
  6. 6. \[R1-GigabitEthernet0/0/0\]quit
  7. 8. \[R1\]ospf 1 router-id 1.1.1.1
  8. 9. \[R1-ospf-1\]area 12
  9. 10. \[R1-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
  10. 11. \[R1-ospf-1-area-0.0.0.12\]quit

2)配置 OSPF – R2

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R2
  4. 4. \[R2\]interface GigabitEthernet 0/0/1
  5. 5. \[R2-GigabitEthernet0/0/1\]ip add 192.168.12.2 24
  6. 6. \[R2-GigabitEthernet0/0/1\]quit
  7. 8. \[R2\]interface GigabitEthernet 0/0/0
  8. 9. \[R2-GigabitEthernet0/0/0\]ip add 192.168.23.2 24
  9. 10. \[R2-GigabitEthernet0/0/0\]quit
  10. 12. \[R2\]interface GigabitEthernet 0/0/2
  11. 13. \[R2-GigabitEthernet0/0/2\]ip add 192.168.28.2 24
  12. 14. \[R2-GigabitEthernet0/0/2\]quit
  13. 16. \[R2\]ospf 1 router-id 2.2.2.2
  14. 17. \[R2-ospf-1\]area 12
  15. 18. \[R2-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
  16. 19. \[R2-ospf-1-area-0.0.0.12\]quit
  17. 20. \[R2-ospf-1\]area 0
  18. 21. \[R2-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
  19. 22. \[R2-ospf-1-area-0.0.0.0\]network 192.168.28.0 0.0.0.255
  20. 23. \[R2-ospf-1-area-0.0.0.0\]quit

3)配置 OSPF – R3

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R3
  4. 4. \[R3\]interface GigabitEthernet 0/0/1
  5. 5. \[R3-GigabitEthernet0/0/1\]ip add 192.168.23.3 24
  6. 6. \[R3-GigabitEthernet0/0/1\]quit
  7. 8. \[R3\]interface GigabitEthernet 0/0/0
  8. 9. \[R3-GigabitEthernet0/0/0\]ip add 192.168.34.3 24
  9. 10. \[R3-GigabitEthernet0/0/0\]quit
  10. 12. \[R3\]interface GigabitEthernet 0/0/2
  11. 13. \[R3-GigabitEthernet0/0/2\]ip add 192.168.38.3 24
  12. 14. \[R3-GigabitEthernet0/0/2\]quit
  13. 16. \[R3\]ospf 1 router-id 3.3.3.3
  14. 17. \[R3-ospf-1\]area 0
  15. 18. \[R3-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
  16. 19. \[R3-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
  17. 20. \[R3-ospf-1-area-0.0.0.0\]network 192.168.38.0 0.0.0.255
  18. 21. \[R3-ospf-1-area-0.0.0.0\]quit

4)配置 OSPF – R4

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R4
  4. 4. \[R4\]interface GigabitEthernet 0/0/1
  5. 5. \[R4-GigabitEthernet0/0/1\]ip add 192.168.34.4 24
  6. 6. \[R4-GigabitEthernet0/0/1\]quit
  7. 8. \[R4\]interface GigabitEthernet 0/0/0
  8. 9. \[R4-GigabitEthernet0/0/0\]ip add 192.168.45.4 24
  9. 10. \[R4-GigabitEthernet0/0/0\]quit
  10. 12. \[R4\]interface GigabitEthernet 0/0/2
  11. 13. \[R4-GigabitEthernet0/0/2\]ip add 192.168.48.4 24
  12. 14. \[R4-GigabitEthernet0/0/2\]quit
  13. 16. \[R4\]ospf 1 router-id 4.4.4.4
  14. 17. \[R4-ospf-1\]area 0
  15. 18. \[R4-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
  16. 19. \[R4-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
  17. 20. \[R4-ospf-1-area-0.0.0.0\]network 192.168.48.0 0.0.0.255
  18. 22. \[R4-ospf-1-area-0.0.0.0\]quit

5)配置 OSPF – R5

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R5
  4. 4. \[R5\]interface GigabitEthernet 0/0/1
  5. 5. \[R5-GigabitEthernet0/0/1\]ip add 192.168.45.5 24
  6. 6. \[R5-GigabitEthernet0/0/1\]quit
  7. 8. \[R5\]interface GigabitEthernet 0/0/0
  8. 9. \[R5-GigabitEthernet0/0/0\]ip add 192.168.56.5 24
  9. 10. \[R5-GigabitEthernet0/0/0\]quit
  10. 12. \[R5\]interface GigabitEthernet 0/0/2
  11. 13. \[R5-GigabitEthernet0/0/2\]ip add 192.168.58.5 24
  12. 14. \[R5-GigabitEthernet0/0/2\]quit
  13. 16. \[R5\]ospf 1 router-id 5.5.5.5
  14. 17. \[R5-ospf-1\]area 0
  15. 18. \[R5-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
  16. 19. \[R5-ospf-1-area-0.0.0.0\]network 192.168.58.0 0.0.0.255
  17. 20. \[R5-ospf-1-area-0.0.0.0\]quit
  18. 21. \[R5-ospf-1\]area 56
  19. 22. \[R5-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.25
  20. 23. \[R5-ospf-1-area-0.0.0.56\]quit

6)配置 OSPF – R6

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R6
  4. 4. \[R6\]interface GigabitEthernet 0/0/1
  5. 5. \[R6-GigabitEthernet0/0/1\]ip add 192.168.56.6 24
  6. 6. \[R6-GigabitEthernet0/0/1\]quit
  7. 8. \[R6\]ospf 1 router-id 6.6.6.6
  8. 9. \[R6-ospf-1\]area 56
  9. 10. \[R6-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
  10. 11. \[R6-ospf-1-area-0.0.0.56\]quit

7)配置 OSPF – R8

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R8
  4. 4. \[R8\]interface GigabitEthernet 0/0/2
  5. 5. \[R8-GigabitEthernet0/0/2\]ip add 192.168.28.8 24
  6. 6. \[R8-GigabitEthernet0/0/2\]quit
  7. 7. \[R8\]interface GigabitEthernet 0/0/1
  8. 8. \[R8-GigabitEthernet0/0/1\]ip add 192.168.38.8 24
  9. 9. \[R8-GigabitEthernet0/0/1\]quit
  10. 10. \[R8\]interface GigabitEthernet 0/0/0
  11. 11. \[R8-GigabitEthernet0/0/0\]ip add 192.168.48.8 24
  12. 12. \[R8-GigabitEthernet0/0/0\]quit
  13. 13. \[R8\]interface GigabitEthernet 4/0/0
  14. 14. \[R8-GigabitEthernet4/0/0\]ip add 192.168.58.8 24
  15. 15. \[R8-GigabitEthernet4/0/0\]quit
  16. 17. \[R6\]ospf 1 router-id 8.8.8.8
  17. 18. \[R6-ospf-1\]area 0
  18. 19. \[R6-ospf-1-area-0.0.0.0\]network 192.168.28.0 0.0.0.255
  19. 20. \[R6-ospf-1-area-0.0.0.0\]network 192.168.38.0 0.0.0.255
  20. 21. \[R6-ospf-1-area-0.0.0.0\]network 192.168.48.0 0.0.0.255
  21. 22. \[R6-ospf-1-area-0.0.0.0\]network 192.168.58.0 0.0.0.255
  22. 23. \[R6-ospf-1-area-0.0.0.0\]quit

8)在 R2 上修改连接 R8 的端口的开销

  1. 1. \[R2\]interface GigabitEthernet 0/0/2
  2. 2. \[R2-GigabitEthernet0/0/2\]ospf cost 3
  3. 3. \[R2-GigabitEthernet0/0/2\]quit

2 OSPF 路由过滤之 route-policy

2.1 需求

1)企业内网部分网络运行 OSPF 协议,但是服务器所在部门使用静态

2)配置路由控制策略,确保 PC1 仅仅能访问 Server2

2.2 方案

搭建实验环境,如图 - 2 所示。

CASE - 图2

图 - 2

2.3 步骤

实现此案例需要按照如下步骤进行。

1)配置终端设备 - Server1/Server2/PC1

Server1:

192.168.1.1

255.255.255.0

192.168.1.254

Server2:

192.168.2.1

255.255.255.0

192.168.2.254

PC1:

192.168.3.1

255.255.255.0

192.168.3.254

2)配置 - R1

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R1
  4. 4. \[R1\]interface GigabitEthernet 0/0/0
  5. 5. \[R1-GigabitEthernet0/0/0\]ip add 192.168.12.1 24
  6. 6. \[R1-GigabitEthernet0/0/0\]quit
  7. 7. \[R1\]interface GigabitEthernet 0/0/1
  8. 8. \[R1-GigabitEthernet0/0/1\]ip add 192.168.1.254 24
  9. 9. \[R1-GigabitEthernet0/0/1\]quit
  10. 10. \[R1\]interface GigabitEthernet 0/0/2
  11. 11. \[R1-GigabitEthernet0/0/2\]ip add 192.168.2.254 24
  12. 12. \[R1-GigabitEthernet0/0/2\]quit
  13. 14. \[R1\]ip route-static 192.168.0.0 16 192.168.12.2

3)配置 OSPF – R2

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R2
  4. 4. \[R2\]interface GigabitEthernet 0/0/1
  5. 5. \[R2-GigabitEthernet0/0/1\]ip add 192.168.12.2 24
  6. 6. \[R2-GigabitEthernet0/0/1\]quit
  7. 8. \[R2\]interface GigabitEthernet 0/0/0
  8. 9. \[R2-GigabitEthernet0/0/0\]ip add 192.168.23.2 24
  9. 10. \[R2-GigabitEthernet0/0/0\]quit
  10. 12. \[R2\]ip route-static 192.168.1.0 24 192.168.12.1
  11. 13. \[R2\]ip route-static 192.168.2.0 24 192.168.12.1
  12. 16. \[R2\]acl 2000
  13. 17. \[R2-acl-basic-2000\]rule 10 permit source 192.168.2.0 0.0.0.255
  14. 18. \[R2-acl-basic-2000\]quit
  15. 20. \[R2\]route-policy A permit node 10
  16. 21. \[R2-route-policy\]if-match acl 2000
  17. 22. \[R2-route-policy\]quit
  18. 24. \[R2\]ospf 1 router-id 2.2.2.2
  19. 25. \[R2-ospf-1\]area 123
  20. 26. \[R2-ospf-1-area-0.0.0.123\]network 192.168.23.0 0.0.0.255
  21. 27. \[R2-ospf-1-area-0.0.0.123\]quit
  22. 28. \[R2-ospf-1\]import-route static route-policy A
  23. 29. \[R2-ospf-1\]quit

4)配置 OSPF – R3

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R3
  4. 4. \[R3\]interface GigabitEthernet 0/0/1
  5. 5. \[R3-GigabitEthernet0/0/1\]ip add 192.168.23.3 24
  6. 6. \[R3-GigabitEthernet0/0/1\]quit
  7. 8. \[R3\]interface GigabitEthernet 0/0/0
  8. 9. \[R3-GigabitEthernet0/0/0\]ip add 192.168.34.3 24
  9. 10. \[R3-GigabitEthernet0/0/0\]quit
  10. 12. \[R3\]ospf 1 router-id 3.3.3.3
  11. 13. \[R3-ospf-1\]area 123
  12. 14. \[R3-ospf-1-area-0.0.0.123\]network 192.168.23.0 0.0.0.255
  13. 15. \[R3-ospf-1-area-0.0.0.123\]network 192.168.34.0 0.0.0.255
  14. 16. \[R3-ospf-1-area-0.0.0.123\]quit

5)配置 OSPF – R4

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R4
  4. 4. \[R4\]interface GigabitEthernet 0/0/1
  5. 5. \[R4-GigabitEthernet0/0/1\]ip add 192.168.34.4 24
  6. 6. \[R4-GigabitEthernet0/0/1\]quit
  7. 8. \[R4\]interface GigabitEthernet 0/0/0
  8. 9. \[R4-GigabitEthernet0/0/0\]ip add 192.168.45.4 24
  9. 10. \[R4-GigabitEthernet0/0/0\]quit
  10. 12. \[R4\]ospf 1 router-id 4.4.4.4
  11. 13. \[R4-ospf-1\]area 0
  12. 14. \[R4-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
  13. 15. \[R4-ospf-1-area-0.0.0.0\]quit
  14. 16. \[R4-ospf-1\]area 123
  15. 17. \[R4-ospf-1-area-0.0.0.123\]network 192.168.34.0 0.0.0.255
  16. 18. \[R4-ospf-1-area-0.0.0.123\]quit

6)配置 OSPF – R5

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R5
  4. 4. \[R5\]interface GigabitEthernet 0/0/1
  5. 5. \[R5-GigabitEthernet0/0/1\]ip add 192.168.45.5 24
  6. 6. \[R5-GigabitEthernet0/0/1\]quit
  7. 8. \[R5\]interface GigabitEthernet 0/0/2
  8. 9. \[R5-GigabitEthernet0/0/2\]ip add 192.168.3.254 24
  9. 10. \[R5-GigabitEthernet0/0/2\]quit
  10. 12. \[R5\]ospf 1 router-id 5.5.5.5
  11. 13. \[R5-ospf-1\]area 0
  12. 14. \[R5-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
  13. 15. \[R5-ospf-1-area-0.0.0.0\]network 192.168.3.0 0.0.0.255
  14. 16. \[R5-ospf-1-area-0.0.0.0\]quit

7)配置 OSPF – R6

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R6
  4. 4. \[R6\]interface GigabitEthernet 0/0/1
  5. 5. \[R6-GigabitEthernet0/0/1\]ip add 192.168.56.6 24
  6. 6. \[R6-GigabitEthernet0/0/1\]quit
  7. 8. \[R6\]ospf 1 router-id 6.6.6.6
  8. 9. \[R6-ospf-1\]area 56
  9. 10. \[R6-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
  10. 11. \[R6-ospf-1-area-0.0.0.56\]quit

8)配置 R2 和 R3 之间的链路认证 - 明文认证,密码为 HCIE

  1. 1. \[R2\]interface GigabitEthernet 0/0/0
  2. 2. \[R2-GigabitEthernet0/0/0\]ospf authentication-mode simple cipher HCIE
  3. 3. \[R2-GigabitEthernet0/0/0\]quit
  4. 5. \[R3\]interface GigabitEthernet 0/0/1
  5. 6. \[R3-GigabitEthernet0/0/1\]ospf authentication-mode simple cipher HCIE
  6. 7. \[R3-GigabitEthernet0/0/1\]quit

9)配置 R3 和 R4 之间的链路认证 - 明文认证,密码为 HCIP

  1. 1. \[R3\]interface GigabitEthernet 0/0/0
  2. 2. \[R3-GigabitEthernet0/0/0\]ospf authentication-mode simple cipher HCIP
  3. 3. \[R3-GigabitEthernet0/0/0\]quit
  4. 5. \[R4\]interface GigabitEthernet 0/0/1
  5. 6. \[R4-GigabitEthernet0/0/1\]ospf authentication-mode simple cipher HCIP
  6. 7. \[R4-GigabitEthernet0/0/1\]quit

10)配置 R4 和 R5 之间的链路认证 - 密文认证,密码为 HCIA

  1. 1. \[R4\]interface GigabitEthernet 0/0/0
  2. 2. \[R4-GigabitEthernet0/0/0\]ospf authentication-mode md5 10 cipher HCIA
  3. 3. \[R4-GigabitEthernet0/0/0\]quit
  4. 5. \[R5\]interface GigabitEthernet 0/0/1
  5. 6. \[R5-GigabitEthernet0/0/1\]ospf authentication-mode md5 10 cipher HCIA
  6. 7. \[R5-GigabitEthernet0/0/1\]quit

3 OSPF 路由过滤之 LSA 过滤

3.1 需求

1)企业内网运行多区域的 OSPF 网络,区域之间通过骨干区域互通

2)为了确保业务安全,现控制区域 56 的设备与用户,不允许访问区域 12 中的设备和资源,同时减少区域 56 中的设备资源的占用率

3.2 方案

搭建实验环境,如图 - 3 所示。

CASE - 图3

图 - 3

3.3 步骤

实现此案例需要按照如下步骤进行。

1)配置 OSPF - R1

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R1
  4. 4. \[R1\]interface GigabitEthernet 0/0/0
  5. 5. \[R1-GigabitEthernet0/0/0\]ip add 192.168.12.1 24
  6. 6. \[R1-GigabitEthernet0/0/0\]quit
  7. 8. \[R1\]ospf 1 router-id 1.1.1.1
  8. 9. \[R1-ospf-1\]area 12
  9. 10. \[R1-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
  10. 11. \[R1-ospf-1-area-0.0.0.12\]quit

2)配置 OSPF – R2

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R2
  4. 4. \[R2\]interface GigabitEthernet 0/0/1
  5. 5. \[R2-GigabitEthernet0/0/1\]ip add 192.168.12.2 24
  6. 6. \[R2-GigabitEthernet0/0/1\]quit
  7. 8. \[R2\]interface GigabitEthernet 0/0/0
  8. 9. \[R2-GigabitEthernet0/0/0\]ip add 192.168.23.2 24
  9. 10. \[R2-GigabitEthernet0/0/0\]quit
  10. 12. \[R2\]ospf 1 router-id 2.2.2.2
  11. 13. \[R2-ospf-1\]area 12
  12. 14. \[R2-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
  13. 15. \[R2-ospf-1-area-0.0.0.12\]quit
  14. 16. \[R2-ospf-1\]area 0
  15. 17. \[R2-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
  16. 18. \[R2-ospf-1-area-0.0.0.0\]quit

3)配置 OSPF – R3

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R3
  4. 4. \[R3\]interface GigabitEthernet 0/0/1
  5. 5. \[R3-GigabitEthernet0/0/1\]ip add 192.168.23.3 24
  6. 6. \[R3-GigabitEthernet0/0/1\]quit
  7. 8. \[R3\]interface GigabitEthernet 0/0/0
  8. 9. \[R3-GigabitEthernet0/0/0\]ip add 192.168.34.3 24
  9. 10. \[R3-GigabitEthernet0/0/0\]quit
  10. 12. \[R3\]ospf 1 router-id 3.3.3.3
  11. 13. \[R3-ospf-1\]area 0
  12. 14. \[R3-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
  13. 15. \[R3-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
  14. 16. \[R3-ospf-1-area-0.0.0.0\]quit

4)配置 OSPF – R4

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R4
  4. 4. \[R4\]interface GigabitEthernet 0/0/1
  5. 5. \[R4-GigabitEthernet0/0/1\]ip add 192.168.34.4 24
  6. 6. \[R4-GigabitEthernet0/0/1\]quit
  7. 8. \[R4\]interface GigabitEthernet 0/0/0
  8. 9. \[R4-GigabitEthernet0/0/0\]ip add 192.168.45.4 24
  9. 10. \[R4-GigabitEthernet0/0/0\]quit
  10. 12. \[R4\]ospf 1 router-id 4.4.4.4
  11. 13. \[R4-ospf-1\]area 0
  12. 14. \[R4-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
  13. 15. \[R4-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
  14. 16. \[R4-ospf-1-area-0.0.0.0\]quit

5)配置 OSPF – R5

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R5
  4. 4. \[R5\]interface GigabitEthernet 0/0/1
  5. 5. \[R5-GigabitEthernet0/0/1\]ip add 192.168.45.5 24
  6. 6. \[R5-GigabitEthernet0/0/1\]quit
  7. 8. \[R5\]interface GigabitEthernet 0/0/0
  8. 9. \[R5-GigabitEthernet0/0/0\]ip add 192.168.56.5 24
  9. 10. \[R5-GigabitEthernet0/0/0\]quit
  10. 12. \[R5\]ospf 1 router-id 5.5.5.5
  11. 13. \[R5-ospf-1\]area 56
  12. 14. \[R5-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
  13. 15. \[R5-ospf-1-area-0.0.0.56\]quit
  14. 16. \[R5-ospf-1\]area 0
  15. 17. \[R5-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
  16. 18. \[R5-ospf-1-area-0.0.0.0\]quit

6)配置 OSPF – R6

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R6
  4. 4. \[R6\]interface GigabitEthernet 0/0/1
  5. 5. \[R6-GigabitEthernet0/0/1\]ip add 192.168.56.6 24
  6. 6. \[R6-GigabitEthernet0/0/1\]quit
  7. 8. \[R6\]ospf 1 router-id 6.6.6.6
  8. 9. \[R6-ospf-1\]area 56
  9. 10. \[R6-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
  10. 11. \[R6-ospf-1-area-0.0.0.56\]quit

7)在 R5 上对区域 12 的 3 类 LSA 进行过滤

  1. 1. \[R5\]acl 2012
  2. 2. \[R5-acl-basic-2012\]rule 10 deny source 192.168.2.0 0.0.0.255
  3. 3. \[R5-acl-basic-2012\]rule 20 permit source any
  4. 4. \[R5-acl-basic-2012\]quit
  5. 6. \[R5\]ospf 1
  6. 7. \[R5-ospf-1\]area 56
  7. 8. \[R5-ospf-1-area-0.0.0.56\]filter 2012 import

4 IPv6 协议解析

4.1 需求

1)因业务需要,企业内网需要将 IPv4 网络,升级改造为 IPv6 网络

2)在进行网络改造时,要确保原来的业务不能中断,实现平滑迁移

3)为了在升级改造 IPv6 网络的时候,IPv4 业务不会中断,可以使用 “双栈” 技术

4.2 方案

搭建实验环境,如图 - 4 所示。

CASE - 图4

图 - 4

4.3 步骤

实现此案例需要按照如下步骤进行。

1)配置 OSPF - R1

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R1
  4. 4. \[R1\]interface GigabitEthernet 0/0/0
  5. 5. \[R1-GigabitEthernet0/0/0\]ip add 192.168.12.1 24
  6. 6. \[R1-GigabitEthernet0/0/0\]quit
  7. 8. \[R1\]ospf 1 router-id 1.1.1.1
  8. 9. \[R1-ospf-1\]area 12
  9. 10. \[R1-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
  10. 11. \[R1-ospf-1-area-0.0.0.12\]quit

2)配置 OSPF – R2

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R2
  4. 4. \[R2\]interface GigabitEthernet 0/0/1
  5. 5. \[R2-GigabitEthernet0/0/1\]ip add 192.168.12.2 24
  6. 6. \[R2-GigabitEthernet0/0/1\]quit
  7. 8. \[R2\]interface GigabitEthernet 0/0/0
  8. 9. \[R2-GigabitEthernet0/0/0\]ip add 192.168.23.2 24
  9. 10. \[R2-GigabitEthernet0/0/0\]quit
  10. 12. \[R2\]ospf 1 router-id 2.2.2.2
  11. 13. \[R2-ospf-1\]area 12
  12. 14. \[R2-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
  13. 15. \[R2-ospf-1-area-0.0.0.12\]quit
  14. 16. \[R2-ospf-1\]area 0
  15. 17. \[R2-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
  16. 18. \[R2-ospf-1-area-0.0.0.0\]quit

3)配置 OSPF – R3

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R3
  4. 4. \[R3\]interface GigabitEthernet 0/0/1
  5. 5. \[R3-GigabitEthernet0/0/1\]ip add 192.168.23.3 24
  6. 6. \[R3-GigabitEthernet0/0/1\]quit
  7. 8. \[R3\]interface GigabitEthernet 0/0/0
  8. 9. \[R3-GigabitEthernet0/0/0\]ip add 192.168.34.3 24
  9. 10. \[R3-GigabitEthernet0/0/0\]quit
  10. 12. \[R3\]ospf 1 router-id 3.3.3.3
  11. 13. \[R3-ospf-1\]area 0
  12. 14. \[R3-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
  13. 15. \[R3-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
  14. 16. \[R3-ospf-1-area-0.0.0.0\]quit

4)配置 OSPF – R4

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R4
  4. 4. \[R4\]interface GigabitEthernet 0/0/1
  5. 5. \[R4-GigabitEthernet0/0/1\]ip add 192.168.34.4 24
  6. 6. \[R4-GigabitEthernet0/0/1\]quit
  7. 8. \[R4\]interface GigabitEthernet 0/0/0
  8. 9. \[R4-GigabitEthernet0/0/0\]ip add 192.168.45.4 24
  9. 10. \[R4-GigabitEthernet0/0/0\]quit
  10. 12. \[R4\]ospf 1 router-id 4.4.4.4
  11. 13. \[R4-ospf-1\]area 0
  12. 14. \[R4-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
  13. 15. \[R4-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
  14. 16. \[R4-ospf-1-area-0.0.0.0\]quit

5)配置 OSPF – R5

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R5
  4. 4. \[R5\]interface GigabitEthernet 0/0/1
  5. 5. \[R5-GigabitEthernet0/0/1\]ip add 192.168.45.5 24
  6. 6. \[R5-GigabitEthernet0/0/1\]quit
  7. 8. \[R5\]interface GigabitEthernet 0/0/0
  8. 9. \[R5-GigabitEthernet0/0/0\]ip add 192.168.56.5 24
  9. 10. \[R5-GigabitEthernet0/0/0\]quit
  10. 12. \[R5\]ospf 1 router-id 5.5.5.5
  11. 13. \[R5-ospf-1\]area 56
  12. 14. \[R5-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
  13. 15. \[R5-ospf-1-area-0.0.0.56\]quit
  14. 16. \[R5-ospf-1\]area 0
  15. 17. \[R5-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
  16. 18. \[R5-ospf-1-area-0.0.0.0\]quit

6)配置 OSPF – R6

  1. 1. <Huawei>undo terminal monitor
  2. 2. <Huawei>system-view
  3. 3. \[Huawei\]sysname R6
  4. 4. \[R6\]interface GigabitEthernet 0/0/1
  5. 5. \[R6-GigabitEthernet0/0/1\]ip add 192.168.56.6 24
  6. 6. \[R6-GigabitEthernet0/0/1\]quit
  7. 8. \[R6\]ospf 1 router-id 6.6.6.6
  8. 9. \[R6-ospf-1\]area 56
  9. 10. \[R6-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
  10. 11. \[R6-ospf-1-area-0.0.0.56\]quit

7)配置 R1—R6 的接口的 IPv6 地址

  1. 1. \[R1\]ipv6
  2. 2. \[R1\]interface gi0/0/0
  3. 3. \[R1-GigabitEthernet0/0/0\]ipv6 enable
  4. 4. \[R1-GigabitEthernet0/0/0\]ipv6 address 2001:12::1 64
  5. 5. \[R1-GigabitEthernet0/0/0\]quit
  6. 7. \[R2\]ipv6
  7. 8. \[R2\]interface gi0/0/1
  8. 9. \[R2-GigabitEthernet0/0/1\]ipv6 enable
  9. 10. \[R2-GigabitEthernet0/0/1\]ipv6 address 2001:12::2 64
  10. 11. \[R2-GigabitEthernet0/0/1\]quit
  11. 12. \[R2\]interface gi0/0/0
  12. 13. \[R2-GigabitEthernet0/0/0\]ipv6 enable
  13. 14. \[R2-GigabitEthernet0/0/0\]ipv6 address 2001:23::2 64
  14. 15. \[R2-GigabitEthernet0/0/0\]quit
  15. 17. \[R3\]ipv6
  16. 18. \[R3\]interface gi0/0/0
  17. 19. \[R3-GigabitEthernet0/0/0\]ipv6 enable
  18. 20. \[R3-GigabitEthernet0/0/0\]ipv6 address 2001:34::3 64
  19. 21. \[R3-GigabitEthernet0/0/0\]quit
  20. 22. \[R3\]interface gi0/0/1
  21. 23. \[R3-GigabitEthernet0/0/1\]ipv6 enable
  22. 24. \[R3-GigabitEthernet0/0/1\]ipv6 address 2001:23::3 64
  23. 25. \[R3-GigabitEthernet0/0/1\]quit
  24. 27. \[R4\]ipv6
  25. 28. \[R4\]interface gi0/0/1
  26. 29. \[R4-GigabitEthernet0/0/1\]ipv6 enable
  27. 30. \[R4-GigabitEthernet0/0/1\]ipv6 address 2001:34::4 64
  28. 31. \[R4-GigabitEthernet0/0/1\]quit
  29. 32. \[R4\]interface gi0/0/0
  30. 33. \[R4-GigabitEthernet0/0/0\]ipv6 enable
  31. 34. \[R4-GigabitEthernet0/0/0\]ipv6 address 2001:45::4 64
  32. 35. \[R4-GigabitEthernet0/0/0\]quit
  33. 37. \[R5\]ipv6
  34. 38. \[R5\]interface gi0/0/0
  35. 39. \[R5-GigabitEthernet0/0/0\]ipv6 enable
  36. 40. \[R5-GigabitEthernet0/0/0\]ipv6 address 2001:56::5 64
  37. 41. \[R5-GigabitEthernet0/0/0\]quit
  38. 42. \[R5\]interface gi0/0/1
  39. 43. \[R5-GigabitEthernet0/0/1\]ipv6 enable
  40. 44. \[R5-GigabitEthernet0/0/1\]ipv6 address 2001:45::5 64
  41. 45. \[R5-GigabitEthernet0/0/1\]quit
  42. 47. \[R6\]ipv6
  43. 48. \[R6\]interface gi0/0/1
  44. 49. \[R6-GigabitEthernet0/0/1\]ipv6 enable
  45. 50. \[R6-GigabitEthernet0/0/1\]ipv6 address 2001:56::6 64
  46. 51. \[R6-GigabitEthernet0/0/1\]quit

5 IPv6 静态路由配置

5.1 需求

1)企业内网因业务需要,现将 IPv4 网络升级为 IPv6 网络

2)确保在升级过程中,不会出现现有业务中断,实现业务平滑迁移

3)为确保的业务的稳定性,在网络改造过程中,使用局部改造、局部测试的方法,并通过简单、可靠的静态路由来实现

5.2 方案

搭建实验环境,如图 - 5 所示。

CASE - 图5

图 - 5

5.3 步骤

实现此案例需要按照如下步骤进行。

1)配置 OSPF - R1

  1. 1. \[R1\]ipv6
  2. 2. \[R1\]interface gi0/0/0
  3. 3. \[R1-GigabitEthernet0/0/0\]ipv6 enable
  4. 4. \[R1-GigabitEthernet0/0/0\]ipv6 address 2001:12::1 64
  5. 5. \[R1-GigabitEthernet0/0/0\]quit
  6. 6. \[R1\]ipv6 route-static 2001:56:: 64 2001:12::2

2)配置 OSPF – R2

  1. 1. \[R2\]ipv6
  2. 2. \[R2\]interface gi0/0/1
  3. 3. \[R2-GigabitEthernet0/0/1\]ipv6 enable
  4. 4. \[R2-GigabitEthernet0/0/1\]ipv6 address 2001:12::2 64
  5. 5. \[R2-GigabitEthernet0/0/1\]quit
  6. 6. \[R2\]interface gi0/0/0
  7. 7. \[R2-GigabitEthernet0/0/0\]ipv6 enable
  8. 8. \[R2-GigabitEthernet0/0/0\]ipv6 address 2001:23::2 64
  9. 9. \[R2-GigabitEthernet0/0/0\]quit
  10. 10. \[R2\]ipv6 route-static 2001:56:: 64 2001:23::3

3)配置 OSPF – R3

  1. 1. \[R3\]ipv6
  2. 2. \[R3\]interface gi0/0/0
  3. 3. \[R3-GigabitEthernet0/0/0\]ipv6 enable
  4. 4. \[R3-GigabitEthernet0/0/0\]ipv6 address 2001:34::3 64
  5. 5. \[R3-GigabitEthernet0/0/0\]quit
  6. 6. \[R3\]interface gi0/0/1
  7. 7. \[R3-GigabitEthernet0/0/1\]ipv6 enable
  8. 8. \[R3-GigabitEthernet0/0/1\]ipv6 address 2001:23::3 64
  9. 9. \[R3-GigabitEthernet0/0/1\]quit
  10. 10. \[R3\]ipv6 route-static 2001:56:: 64 2001:34::4
  11. 11. \[R3\]ipv6 route-static 2001:56:: 64 2001:23::2

4)配置 OSPF – R4

  1. 1. \[R4\]ipv6
  2. 2. \[R4\]interface gi0/0/1
  3. 3. \[R4-GigabitEthernet0/0/1\]ipv6 enable
  4. 4. \[R4-GigabitEthernet0/0/1\]ipv6 address 2001:34::4 64
  5. 5. \[R4-GigabitEthernet0/0/1\]quit
  6. 6. \[R4\]interface gi0/0/0
  7. 7. \[R4-GigabitEthernet0/0/0\]ipv6 enable
  8. 8. \[R4-GigabitEthernet0/0/0\]ipv6 address 2001:45::4 64
  9. 9. \[R4-GigabitEthernet0/0/0\]quit
  10. 10. \[R4\]ipv6 route-static 2001:56:: 64 2001:45::5
  11. 11. \[R4\]ipv6 route-static 2001:12:: 64 2001:34::3

5)配置 OSPF – R5

  1. 1. \[R5\]ipv6
  2. 2. \[R5\]interface gi0/0/0
  3. 3. \[R5-GigabitEthernet0/0/0\]ipv6 enable
  4. 4. \[R5-GigabitEthernet0/0/0\]ipv6 address 2001:56::5 64
  5. 5. \[R5-GigabitEthernet0/0/0\]quit
  6. 6. \[R5\]interface gi0/0/1
  7. 7. \[R5-GigabitEthernet0/0/1\]ipv6 enable
  8. 8. \[R5-GigabitEthernet0/0/1\]ipv6 address 2001:45::5 64
  9. 9. \[R5-GigabitEthernet0/0/1\]quit
  10. 10. \[R4\]ipv6 route-static 2001:12:: 64 2001:45::4

6)配置 OSPF – R6

  1. 1. \[R6\]ipv6
  2. 2. \[R6\]interface gi0/0/1
  3. 3. \[R6-GigabitEthernet0/0/1\]ipv6 enable
  4. 4. \[R6-GigabitEthernet0/0/1\]ipv6 address 2001:56::6 64
  5. 5. \[R6-GigabitEthernet0/0/1\]quit
  6. 6. \[R6\]ipv6 route-static :: 0 2001:56::5

6 IPv6 动态路由之 OSPFv3 配置

6.1 需求

1)企业内网因业务需要,现将 IPv4 网络升级为 IPv6 网络

2)同时将企业的 OSPFv2 协议,升级为 OSPFv3

6.2 方案

搭建实验环境,如图 - 6 所示。

CASE - 图6

图 - 6

6.3 步骤

实现此案例需要按照如下步骤进行。

1)配置 OSPF - R1

  1. 1. \[R1\]ipv6
  2. 2. \[R1\]interface gi0/0/0
  3. 3. \[R1-GigabitEthernet0/0/0\]ipv6 enable
  4. 4. \[R1-GigabitEthernet0/0/0\]ipv6 address 2001:12::1 64
  5. 5. \[R1-GigabitEthernet0/0/0\]quit
  6. 7. \[R1\]ospfv3 1
  7. 8. \[R1-ospfv3-1\]router-id 1.1.1.1
  8. 9. \[R1-ospfv3-1\]quit
  9. 10. \[R1\]interface GigabitEthernet 0/0/0
  10. 11. \[R1-GigabitEthernet0/0/0\]ospfv3 1 area 12
  11. 12. \[R1-GigabitEthernet0/0/0\]quit

2)配置 OSPF – R2

  1. 1. \[R2\]ipv6
  2. 2. \[R2\]interface gi0/0/1
  3. 3. \[R2-GigabitEthernet0/0/1\]ipv6 enable
  4. 4. \[R2-GigabitEthernet0/0/1\]ipv6 address 2001:12::2 64
  5. 5. \[R2-GigabitEthernet0/0/1\]quit
  6. 6. \[R2\]interface gi0/0/0
  7. 7. \[R2-GigabitEthernet0/0/0\]ipv6 enable
  8. 8. \[R2-GigabitEthernet0/0/0\]ipv6 address 2001:23::2 64
  9. 9. \[R2-GigabitEthernet0/0/0\]quit
  10. 11. \[R2\]ospfv3 1
  11. 12. \[R2-ospfv3-1\]router-id 2.2.2.2
  12. 13. \[R2-ospfv3-1\]quit
  13. 14. \[R2\]interface GigabitEthernet 0/0/0
  14. 15. \[R2-GigabitEthernet0/0/0\]ospfv3 1 area 0
  15. 16. \[R2-GigabitEthernet0/0/0\]quit
  16. 17. \[R2\]interface GigabitEthernet 0/0/1
  17. 18. \[R2-GigabitEthernet0/0/1\]ospfv3 1 area 12
  18. 19. \[R2-GigabitEthernet0/0/1\]quit

3)配置 OSPF – R3

  1. 1. \[R3\]ipv6
  2. 2. \[R3\]interface gi0/0/0
  3. 3. \[R3-GigabitEthernet0/0/0\]ipv6 enable
  4. 4. \[R3-GigabitEthernet0/0/0\]ipv6 address 2001:34::3 64
  5. 5. \[R3-GigabitEthernet0/0/0\]quit
  6. 6. \[R3\]interface gi0/0/1
  7. 7. \[R3-GigabitEthernet0/0/1\]ipv6 enable
  8. 8. \[R3-GigabitEthernet0/0/1\]ipv6 address 2001:23::3 64
  9. 9. \[R3-GigabitEthernet0/0/1\]quit
  10. 11. \[R3\]ospfv3 1
  11. 12. \[R3-ospfv3-1\]router-id 3.3.3.3
  12. 13. \[R3-ospfv3-1\]quit
  13. 14. \[R3\]interface GigabitEthernet 0/0/0
  14. 15. \[R3-GigabitEthernet0/0/0\]ospfv3 1 area 0
  15. 16. \[R3-GigabitEthernet0/0/0\]quit
  16. 17. \[R3\]interface GigabitEthernet 0/0/1
  17. 18. \[R3-GigabitEthernet0/0/1\]ospfv3 1 area 0
  18. 19. \[R3-GigabitEthernet0/0/1\]quit

4)配置 OSPF – R4

  1. 1. \[R4\]ipv6
  2. 2. \[R4\]interface gi0/0/1
  3. 3. \[R4-GigabitEthernet0/0/1\]ipv6 enable
  4. 4. \[R4-GigabitEthernet0/0/1\]ipv6 address 2001:34::4 64
  5. 5. \[R4-GigabitEthernet0/0/1\]quit
  6. 6. \[R4\]interface gi0/0/0
  7. 7. \[R4-GigabitEthernet0/0/0\]ipv6 enable
  8. 8. \[R4-GigabitEthernet0/0/0\]ipv6 address 2001:45::4 64
  9. 9. \[R4-GigabitEthernet0/0/0\]quit
  10. 11. \[R4\]ospfv3 1
  11. 12. \[R4-ospfv3-1\]router-id 4.4.4.4
  12. 13. \[R4-ospfv3-1\]quit
  13. 14. \[R4\]interface GigabitEthernet 0/0/0
  14. 15. \[R4-GigabitEthernet0/0/0\]ospfv3 1 area 0
  15. 16. \[R4-GigabitEthernet0/0/0\]quit
  16. 17. \[R4\]interface GigabitEthernet 0/0/1
  17. 18. \[R4-GigabitEthernet0/0/1\]ospfv3 1 area 0
  18. 19. \[R4-GigabitEthernet0/0/1\]quit

5)配置 OSPF – R5

  1. 1. \[R5\]ipv6
  2. 2. \[R5\]interface gi0/0/0
  3. 3. \[R5-GigabitEthernet0/0/0\]ipv6 enable
  4. 4. \[R5-GigabitEthernet0/0/0\]ipv6 address 2001:56::5 64
  5. 5. \[R5-GigabitEthernet0/0/0\]quit
  6. 6. \[R5\]interface gi0/0/1
  7. 7. \[R5-GigabitEthernet0/0/1\]ipv6 enable
  8. 8. \[R5-GigabitEthernet0/0/1\]ipv6 address 2001:45::5 64
  9. 9. \[R5-GigabitEthernet0/0/1\]quit
  10. 11. \[R5\]ospfv3 1
  11. 12. \[R5-ospfv3-1\]router-id 5.5.5.5
  12. 13. \[R5-ospfv3-1\]quit
  13. 14. \[R5\]interface GigabitEthernet 0/0/0
  14. 15. \[R5-GigabitEthernet0/0/0\]ospfv3 1 area 56
  15. 16. \[R5-GigabitEthernet0/0/0\]quit
  16. 17. \[R5\]interface GigabitEthernet 0/0/1
  17. 18. \[R5-GigabitEthernet0/0/1\]ospfv3 1 area 0
  18. 19. \[R5-GigabitEthernet0/0/1\]quit

6)配置 OSPF – R6

  1. 1. \[R6\]ipv6
  2. 2. \[R6\]interface gi0/0/1
  3. 3. \[R6-GigabitEthernet0/0/1\]ipv6 enable
  4. 4. \[R6-GigabitEthernet0/0/1\]ipv6 address 2001:56::6 64
  5. 5. \[R6-GigabitEthernet0/0/1\]quit
  6. 7. \[R6\]ospfv3 1
  7. 8. \[R6-ospfv3-1\]router-id 6.6.6.6
  8. 9. \[R6-ospfv3-1\]quit
  9. 10. \[R6\]interface GigabitEthernet 0/0/1
  10. 11. \[R6-GigabitEthernet0/0/1\]ospfv3 1 area 56
  11. 12. \[R6-GigabitEthernet0/0/1\]quit

https://tts.tmooc.cn/ttsPage/NTD/NTDTN202109/TCNE/DAY05/CASE/01/index.html