1 OSPF 路由表管理
1.1 需求
1)为了提高企业内网的稳定性,在骨干区域增加了冗余设备和线路
2)为了更好的利用这些线路,需要优化这些数据的转发路径
3)在区域 0 中,存在多个数据转发路径;R8 作为 R3/4 的备份设备
4)最优的数据转发路径为:R2—R3—R4—R5
5)确保 R1 和 R6 之间使用最优路径转发数据
1.2 方案
搭建实验环境,如图 - 1 所示。
图 - 1
1.3 步骤
实现此案例需要按照如下步骤进行。
1)配置 OSPF - R1
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R1
4. \[R1\]interface GigabitEthernet 0/0/0
5. \[R1-GigabitEthernet0/0/0\]ip add 192.168.12.1 24
6. \[R1-GigabitEthernet0/0/0\]quit
8. \[R1\]ospf 1 router-id 1.1.1.1
9. \[R1-ospf-1\]area 12
10. \[R1-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
11. \[R1-ospf-1-area-0.0.0.12\]quit
2)配置 OSPF – R2
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R2
4. \[R2\]interface GigabitEthernet 0/0/1
5. \[R2-GigabitEthernet0/0/1\]ip add 192.168.12.2 24
6. \[R2-GigabitEthernet0/0/1\]quit
8. \[R2\]interface GigabitEthernet 0/0/0
9. \[R2-GigabitEthernet0/0/0\]ip add 192.168.23.2 24
10. \[R2-GigabitEthernet0/0/0\]quit
12. \[R2\]interface GigabitEthernet 0/0/2
13. \[R2-GigabitEthernet0/0/2\]ip add 192.168.28.2 24
14. \[R2-GigabitEthernet0/0/2\]quit
16. \[R2\]ospf 1 router-id 2.2.2.2
17. \[R2-ospf-1\]area 12
18. \[R2-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
19. \[R2-ospf-1-area-0.0.0.12\]quit
20. \[R2-ospf-1\]area 0
21. \[R2-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
22. \[R2-ospf-1-area-0.0.0.0\]network 192.168.28.0 0.0.0.255
23. \[R2-ospf-1-area-0.0.0.0\]quit
3)配置 OSPF – R3
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R3
4. \[R3\]interface GigabitEthernet 0/0/1
5. \[R3-GigabitEthernet0/0/1\]ip add 192.168.23.3 24
6. \[R3-GigabitEthernet0/0/1\]quit
8. \[R3\]interface GigabitEthernet 0/0/0
9. \[R3-GigabitEthernet0/0/0\]ip add 192.168.34.3 24
10. \[R3-GigabitEthernet0/0/0\]quit
12. \[R3\]interface GigabitEthernet 0/0/2
13. \[R3-GigabitEthernet0/0/2\]ip add 192.168.38.3 24
14. \[R3-GigabitEthernet0/0/2\]quit
16. \[R3\]ospf 1 router-id 3.3.3.3
17. \[R3-ospf-1\]area 0
18. \[R3-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
19. \[R3-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
20. \[R3-ospf-1-area-0.0.0.0\]network 192.168.38.0 0.0.0.255
21. \[R3-ospf-1-area-0.0.0.0\]quit
4)配置 OSPF – R4
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R4
4. \[R4\]interface GigabitEthernet 0/0/1
5. \[R4-GigabitEthernet0/0/1\]ip add 192.168.34.4 24
6. \[R4-GigabitEthernet0/0/1\]quit
8. \[R4\]interface GigabitEthernet 0/0/0
9. \[R4-GigabitEthernet0/0/0\]ip add 192.168.45.4 24
10. \[R4-GigabitEthernet0/0/0\]quit
12. \[R4\]interface GigabitEthernet 0/0/2
13. \[R4-GigabitEthernet0/0/2\]ip add 192.168.48.4 24
14. \[R4-GigabitEthernet0/0/2\]quit
16. \[R4\]ospf 1 router-id 4.4.4.4
17. \[R4-ospf-1\]area 0
18. \[R4-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
19. \[R4-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
20. \[R4-ospf-1-area-0.0.0.0\]network 192.168.48.0 0.0.0.255
22. \[R4-ospf-1-area-0.0.0.0\]quit
5)配置 OSPF – R5
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R5
4. \[R5\]interface GigabitEthernet 0/0/1
5. \[R5-GigabitEthernet0/0/1\]ip add 192.168.45.5 24
6. \[R5-GigabitEthernet0/0/1\]quit
8. \[R5\]interface GigabitEthernet 0/0/0
9. \[R5-GigabitEthernet0/0/0\]ip add 192.168.56.5 24
10. \[R5-GigabitEthernet0/0/0\]quit
12. \[R5\]interface GigabitEthernet 0/0/2
13. \[R5-GigabitEthernet0/0/2\]ip add 192.168.58.5 24
14. \[R5-GigabitEthernet0/0/2\]quit
16. \[R5\]ospf 1 router-id 5.5.5.5
17. \[R5-ospf-1\]area 0
18. \[R5-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
19. \[R5-ospf-1-area-0.0.0.0\]network 192.168.58.0 0.0.0.255
20. \[R5-ospf-1-area-0.0.0.0\]quit
21. \[R5-ospf-1\]area 56
22. \[R5-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.25
23. \[R5-ospf-1-area-0.0.0.56\]quit
6)配置 OSPF – R6
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R6
4. \[R6\]interface GigabitEthernet 0/0/1
5. \[R6-GigabitEthernet0/0/1\]ip add 192.168.56.6 24
6. \[R6-GigabitEthernet0/0/1\]quit
8. \[R6\]ospf 1 router-id 6.6.6.6
9. \[R6-ospf-1\]area 56
10. \[R6-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
11. \[R6-ospf-1-area-0.0.0.56\]quit
7)配置 OSPF – R8
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R8
4. \[R8\]interface GigabitEthernet 0/0/2
5. \[R8-GigabitEthernet0/0/2\]ip add 192.168.28.8 24
6. \[R8-GigabitEthernet0/0/2\]quit
7. \[R8\]interface GigabitEthernet 0/0/1
8. \[R8-GigabitEthernet0/0/1\]ip add 192.168.38.8 24
9. \[R8-GigabitEthernet0/0/1\]quit
10. \[R8\]interface GigabitEthernet 0/0/0
11. \[R8-GigabitEthernet0/0/0\]ip add 192.168.48.8 24
12. \[R8-GigabitEthernet0/0/0\]quit
13. \[R8\]interface GigabitEthernet 4/0/0
14. \[R8-GigabitEthernet4/0/0\]ip add 192.168.58.8 24
15. \[R8-GigabitEthernet4/0/0\]quit
17. \[R6\]ospf 1 router-id 8.8.8.8
18. \[R6-ospf-1\]area 0
19. \[R6-ospf-1-area-0.0.0.0\]network 192.168.28.0 0.0.0.255
20. \[R6-ospf-1-area-0.0.0.0\]network 192.168.38.0 0.0.0.255
21. \[R6-ospf-1-area-0.0.0.0\]network 192.168.48.0 0.0.0.255
22. \[R6-ospf-1-area-0.0.0.0\]network 192.168.58.0 0.0.0.255
23. \[R6-ospf-1-area-0.0.0.0\]quit
8)在 R2 上修改连接 R8 的端口的开销
1. \[R2\]interface GigabitEthernet 0/0/2
2. \[R2-GigabitEthernet0/0/2\]ospf cost 3
3. \[R2-GigabitEthernet0/0/2\]quit
2 OSPF 路由过滤之 route-policy
2.1 需求
1)企业内网部分网络运行 OSPF 协议,但是服务器所在部门使用静态
2)配置路由控制策略,确保 PC1 仅仅能访问 Server2
2.2 方案
搭建实验环境,如图 - 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. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R1
4. \[R1\]interface GigabitEthernet 0/0/0
5. \[R1-GigabitEthernet0/0/0\]ip add 192.168.12.1 24
6. \[R1-GigabitEthernet0/0/0\]quit
7. \[R1\]interface GigabitEthernet 0/0/1
8. \[R1-GigabitEthernet0/0/1\]ip add 192.168.1.254 24
9. \[R1-GigabitEthernet0/0/1\]quit
10. \[R1\]interface GigabitEthernet 0/0/2
11. \[R1-GigabitEthernet0/0/2\]ip add 192.168.2.254 24
12. \[R1-GigabitEthernet0/0/2\]quit
14. \[R1\]ip route-static 192.168.0.0 16 192.168.12.2
3)配置 OSPF – R2
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R2
4. \[R2\]interface GigabitEthernet 0/0/1
5. \[R2-GigabitEthernet0/0/1\]ip add 192.168.12.2 24
6. \[R2-GigabitEthernet0/0/1\]quit
8. \[R2\]interface GigabitEthernet 0/0/0
9. \[R2-GigabitEthernet0/0/0\]ip add 192.168.23.2 24
10. \[R2-GigabitEthernet0/0/0\]quit
12. \[R2\]ip route-static 192.168.1.0 24 192.168.12.1
13. \[R2\]ip route-static 192.168.2.0 24 192.168.12.1
16. \[R2\]acl 2000
17. \[R2-acl-basic-2000\]rule 10 permit source 192.168.2.0 0.0.0.255
18. \[R2-acl-basic-2000\]quit
20. \[R2\]route-policy A permit node 10
21. \[R2-route-policy\]if-match acl 2000
22. \[R2-route-policy\]quit
24. \[R2\]ospf 1 router-id 2.2.2.2
25. \[R2-ospf-1\]area 123
26. \[R2-ospf-1-area-0.0.0.123\]network 192.168.23.0 0.0.0.255
27. \[R2-ospf-1-area-0.0.0.123\]quit
28. \[R2-ospf-1\]import-route static route-policy A
29. \[R2-ospf-1\]quit
4)配置 OSPF – R3
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R3
4. \[R3\]interface GigabitEthernet 0/0/1
5. \[R3-GigabitEthernet0/0/1\]ip add 192.168.23.3 24
6. \[R3-GigabitEthernet0/0/1\]quit
8. \[R3\]interface GigabitEthernet 0/0/0
9. \[R3-GigabitEthernet0/0/0\]ip add 192.168.34.3 24
10. \[R3-GigabitEthernet0/0/0\]quit
12. \[R3\]ospf 1 router-id 3.3.3.3
13. \[R3-ospf-1\]area 123
14. \[R3-ospf-1-area-0.0.0.123\]network 192.168.23.0 0.0.0.255
15. \[R3-ospf-1-area-0.0.0.123\]network 192.168.34.0 0.0.0.255
16. \[R3-ospf-1-area-0.0.0.123\]quit
5)配置 OSPF – R4
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R4
4. \[R4\]interface GigabitEthernet 0/0/1
5. \[R4-GigabitEthernet0/0/1\]ip add 192.168.34.4 24
6. \[R4-GigabitEthernet0/0/1\]quit
8. \[R4\]interface GigabitEthernet 0/0/0
9. \[R4-GigabitEthernet0/0/0\]ip add 192.168.45.4 24
10. \[R4-GigabitEthernet0/0/0\]quit
12. \[R4\]ospf 1 router-id 4.4.4.4
13. \[R4-ospf-1\]area 0
14. \[R4-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
15. \[R4-ospf-1-area-0.0.0.0\]quit
16. \[R4-ospf-1\]area 123
17. \[R4-ospf-1-area-0.0.0.123\]network 192.168.34.0 0.0.0.255
18. \[R4-ospf-1-area-0.0.0.123\]quit
6)配置 OSPF – R5
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R5
4. \[R5\]interface GigabitEthernet 0/0/1
5. \[R5-GigabitEthernet0/0/1\]ip add 192.168.45.5 24
6. \[R5-GigabitEthernet0/0/1\]quit
8. \[R5\]interface GigabitEthernet 0/0/2
9. \[R5-GigabitEthernet0/0/2\]ip add 192.168.3.254 24
10. \[R5-GigabitEthernet0/0/2\]quit
12. \[R5\]ospf 1 router-id 5.5.5.5
13. \[R5-ospf-1\]area 0
14. \[R5-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
15. \[R5-ospf-1-area-0.0.0.0\]network 192.168.3.0 0.0.0.255
16. \[R5-ospf-1-area-0.0.0.0\]quit
7)配置 OSPF – R6
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R6
4. \[R6\]interface GigabitEthernet 0/0/1
5. \[R6-GigabitEthernet0/0/1\]ip add 192.168.56.6 24
6. \[R6-GigabitEthernet0/0/1\]quit
8. \[R6\]ospf 1 router-id 6.6.6.6
9. \[R6-ospf-1\]area 56
10. \[R6-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
11. \[R6-ospf-1-area-0.0.0.56\]quit
8)配置 R2 和 R3 之间的链路认证 - 明文认证,密码为 HCIE
1. \[R2\]interface GigabitEthernet 0/0/0
2. \[R2-GigabitEthernet0/0/0\]ospf authentication-mode simple cipher HCIE
3. \[R2-GigabitEthernet0/0/0\]quit
5. \[R3\]interface GigabitEthernet 0/0/1
6. \[R3-GigabitEthernet0/0/1\]ospf authentication-mode simple cipher HCIE
7. \[R3-GigabitEthernet0/0/1\]quit
9)配置 R3 和 R4 之间的链路认证 - 明文认证,密码为 HCIP
1. \[R3\]interface GigabitEthernet 0/0/0
2. \[R3-GigabitEthernet0/0/0\]ospf authentication-mode simple cipher HCIP
3. \[R3-GigabitEthernet0/0/0\]quit
5. \[R4\]interface GigabitEthernet 0/0/1
6. \[R4-GigabitEthernet0/0/1\]ospf authentication-mode simple cipher HCIP
7. \[R4-GigabitEthernet0/0/1\]quit
10)配置 R4 和 R5 之间的链路认证 - 密文认证,密码为 HCIA
1. \[R4\]interface GigabitEthernet 0/0/0
2. \[R4-GigabitEthernet0/0/0\]ospf authentication-mode md5 10 cipher HCIA
3. \[R4-GigabitEthernet0/0/0\]quit
5. \[R5\]interface GigabitEthernet 0/0/1
6. \[R5-GigabitEthernet0/0/1\]ospf authentication-mode md5 10 cipher HCIA
7. \[R5-GigabitEthernet0/0/1\]quit
3 OSPF 路由过滤之 LSA 过滤
3.1 需求
1)企业内网运行多区域的 OSPF 网络,区域之间通过骨干区域互通
2)为了确保业务安全,现控制区域 56 的设备与用户,不允许访问区域 12 中的设备和资源,同时减少区域 56 中的设备资源的占用率
3.2 方案
搭建实验环境,如图 - 3 所示。
图 - 3
3.3 步骤
实现此案例需要按照如下步骤进行。
1)配置 OSPF - R1
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R1
4. \[R1\]interface GigabitEthernet 0/0/0
5. \[R1-GigabitEthernet0/0/0\]ip add 192.168.12.1 24
6. \[R1-GigabitEthernet0/0/0\]quit
8. \[R1\]ospf 1 router-id 1.1.1.1
9. \[R1-ospf-1\]area 12
10. \[R1-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
11. \[R1-ospf-1-area-0.0.0.12\]quit
2)配置 OSPF – R2
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R2
4. \[R2\]interface GigabitEthernet 0/0/1
5. \[R2-GigabitEthernet0/0/1\]ip add 192.168.12.2 24
6. \[R2-GigabitEthernet0/0/1\]quit
8. \[R2\]interface GigabitEthernet 0/0/0
9. \[R2-GigabitEthernet0/0/0\]ip add 192.168.23.2 24
10. \[R2-GigabitEthernet0/0/0\]quit
12. \[R2\]ospf 1 router-id 2.2.2.2
13. \[R2-ospf-1\]area 12
14. \[R2-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
15. \[R2-ospf-1-area-0.0.0.12\]quit
16. \[R2-ospf-1\]area 0
17. \[R2-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
18. \[R2-ospf-1-area-0.0.0.0\]quit
3)配置 OSPF – R3
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R3
4. \[R3\]interface GigabitEthernet 0/0/1
5. \[R3-GigabitEthernet0/0/1\]ip add 192.168.23.3 24
6. \[R3-GigabitEthernet0/0/1\]quit
8. \[R3\]interface GigabitEthernet 0/0/0
9. \[R3-GigabitEthernet0/0/0\]ip add 192.168.34.3 24
10. \[R3-GigabitEthernet0/0/0\]quit
12. \[R3\]ospf 1 router-id 3.3.3.3
13. \[R3-ospf-1\]area 0
14. \[R3-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
15. \[R3-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
16. \[R3-ospf-1-area-0.0.0.0\]quit
4)配置 OSPF – R4
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R4
4. \[R4\]interface GigabitEthernet 0/0/1
5. \[R4-GigabitEthernet0/0/1\]ip add 192.168.34.4 24
6. \[R4-GigabitEthernet0/0/1\]quit
8. \[R4\]interface GigabitEthernet 0/0/0
9. \[R4-GigabitEthernet0/0/0\]ip add 192.168.45.4 24
10. \[R4-GigabitEthernet0/0/0\]quit
12. \[R4\]ospf 1 router-id 4.4.4.4
13. \[R4-ospf-1\]area 0
14. \[R4-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
15. \[R4-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
16. \[R4-ospf-1-area-0.0.0.0\]quit
5)配置 OSPF – R5
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R5
4. \[R5\]interface GigabitEthernet 0/0/1
5. \[R5-GigabitEthernet0/0/1\]ip add 192.168.45.5 24
6. \[R5-GigabitEthernet0/0/1\]quit
8. \[R5\]interface GigabitEthernet 0/0/0
9. \[R5-GigabitEthernet0/0/0\]ip add 192.168.56.5 24
10. \[R5-GigabitEthernet0/0/0\]quit
12. \[R5\]ospf 1 router-id 5.5.5.5
13. \[R5-ospf-1\]area 56
14. \[R5-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
15. \[R5-ospf-1-area-0.0.0.56\]quit
16. \[R5-ospf-1\]area 0
17. \[R5-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
18. \[R5-ospf-1-area-0.0.0.0\]quit
6)配置 OSPF – R6
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R6
4. \[R6\]interface GigabitEthernet 0/0/1
5. \[R6-GigabitEthernet0/0/1\]ip add 192.168.56.6 24
6. \[R6-GigabitEthernet0/0/1\]quit
8. \[R6\]ospf 1 router-id 6.6.6.6
9. \[R6-ospf-1\]area 56
10. \[R6-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
11. \[R6-ospf-1-area-0.0.0.56\]quit
7)在 R5 上对区域 12 的 3 类 LSA 进行过滤
1. \[R5\]acl 2012
2. \[R5-acl-basic-2012\]rule 10 deny source 192.168.2.0 0.0.0.255
3. \[R5-acl-basic-2012\]rule 20 permit source any
4. \[R5-acl-basic-2012\]quit
6. \[R5\]ospf 1
7. \[R5-ospf-1\]area 56
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 所示。
图 - 4
4.3 步骤
实现此案例需要按照如下步骤进行。
1)配置 OSPF - R1
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R1
4. \[R1\]interface GigabitEthernet 0/0/0
5. \[R1-GigabitEthernet0/0/0\]ip add 192.168.12.1 24
6. \[R1-GigabitEthernet0/0/0\]quit
8. \[R1\]ospf 1 router-id 1.1.1.1
9. \[R1-ospf-1\]area 12
10. \[R1-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
11. \[R1-ospf-1-area-0.0.0.12\]quit
2)配置 OSPF – R2
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R2
4. \[R2\]interface GigabitEthernet 0/0/1
5. \[R2-GigabitEthernet0/0/1\]ip add 192.168.12.2 24
6. \[R2-GigabitEthernet0/0/1\]quit
8. \[R2\]interface GigabitEthernet 0/0/0
9. \[R2-GigabitEthernet0/0/0\]ip add 192.168.23.2 24
10. \[R2-GigabitEthernet0/0/0\]quit
12. \[R2\]ospf 1 router-id 2.2.2.2
13. \[R2-ospf-1\]area 12
14. \[R2-ospf-1-area-0.0.0.12\]network 192.168.12.0 0.0.0.255
15. \[R2-ospf-1-area-0.0.0.12\]quit
16. \[R2-ospf-1\]area 0
17. \[R2-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
18. \[R2-ospf-1-area-0.0.0.0\]quit
3)配置 OSPF – R3
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R3
4. \[R3\]interface GigabitEthernet 0/0/1
5. \[R3-GigabitEthernet0/0/1\]ip add 192.168.23.3 24
6. \[R3-GigabitEthernet0/0/1\]quit
8. \[R3\]interface GigabitEthernet 0/0/0
9. \[R3-GigabitEthernet0/0/0\]ip add 192.168.34.3 24
10. \[R3-GigabitEthernet0/0/0\]quit
12. \[R3\]ospf 1 router-id 3.3.3.3
13. \[R3-ospf-1\]area 0
14. \[R3-ospf-1-area-0.0.0.0\]network 192.168.23.0 0.0.0.255
15. \[R3-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
16. \[R3-ospf-1-area-0.0.0.0\]quit
4)配置 OSPF – R4
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R4
4. \[R4\]interface GigabitEthernet 0/0/1
5. \[R4-GigabitEthernet0/0/1\]ip add 192.168.34.4 24
6. \[R4-GigabitEthernet0/0/1\]quit
8. \[R4\]interface GigabitEthernet 0/0/0
9. \[R4-GigabitEthernet0/0/0\]ip add 192.168.45.4 24
10. \[R4-GigabitEthernet0/0/0\]quit
12. \[R4\]ospf 1 router-id 4.4.4.4
13. \[R4-ospf-1\]area 0
14. \[R4-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
15. \[R4-ospf-1-area-0.0.0.0\]network 192.168.34.0 0.0.0.255
16. \[R4-ospf-1-area-0.0.0.0\]quit
5)配置 OSPF – R5
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R5
4. \[R5\]interface GigabitEthernet 0/0/1
5. \[R5-GigabitEthernet0/0/1\]ip add 192.168.45.5 24
6. \[R5-GigabitEthernet0/0/1\]quit
8. \[R5\]interface GigabitEthernet 0/0/0
9. \[R5-GigabitEthernet0/0/0\]ip add 192.168.56.5 24
10. \[R5-GigabitEthernet0/0/0\]quit
12. \[R5\]ospf 1 router-id 5.5.5.5
13. \[R5-ospf-1\]area 56
14. \[R5-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
15. \[R5-ospf-1-area-0.0.0.56\]quit
16. \[R5-ospf-1\]area 0
17. \[R5-ospf-1-area-0.0.0.0\]network 192.168.45.0 0.0.0.255
18. \[R5-ospf-1-area-0.0.0.0\]quit
6)配置 OSPF – R6
1. <Huawei>undo terminal monitor
2. <Huawei>system-view
3. \[Huawei\]sysname R6
4. \[R6\]interface GigabitEthernet 0/0/1
5. \[R6-GigabitEthernet0/0/1\]ip add 192.168.56.6 24
6. \[R6-GigabitEthernet0/0/1\]quit
8. \[R6\]ospf 1 router-id 6.6.6.6
9. \[R6-ospf-1\]area 56
10. \[R6-ospf-1-area-0.0.0.56\]network 192.168.56.0 0.0.0.255
11. \[R6-ospf-1-area-0.0.0.56\]quit
7)配置 R1—R6 的接口的 IPv6 地址
1. \[R1\]ipv6
2. \[R1\]interface gi0/0/0
3. \[R1-GigabitEthernet0/0/0\]ipv6 enable
4. \[R1-GigabitEthernet0/0/0\]ipv6 address 2001:12::1 64
5. \[R1-GigabitEthernet0/0/0\]quit
7. \[R2\]ipv6
8. \[R2\]interface gi0/0/1
9. \[R2-GigabitEthernet0/0/1\]ipv6 enable
10. \[R2-GigabitEthernet0/0/1\]ipv6 address 2001:12::2 64
11. \[R2-GigabitEthernet0/0/1\]quit
12. \[R2\]interface gi0/0/0
13. \[R2-GigabitEthernet0/0/0\]ipv6 enable
14. \[R2-GigabitEthernet0/0/0\]ipv6 address 2001:23::2 64
15. \[R2-GigabitEthernet0/0/0\]quit
17. \[R3\]ipv6
18. \[R3\]interface gi0/0/0
19. \[R3-GigabitEthernet0/0/0\]ipv6 enable
20. \[R3-GigabitEthernet0/0/0\]ipv6 address 2001:34::3 64
21. \[R3-GigabitEthernet0/0/0\]quit
22. \[R3\]interface gi0/0/1
23. \[R3-GigabitEthernet0/0/1\]ipv6 enable
24. \[R3-GigabitEthernet0/0/1\]ipv6 address 2001:23::3 64
25. \[R3-GigabitEthernet0/0/1\]quit
27. \[R4\]ipv6
28. \[R4\]interface gi0/0/1
29. \[R4-GigabitEthernet0/0/1\]ipv6 enable
30. \[R4-GigabitEthernet0/0/1\]ipv6 address 2001:34::4 64
31. \[R4-GigabitEthernet0/0/1\]quit
32. \[R4\]interface gi0/0/0
33. \[R4-GigabitEthernet0/0/0\]ipv6 enable
34. \[R4-GigabitEthernet0/0/0\]ipv6 address 2001:45::4 64
35. \[R4-GigabitEthernet0/0/0\]quit
37. \[R5\]ipv6
38. \[R5\]interface gi0/0/0
39. \[R5-GigabitEthernet0/0/0\]ipv6 enable
40. \[R5-GigabitEthernet0/0/0\]ipv6 address 2001:56::5 64
41. \[R5-GigabitEthernet0/0/0\]quit
42. \[R5\]interface gi0/0/1
43. \[R5-GigabitEthernet0/0/1\]ipv6 enable
44. \[R5-GigabitEthernet0/0/1\]ipv6 address 2001:45::5 64
45. \[R5-GigabitEthernet0/0/1\]quit
47. \[R6\]ipv6
48. \[R6\]interface gi0/0/1
49. \[R6-GigabitEthernet0/0/1\]ipv6 enable
50. \[R6-GigabitEthernet0/0/1\]ipv6 address 2001:56::6 64
51. \[R6-GigabitEthernet0/0/1\]quit
5 IPv6 静态路由配置
5.1 需求
1)企业内网因业务需要,现将 IPv4 网络升级为 IPv6 网络
2)确保在升级过程中,不会出现现有业务中断,实现业务平滑迁移
3)为确保的业务的稳定性,在网络改造过程中,使用局部改造、局部测试的方法,并通过简单、可靠的静态路由来实现
5.2 方案
搭建实验环境,如图 - 5 所示。
图 - 5
5.3 步骤
实现此案例需要按照如下步骤进行。
1)配置 OSPF - R1
1. \[R1\]ipv6
2. \[R1\]interface gi0/0/0
3. \[R1-GigabitEthernet0/0/0\]ipv6 enable
4. \[R1-GigabitEthernet0/0/0\]ipv6 address 2001:12::1 64
5. \[R1-GigabitEthernet0/0/0\]quit
6. \[R1\]ipv6 route-static 2001:56:: 64 2001:12::2
2)配置 OSPF – R2
1. \[R2\]ipv6
2. \[R2\]interface gi0/0/1
3. \[R2-GigabitEthernet0/0/1\]ipv6 enable
4. \[R2-GigabitEthernet0/0/1\]ipv6 address 2001:12::2 64
5. \[R2-GigabitEthernet0/0/1\]quit
6. \[R2\]interface gi0/0/0
7. \[R2-GigabitEthernet0/0/0\]ipv6 enable
8. \[R2-GigabitEthernet0/0/0\]ipv6 address 2001:23::2 64
9. \[R2-GigabitEthernet0/0/0\]quit
10. \[R2\]ipv6 route-static 2001:56:: 64 2001:23::3
3)配置 OSPF – R3
1. \[R3\]ipv6
2. \[R3\]interface gi0/0/0
3. \[R3-GigabitEthernet0/0/0\]ipv6 enable
4. \[R3-GigabitEthernet0/0/0\]ipv6 address 2001:34::3 64
5. \[R3-GigabitEthernet0/0/0\]quit
6. \[R3\]interface gi0/0/1
7. \[R3-GigabitEthernet0/0/1\]ipv6 enable
8. \[R3-GigabitEthernet0/0/1\]ipv6 address 2001:23::3 64
9. \[R3-GigabitEthernet0/0/1\]quit
10. \[R3\]ipv6 route-static 2001:56:: 64 2001:34::4
11. \[R3\]ipv6 route-static 2001:56:: 64 2001:23::2
4)配置 OSPF – R4
1. \[R4\]ipv6
2. \[R4\]interface gi0/0/1
3. \[R4-GigabitEthernet0/0/1\]ipv6 enable
4. \[R4-GigabitEthernet0/0/1\]ipv6 address 2001:34::4 64
5. \[R4-GigabitEthernet0/0/1\]quit
6. \[R4\]interface gi0/0/0
7. \[R4-GigabitEthernet0/0/0\]ipv6 enable
8. \[R4-GigabitEthernet0/0/0\]ipv6 address 2001:45::4 64
9. \[R4-GigabitEthernet0/0/0\]quit
10. \[R4\]ipv6 route-static 2001:56:: 64 2001:45::5
11. \[R4\]ipv6 route-static 2001:12:: 64 2001:34::3
5)配置 OSPF – R5
1. \[R5\]ipv6
2. \[R5\]interface gi0/0/0
3. \[R5-GigabitEthernet0/0/0\]ipv6 enable
4. \[R5-GigabitEthernet0/0/0\]ipv6 address 2001:56::5 64
5. \[R5-GigabitEthernet0/0/0\]quit
6. \[R5\]interface gi0/0/1
7. \[R5-GigabitEthernet0/0/1\]ipv6 enable
8. \[R5-GigabitEthernet0/0/1\]ipv6 address 2001:45::5 64
9. \[R5-GigabitEthernet0/0/1\]quit
10. \[R4\]ipv6 route-static 2001:12:: 64 2001:45::4
6)配置 OSPF – R6
1. \[R6\]ipv6
2. \[R6\]interface gi0/0/1
3. \[R6-GigabitEthernet0/0/1\]ipv6 enable
4. \[R6-GigabitEthernet0/0/1\]ipv6 address 2001:56::6 64
5. \[R6-GigabitEthernet0/0/1\]quit
6. \[R6\]ipv6 route-static :: 0 2001:56::5
6 IPv6 动态路由之 OSPFv3 配置
6.1 需求
1)企业内网因业务需要,现将 IPv4 网络升级为 IPv6 网络
2)同时将企业的 OSPFv2 协议,升级为 OSPFv3
6.2 方案
搭建实验环境,如图 - 6 所示。
图 - 6
6.3 步骤
实现此案例需要按照如下步骤进行。
1)配置 OSPF - R1
1. \[R1\]ipv6
2. \[R1\]interface gi0/0/0
3. \[R1-GigabitEthernet0/0/0\]ipv6 enable
4. \[R1-GigabitEthernet0/0/0\]ipv6 address 2001:12::1 64
5. \[R1-GigabitEthernet0/0/0\]quit
7. \[R1\]ospfv3 1
8. \[R1-ospfv3-1\]router-id 1.1.1.1
9. \[R1-ospfv3-1\]quit
10. \[R1\]interface GigabitEthernet 0/0/0
11. \[R1-GigabitEthernet0/0/0\]ospfv3 1 area 12
12. \[R1-GigabitEthernet0/0/0\]quit
2)配置 OSPF – R2
1. \[R2\]ipv6
2. \[R2\]interface gi0/0/1
3. \[R2-GigabitEthernet0/0/1\]ipv6 enable
4. \[R2-GigabitEthernet0/0/1\]ipv6 address 2001:12::2 64
5. \[R2-GigabitEthernet0/0/1\]quit
6. \[R2\]interface gi0/0/0
7. \[R2-GigabitEthernet0/0/0\]ipv6 enable
8. \[R2-GigabitEthernet0/0/0\]ipv6 address 2001:23::2 64
9. \[R2-GigabitEthernet0/0/0\]quit
11. \[R2\]ospfv3 1
12. \[R2-ospfv3-1\]router-id 2.2.2.2
13. \[R2-ospfv3-1\]quit
14. \[R2\]interface GigabitEthernet 0/0/0
15. \[R2-GigabitEthernet0/0/0\]ospfv3 1 area 0
16. \[R2-GigabitEthernet0/0/0\]quit
17. \[R2\]interface GigabitEthernet 0/0/1
18. \[R2-GigabitEthernet0/0/1\]ospfv3 1 area 12
19. \[R2-GigabitEthernet0/0/1\]quit
3)配置 OSPF – R3
1. \[R3\]ipv6
2. \[R3\]interface gi0/0/0
3. \[R3-GigabitEthernet0/0/0\]ipv6 enable
4. \[R3-GigabitEthernet0/0/0\]ipv6 address 2001:34::3 64
5. \[R3-GigabitEthernet0/0/0\]quit
6. \[R3\]interface gi0/0/1
7. \[R3-GigabitEthernet0/0/1\]ipv6 enable
8. \[R3-GigabitEthernet0/0/1\]ipv6 address 2001:23::3 64
9. \[R3-GigabitEthernet0/0/1\]quit
11. \[R3\]ospfv3 1
12. \[R3-ospfv3-1\]router-id 3.3.3.3
13. \[R3-ospfv3-1\]quit
14. \[R3\]interface GigabitEthernet 0/0/0
15. \[R3-GigabitEthernet0/0/0\]ospfv3 1 area 0
16. \[R3-GigabitEthernet0/0/0\]quit
17. \[R3\]interface GigabitEthernet 0/0/1
18. \[R3-GigabitEthernet0/0/1\]ospfv3 1 area 0
19. \[R3-GigabitEthernet0/0/1\]quit
4)配置 OSPF – R4
1. \[R4\]ipv6
2. \[R4\]interface gi0/0/1
3. \[R4-GigabitEthernet0/0/1\]ipv6 enable
4. \[R4-GigabitEthernet0/0/1\]ipv6 address 2001:34::4 64
5. \[R4-GigabitEthernet0/0/1\]quit
6. \[R4\]interface gi0/0/0
7. \[R4-GigabitEthernet0/0/0\]ipv6 enable
8. \[R4-GigabitEthernet0/0/0\]ipv6 address 2001:45::4 64
9. \[R4-GigabitEthernet0/0/0\]quit
11. \[R4\]ospfv3 1
12. \[R4-ospfv3-1\]router-id 4.4.4.4
13. \[R4-ospfv3-1\]quit
14. \[R4\]interface GigabitEthernet 0/0/0
15. \[R4-GigabitEthernet0/0/0\]ospfv3 1 area 0
16. \[R4-GigabitEthernet0/0/0\]quit
17. \[R4\]interface GigabitEthernet 0/0/1
18. \[R4-GigabitEthernet0/0/1\]ospfv3 1 area 0
19. \[R4-GigabitEthernet0/0/1\]quit
5)配置 OSPF – R5
1. \[R5\]ipv6
2. \[R5\]interface gi0/0/0
3. \[R5-GigabitEthernet0/0/0\]ipv6 enable
4. \[R5-GigabitEthernet0/0/0\]ipv6 address 2001:56::5 64
5. \[R5-GigabitEthernet0/0/0\]quit
6. \[R5\]interface gi0/0/1
7. \[R5-GigabitEthernet0/0/1\]ipv6 enable
8. \[R5-GigabitEthernet0/0/1\]ipv6 address 2001:45::5 64
9. \[R5-GigabitEthernet0/0/1\]quit
11. \[R5\]ospfv3 1
12. \[R5-ospfv3-1\]router-id 5.5.5.5
13. \[R5-ospfv3-1\]quit
14. \[R5\]interface GigabitEthernet 0/0/0
15. \[R5-GigabitEthernet0/0/0\]ospfv3 1 area 56
16. \[R5-GigabitEthernet0/0/0\]quit
17. \[R5\]interface GigabitEthernet 0/0/1
18. \[R5-GigabitEthernet0/0/1\]ospfv3 1 area 0
19. \[R5-GigabitEthernet0/0/1\]quit
6)配置 OSPF – R6
1. \[R6\]ipv6
2. \[R6\]interface gi0/0/1
3. \[R6-GigabitEthernet0/0/1\]ipv6 enable
4. \[R6-GigabitEthernet0/0/1\]ipv6 address 2001:56::6 64
5. \[R6-GigabitEthernet0/0/1\]quit
7. \[R6\]ospfv3 1
8. \[R6-ospfv3-1\]router-id 6.6.6.6
9. \[R6-ospfv3-1\]quit
10. \[R6\]interface GigabitEthernet 0/0/1
11. \[R6-GigabitEthernet0/0/1\]ospfv3 1 area 56
12. \[R6-GigabitEthernet0/0/1\]quit
https://tts.tmooc.cn/ttsPage/NTD/NTDTN202109/TCNE/DAY05/CASE/01/index.html