OSPF数据库概述 、 4/5类LSA介绍 、 特殊区域之stub 、 OSFP路由引入 、 3类LSA介绍 、 1/2 类LSA介绍

1 案例:熟悉OSPF数据库

1.1 问题

  1. 如图配置 IP 和OSPF
  2. 查看并熟悉OSPF数据库
  3. 分析多区域带来的好处

1.2 方案

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

OSPF数据库概述 、 4/5类LSA介绍 、 特殊区域之stub 、 OSFP路由引入 、 3类LSA介绍 、 1/2 类LSA介绍图-1

1.3 步骤

实现此案例需要按照如下步骤进行。[hidecontent type=”payshow”]

1)配置IP地址,设置OSPF区域

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname R1
  4. [R1]interface GigabitEthernet 0/0/0
  5. [R1GigabitEthernet0/0/0]ip add 192.168.12.1 24
  6. [R1GigabitEthernet0/0/0]quit
  7. [R1]ospf 1 routerid 1.1.1.1
  8. [R1ospf-1]area 12
  9. [R1ospf-1area-0.0.0.12]network 192.168.12.0 0.0.0.255
  10. [R1ospf-1area-0.0.0.12]quit
  11. <Huawei>undo terminal monitor
  12. <Huawei>systemview
  13. [Huawei]sysname R2
  14. [R2]interface GigabitEthernet 0/0/1
  15. [R2GigabitEthernet0/0/1]ip add 192.168.12.2 24
  16. [R2GigabitEthernet0/0/1]quit
  17. [R2]interface GigabitEthernet 0/0/0
  18. [R2GigabitEthernet0/0/0]ip add 192.168.23.2 24
  19. [R2GigabitEthernet0/0/0]quit
  20. [R2]ospf 1 routerid 2.2.2.2
  21. [R2ospf-1]area 12
  22. [R2ospf-1area-0.0.0.12]network 192.168.12.0 0.0.0.255
  23. [R2ospf-1area-0.0.0.12]quit
  24. [R2ospf-1]area 0
  25. [R2ospf-1area-0.0.0.0]network 192.168.23.0 0.0.0.255
  26. [R2ospf-1area-0.0.0.0]quit
  27. <Huawei>undo terminal monitor
  28. <Huawei>systemview
  29. [Huawei]sysname R3
  30. [R3]interface GigabitEthernet 0/0/1
  31. [R3GigabitEthernet0/0/1]ip add 192.168.23.3 24
  32. [R3GigabitEthernet0/0/1]quit
  33. [R3]interface GigabitEthernet 0/0/0
  34. [R3GigabitEthernet0/0/0]ip add 192.168.34.3 24
  35. [R3GigabitEthernet0/0/0]quit
  36. [R3]ospf 1 routerid 3.3.3.3
  37. [R3ospf-1]area 0
  38. [R3ospf-1area-0.0.0.0]network 192.168.23.0 0.0.0.255
  39. [R3ospf-1area-0.0.0.0]network 192.168.34.0 0.0.0.255
  40. [R3ospf-1area-0.0.0.0]quit
  41. <Huawei>undo terminal monitor
  42. <Huawei>systemview
  43. [Huawei]sysname R4
  44. [R4]interface GigabitEthernet 0/0/1
  45. [R4GigabitEthernet0/0/1]ip add 192.168.34.4 24
  46. [R4GigabitEthernet0/0/1]quit
  47. [R4]interface GigabitEthernet 0/0/0
  48. [R4GigabitEthernet0/0/0]ip add 192.168.45.4 24
  49. [R4GigabitEthernet0/0/0]quit
  50. [R4]ospf 1 routerid 4.4.4.4
  51. [R4ospf-1]area 0
  52. [R4ospf-1area-0.0.0.0]network 192.168.45.0 0.0.0.255
  53. [R4ospf-1area-0.0.0.0]network 192.168.34.0 0.0.0.255
  54. [R4ospf-1area-0.0.0.0]quit
  55. <Huawei>undo terminal monitor
  56. <Huawei>systemview
  57. [Huawei]sysname R5
  58. [R5]interface GigabitEthernet 0/0/1
  59. [R5GigabitEthernet0/0/1]ip add 192.168.45.5 24
  60. [R5GigabitEthernet0/0/1]quit
  61. [R5]interface GigabitEthernet 0/0/0
  62. [R5GigabitEthernet0/0/0]ip add 192.168.56.5 24
  63. [R5GigabitEthernet0/0/0]quit
  64. [R5]ospf 1 routerid 5.5.5.5
  65. [R5ospf-1]area 56
  66. [R5ospf-1area-0.0.0.56]network 192.168.56.0 0.0.0.255
  67. [R5ospf-1area-0.0.0.56]quit
  68. [R5ospf-1]area 0
  69. [R5ospf-1area-0.0.0.0]network 192.168.45.0 0.0.0.255
  70. [R5ospf-1area-0.0.0.0]quit
  71. <Huawei>undo terminal monitor
  72. <Huawei>systemview
  73. [Huawei]sysname R6
  74. [R6]interface GigabitEthernet 0/0/1
  75. [R6GigabitEthernet0/0/1]ip add 192.168.56.6 24
  76. [R6GigabitEthernet0/0/1]quit
  77. [R6]ospf 1 routerid 6.6.6.6
  78. [R6ospf-1]area 56
  79. [R6ospf-1area-0.0.0.56]network 192.168.56.0 0.0.0.255
  80. [R6ospf-1area-0.0.0.56]quit

2)查看 R1 的 OSPF 数据库

  1. [R1]display ospf lsdb
  2.      OSPF Process 1 with Router ID 1.1.1.1
  3.          Link State Database
  4.          Area: 0.0.0.12
  5. Type LinkState ID AdvRouter Age Len Sequence Metric
  6. Router 2.2.2.2 2.2.2.2 78 36 80000005 1
  7. Router 1.1.1.1 1.1.1.1 78 36 80000004 1
  8. Network 192.168.12.2 2.2.2.2 79 32 80000002 0
  9. SumNet 192.168.45.0 2.2.2.2 71 28 80000001 3
  10. SumNet 192.168.23.0 2.2.2.2 116 28 80000001 1
  11. SumNet 192.168.56.0 2.2.2.2 36 28 80000001 4
  12. SumNet 192.168.34.0 2.2.2.2 71 28 80000001 2

3)查看 R2(ABR)的数据库

  1. [R2]display ospf lsdb
  2.      OSPF Process 1 with Router ID 2.2.2.2
  3.          Link State Database
  4.          Area: 0.0.0.0
  5. Type LinkState ID AdvRouter Age Len Sequence Metric
  6. Router 4.4.4.4 4.4.4.4 88 48 80000007 1
  7. Router 2.2.2.2 2.2.2.2 122 36 80000004 1
  8. Router 5.5.5.5 5.5.5.5 87 36 80000004 1
  9. Router 3.3.3.3 3.3.3.3 120 48 80000006 1
  10. Network 192.168.23.3 3.3.3.3 120 32 80000002 0
  11. Network 192.168.34.3 3.3.3.3 124 32 80000002 0
  12. Network 192.168.45.5 5.5.5.5 87 32 80000002 0
  13. SumNet 192.168.56.0 5.5.5.5 126 28 80000001 1
  14. SumNet 192.168.12.0 2.2.2.2 167 28 80000001 1
  15.          Area: 0.0.0.12
  16. Type LinkState ID AdvRouter Age Len Sequence Metric
  17. Router 2.2.2.2 2.2.2.2 129 36 80000005 1
  18. Router 1.1.1.1 1.1.1.1 131 36 80000004 1
  19. Network 192.168.12.2 2.2.2.2 130 32 80000002 0
  20. SumNet 192.168.45.0 2.2.2.2 121 28 80000001 3
  21. SumNet 192.168.23.0 2.2.2.2 167 28 80000001 1
  22. SumNet 192.168.56.0 2.2.2.2 86 28 80000001 4
  23. SumNet 192.168.34.0 2.2.2.2 121 28 80000001 2

4)查看R3(骨干区域设备)的OSPF数据库

  1. [R3]display ospf lsdb
  2.      OSPF Process 1 with Router ID 3.3.3.3
  3.          Link State Database
  4.          Area: 0.0.0.0
  5. Type LinkState ID AdvRouter Age Len Sequence Metric
  6. Router 4.4.4.4 4.4.4.4 140 48 80000007 1
  7. Router 2.2.2.2 2.2.2.2 175 36 80000004 1
  8. Router 5.5.5.5 5.5.5.5 139 36 80000004 1
  9. Router 3.3.3.3 3.3.3.3 172 48 80000006 1
  10. Network 192.168.23.3 3.3.3.3 172 32 80000002 0
  11. Network 192.168.34.3 3.3.3.3 175 32 80000002 0
  12. Network 192.168.45.5 5.5.5.5 139 32 80000002 0
  13. SumNet 192.168.56.0 5.5.5.5 178 28 80000001 1
  14. SumNet 192.168.12.0 2.2.2.2 220 28 80000001 1

2 案例:熟悉1/2类LSA数据库

2.1 问题

  1. 如图配置 IP 和OSPF
  2. 配置区域12为点到点网络
  3. 分析区域12中的1类LSA
  4. 分析区域56中的1类和2类LSA

2.2 方案

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

OSPF数据库概述 、 4/5类LSA介绍 、 特殊区域之stub 、 OSFP路由引入 、 3类LSA介绍 、 1/2 类LSA介绍图-2

2.3 步骤

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

1)配置IP地址,设置OSPF区域

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname R1
  4. [R1]interface GigabitEthernet 0/0/0
  5. [R1GigabitEthernet0/0/0]ip add 192.168.12.1 24
  6. [R1GigabitEthernet0/0/0]quit
  7. [R1]ospf 1 routerid 1.1.1.1
  8. [R1ospf-1]area 12
  9. [R1ospf-1area-0.0.0.12]network 192.168.12.0 0.0.0.255
  10. [R1ospf-1area-0.0.0.12]quit
  11. <Huawei>undo terminal monitor
  12. <Huawei>systemview
  13. [Huawei]sysname R2
  14. [R2]interface GigabitEthernet 0/0/1
  15. [R2GigabitEthernet0/0/1]ip add 192.168.12.2 24
  16. [R2GigabitEthernet0/0/1]quit
  17. [R2]interface GigabitEthernet 0/0/0
  18. [R2GigabitEthernet0/0/0]ip add 192.168.23.2 24
  19. [R2GigabitEthernet0/0/0]quit
  20. [R2]ospf 1 routerid 2.2.2.2
  21. [R2ospf-1]area 12
  22. [R2ospf-1area-0.0.0.12]network 192.168.12.0 0.0.0.255
  23. [R2ospf-1area-0.0.0.12]quit
  24. [R2ospf-1]area 0
  25. [R2ospf-1area-0.0.0.0]network 192.168.23.0 0.0.0.255
  26. [R2ospf-1area-0.0.0.0]quit
  27. <Huawei>undo terminal monitor
  28. <Huawei>systemview
  29. [Huawei]sysname R3
  30. [R3]interface GigabitEthernet 0/0/1
  31. [R3GigabitEthernet0/0/1]ip add 192.168.23.3 24
  32. [R3GigabitEthernet0/0/1]quit
  33. [R3]interface GigabitEthernet 0/0/0
  34. [R3GigabitEthernet0/0/0]ip add 192.168.34.3 24
  35. [R3GigabitEthernet0/0/0]quit
  36. [R3]ospf 1 routerid 3.3.3.3
  37. [R3ospf-1]area 0
  38. [R3ospf-1area-0.0.0.0]network 192.168.23.0 0.0.0.255
  39. [R3ospf-1area-0.0.0.0]network 192.168.34.0 0.0.0.255
  40. [R3ospf-1area-0.0.0.0]quit
  41. <Huawei>undo terminal monitor
  42. <Huawei>systemview
  43. [Huawei]sysname R4
  44. [R4]interface GigabitEthernet 0/0/1
  45. [R4GigabitEthernet0/0/1]ip add 192.168.34.4 24
  46. [R4GigabitEthernet0/0/1]quit
  47. [R4]interface GigabitEthernet 0/0/0
  48. [R4GigabitEthernet0/0/0]ip add 192.168.45.4 24
  49. [R4GigabitEthernet0/0/0]quit
  50. [R4]ospf 1 routerid 4.4.4.4
  51. [R4ospf-1]area 0
  52. [R4ospf-1area-0.0.0.0]network 192.168.45.0 0.0.0.255
  53. [R4ospf-1area-0.0.0.0]network 192.168.34.0 0.0.0.255
  54. [R4ospf-1area-0.0.0.0]quit
  55. <Huawei>undo terminal monitor
  56. <Huawei>systemview
  57. [Huawei]sysname R5
  58. [R5]interface GigabitEthernet 0/0/1
  59. [R5GigabitEthernet0/0/1]ip add 192.168.45.5 24
  60. [R5GigabitEthernet0/0/1]quit
  61. [R5]interface GigabitEthernet 0/0/0
  62. [R5GigabitEthernet0/0/0]ip add 192.168.56.5 24
  63. [R5GigabitEthernet0/0/0]quit
  64. [R5]ospf 1 routerid 5.5.5.5
  65. [R5ospf-1]area 56
  66. [R5ospf-1area-0.0.0.56]network 192.168.56.0 0.0.0.255
  67. [R5ospf-1area-0.0.0.56]quit
  68. [R5ospf-1]area 0
  69. [R5ospf-1area-0.0.0.0]network 192.168.45.0 0.0.0.255
  70. [R5ospf-1area-0.0.0.0]quit
  71. <Huawei>undo terminal monitor
  72. <Huawei>systemview
  73. [Huawei]sysname R6
  74. [R6]interface GigabitEthernet 0/0/1
  75. [R6GigabitEthernet0/0/1]ip add 192.168.56.6 24
  76. [R6GigabitEthernet0/0/1]quit
  77. [R6]ospf 1 routerid 6.6.6.6
  78. [R6ospf-1]area 56
  79. [R6ospf-1area-0.0.0.56]network 192.168.56.0 0.0.0.255
  80. [R6ospf-1area-0.0.0.56]quit

2)修改区域12的网络为点到点网络

  1. [R1]interface GigabitEthernet 0/0/0
  2. [R1GigabitEthernet0/0/0]ospf networktype p2p
  3. [R2]interface GigabitEthernet 0/0/1
  4. [R2GigabitEthernet0/0/1]ospf networktype p2p

3)查看 区域12 中的1类LSA

  1. [R1]display ospf lsdb router 1.1.1.1
  2.      OSPF Process 1 with Router ID 1.1.1.1
  3.          Area: 0.0.0.12
  4.          Link State Database
  5. Type : Router
  6. Ls id : 1.1.1.1
  7. Adv rtr : 1.1.1.1
  8. Ls age : 10
  9. Len : 48
  10. Options : E
  11. seq# : 80000008
  12. chksum : 0x89b6
  13. Link count: 2
  14. * Link ID: 2.2.2.2
  15. Data : 192.168.12.1
  16. Link Type: P-2P
  17. Metric : 1
  18. * Link ID: 192.168.12.0
  19. Data : 255.255.255.0
  20. Link Type: StubNet
  21. Metric : 1
  22. Priority : Low
  23. [R1]display ospf lsdb router 2.2.2.2
  24.      OSPF Process 1 with Router ID 1.1.1.1
  25.          Area: 0.0.0.12
  26.          Link State Database
  27. Type : Router
  28. Ls id : 2.2.2.2
  29. Adv rtr : 2.2.2.2
  30. Ls age : 48
  31. Len : 48
  32. Options : ABR E
  33. seq# : 8000000b
  34. chksum : 0x2611
  35. Link count: 2
  36. * Link ID: 1.1.1.1
  37. Data : 192.168.12.2
  38. Link Type: P-2P
  39. Metric : 1
  40. * Link ID: 192.168.12.0
  41. Data : 255.255.255.0
  42. Link Type: StubNet
  43. Metric : 1
  44. Priority : Low

4)查看区域56中的1类LSA和2类LSA

  1. <R6>display ospf lsdb router 5.5.5.5
  2.      OSPF Process 1 with Router ID 6.6.6.6
  3.          Area: 0.0.0.56
  4.          Link State Database
  5. Type : Router
  6. Ls id : 5.5.5.5
  7. Adv rtr : 5.5.5.5
  8. Ls age : 516
  9. Len : 36
  10. Options : ABR E
  11. seq# : 80000006
  12. chksum : 0x5186
  13. Link count: 1
  14. * Link ID: 192.168.56.5
  15. Data : 192.168.56.5
  16. Link Type: TransNet
  17. Metric : 1
  18. <R6>display ospf lsdb router 6.6.6.6
  19.      OSPF Process 1 with Router ID 6.6.6.6
  20.          Area: 0.0.0.56
  21.          Link State Database
  22. Type : Router
  23. Ls id : 6.6.6.6
  24. Adv rtr : 6.6.6.6
  25. Ls age : 540
  26. Len : 36
  27. Options : E
  28. seq# : 80000003
  29. chksum : 0x16bc
  30. Link count: 1
  31. * Link ID: 192.168.56.5
  32. Data : 192.168.56.6
  33. Link Type: TransNet
  34. Metric : 1
  35. <R6>display ospf lsdb network 192.168.56.5
  36.      OSPF Process 1 with Router ID 6.6.6.6
  37.          Area: 0.0.0.56
  38.          Link State Database
  39. Type : Network
  40. Ls id : 192.168.56.5
  41. Adv rtr : 5.5.5.5
  42. Ls age : 559
  43. Len : 32
  44. Options : E
  45. seq# : 80000002
  46. chksum : 0x72ff
  47. Net mask : 255.255.255.0
  48. Priority : Low
  49. Attached Router 5.5.5.5
  50. Attached Router 6.6.6.6

3 案例:熟悉3类LSA数据库

3.1 问题

  1. 如图配置 IP 和OSPF
  2. 分析区域0和 区域56中的3类LSA
  3. 熟悉基于LSA计算路由的过程

3.2 方案

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

OSPF数据库概述 、 4/5类LSA介绍 、 特殊区域之stub 、 OSFP路由引入 、 3类LSA介绍 、 1/2 类LSA介绍图-3

3.3 步骤

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

1)配置IP地址,设置OSPF区域

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname R1
  4. [R1]interface GigabitEthernet 0/0/0
  5. [R1GigabitEthernet0/0/0]ip add 192.168.12.1 24
  6. [R1GigabitEthernet0/0/0]quit
  7. [R1]ospf 1 routerid 1.1.1.1
  8. [R1ospf-1]area 12
  9. [R1ospf-1area-0.0.0.12]network 192.168.12.0 0.0.0.255
  10. [R1ospf-1area-0.0.0.12]quit
  11. <Huawei>undo terminal monitor
  12. <Huawei>systemview
  13. [Huawei]sysname R2
  14. [R2]interface GigabitEthernet 0/0/1
  15. [R2GigabitEthernet0/0/1]ip add 192.168.12.2 24
  16. [R2GigabitEthernet0/0/1]quit
  17. [R2]interface GigabitEthernet 0/0/0
  18. [R2GigabitEthernet0/0/0]ip add 192.168.23.2 24
  19. [R2GigabitEthernet0/0/0]quit
  20. [R2]ospf 1 routerid 2.2.2.2
  21. [R2ospf-1]area 12
  22. [R2ospf-1area-0.0.0.12]network 192.168.12.0 0.0.0.255
  23. [R2ospf-1area-0.0.0.12]quit
  24. [R2ospf-1]area 0
  25. [R2ospf-1area-0.0.0.0]network 192.168.23.0 0.0.0.255
  26. [R2ospf-1area-0.0.0.0]quit
  27. <Huawei>undo terminal monitor
  28. <Huawei>systemview
  29. [Huawei]sysname R3
  30. [R3]interface GigabitEthernet 0/0/1
  31. [R3GigabitEthernet0/0/1]ip add 192.168.23.3 24
  32. [R3GigabitEthernet0/0/1]quit
  33. [R3]interface GigabitEthernet 0/0/0
  34. [R3GigabitEthernet0/0/0]ip add 192.168.34.3 24
  35. [R3GigabitEthernet0/0/0]quit
  36. [R3]ospf 1 routerid 3.3.3.3
  37. [R3ospf-1]area 0
  38. [R3ospf-1area-0.0.0.0]network 192.168.23.0 0.0.0.255
  39. [R3ospf-1area-0.0.0.0]network 192.168.34.0 0.0.0.255
  40. [R3ospf-1area-0.0.0.0]quit
  41. <Huawei>undo terminal monitor
  42. <Huawei>systemview
  43. [Huawei]sysname R4
  44. [R4]interface GigabitEthernet 0/0/1
  45. [R4GigabitEthernet0/0/1]ip add 192.168.34.4 24
  46. [R4GigabitEthernet0/0/1]quit
  47. [R4]interface GigabitEthernet 0/0/0
  48. [R4GigabitEthernet0/0/0]ip add 192.168.45.4 24
  49. [R4GigabitEthernet0/0/0]quit
  50. [R4]ospf 1 routerid 4.4.4.4
  51. [R4ospf-1]area 0
  52. [R4ospf-1area-0.0.0.0]network 192.168.45.0 0.0.0.255
  53. [R4ospf-1area-0.0.0.0]network 192.168.34.0 0.0.0.255
  54. [R4ospf-1area-0.0.0.0]quit
  55. <Huawei>undo terminal monitor
  56. <Huawei>systemview
  57. [Huawei]sysname R5
  58. [R5]interface GigabitEthernet 0/0/1
  59. [R5GigabitEthernet0/0/1]ip add 192.168.45.5 24
  60. [R5GigabitEthernet0/0/1]quit
  61. [R5]interface GigabitEthernet 0/0/0
  62. [R5GigabitEthernet0/0/0]ip add 192.168.56.5 24
  63. [R5GigabitEthernet0/0/0]quit
  64. [R5]ospf 1 routerid 5.5.5.5
  65. [R5ospf-1]area 56
  66. [R5ospf-1area-0.0.0.56]network 192.168.56.0 0.0.0.255
  67. [R5ospf-1area-0.0.0.56]quit
  68. [R5ospf-1]area 0
  69. [R5ospf-1area-0.0.0.0]network 192.168.45.0 0.0.0.255
  70. [R5ospf-1area-0.0.0.0]quit
  71. <Huawei>undo terminal monitor
  72. <Huawei>systemview
  73. [Huawei]sysname R6
  74. [R6]interface GigabitEthernet 0/0/1
  75. [R6GigabitEthernet0/0/1]ip add 192.168.56.6 24
  76. [R6GigabitEthernet0/0/1]quit
  77. [R6]ospf 1 routerid 6.6.6.6
  78. [R6ospf-1]area 56
  79. [R6ospf-1area-0.0.0.56]network 192.168.56.0 0.0.0.255
  80. [R6ospf-1area-0.0.0.56]quit

2)查看区域0中R3的LSDB以及3类LSA

  1. <R3>display ospf lsdb
  2.      OSPF Process 1 with Router ID 3.3.3.3
  3.          Link State Database
  4.          Area: 0.0.0.0
  5. Type LinkState ID AdvRouter Age Len Sequence Metric
  6. Router 4.4.4.4 4.4.4.4 773 48 80000007 1
  7. Router 2.2.2.2 2.2.2.2 808 36 80000004 1
  8. Router 5.5.5.5 5.5.5.5 772 36 80000004 1
  9. Router 3.3.3.3 3.3.3.3 805 48 80000006 1
  10. Network 192.168.23.3 3.3.3.3 805 32 80000002 0
  11. Network 192.168.34.3 3.3.3.3 808 32 80000002 0
  12. Network 192.168.45.5 5.5.5.5 772 32 80000002 0
  13. SumNet 192.168.56.0 5.5.5.5 811 28 80000001 1
  14. SumNet 192.168.12.0 2.2.2.2 853 28 80000001 1
  15. <R3>display ospf lsdb summary 192.168.12.0
  16.      OSPF Process 1 with Router ID 3.3.3.3
  17.          Area: 0.0.0.0
  18.          Link State Database
  19. Type : SumNet
  20. Ls id : 192.168.12.0
  21. Adv rtr : 2.2.2.2
  22. Ls age : 915
  23. Len : 28
  24. Options : E
  25. seq# : 80000001
  26. chksum : 0x3db
  27. Net mask : 255.255.255.0
  28. Tos 0 metric: 1
  29. Priority : Low

3)查看区域56中的R6的LSDB 以及3类LSA

  1. <R6>display ospf lsdb
  2.      OSPF Process 1 with Router ID 6.6.6.6
  3.          Link State Database
  4.          Area: 0.0.0.56
  5. Type LinkState ID AdvRouter Age Len Sequence Metric
  6. Router 6.6.6.6 6.6.6.6 913 36 80000003 1
  7. Router 5.5.5.5 5.5.5.5 909 36 80000006 1
  8. Network 192.168.56.5 5.5.5.5 909 32 80000002 0
  9. SumNet 192.168.45.0 5.5.5.5 960 28 80000001 1
  10. SumNet 192.168.23.0 5.5.5.5 923 28 80000001 3
  11. SumNet 192.168.34.0 5.5.5.5 923 28 80000001 2
  12. SumNet 192.168.12.0 5.5.5.5 923 28 80000001 4
  13. <R6>display ospf lsdb summary 192.168.12.0
  14.      OSPF Process 1 with Router ID 6.6.6.6
  15.          Area: 0.0.0.56
  16.          Link State Database
  17. Type : SumNet
  18. Ls id : 192.168.12.0
  19. Adv rtr : 5.5.5.5
  20. Ls age : 955
  21. Len : 28
  22. Options : E
  23. seq# : 80000001
  24. chksum : 0xc609
  25. Net mask : 255.255.255.0
  26. Tos 0 metric: 4
  27. Priority : Low

4 案例:熟悉4/5类LSA

4.1 问题

  1. 如图配置 IP 和 OSPF
  2. R6配置静态路由,访问 PC-3
  3. 确保PC-1和PC-2可以访问PC-3
  4. 分类5类LSA,熟悉路由计算过程

4.2 方案

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

OSPF数据库概述 、 4/5类LSA介绍 、 特殊区域之stub 、 OSFP路由引入 、 3类LSA介绍 、 1/2 类LSA介绍图-4

4.3 步骤

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

1)配置IP地址,设置OSPF区域

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname R1
  4. [R1]interface GigabitEthernet 0/0/0
  5. [R1GigabitEthernet0/0/0]ip add 192.168.12.1 24
  6. [R1GigabitEthernet0/0/0]quit
  7. [R1]interface GigabitEthernet 0/0/2
  8. [R1GigabitEthernet0/0/2]ip add 192.168.1.254 24
  9. [R1GigabitEthernet0/0/2]quit
  10. [R1]ospf 1 routerid 1.1.1.1
  11. [R1ospf-1]area 12
  12. [R1ospf-1area-0.0.0.12]network 192.168.12.0 0.0.0.255
  13. [R1ospf-1area-0.0.0.12]network 192.168.1.0 0.0.0.255
  14. [R1ospf-1area-0.0.0.12]quit
  15. <Huawei>undo terminal monitor
  16. <Huawei>systemview
  17. [Huawei]sysname R2
  18. [R2]interface GigabitEthernet 0/0/1
  19. [R2GigabitEthernet0/0/1]ip add 192.168.12.2 24
  20. [R2GigabitEthernet0/0/1]quit
  21. [R2]interface GigabitEthernet 0/0/0
  22. [R2GigabitEthernet0/0/0]ip add 192.168.23.2 24
  23. [R2GigabitEthernet0/0/0]quit
  24. [R2]ospf 1 routerid 2.2.2.2
  25. [R2ospf-1]area 12
  26. [R2ospf-1area-0.0.0.12]network 192.168.12.0 0.0.0.255
  27. [R2ospf-1area-0.0.0.12]quit
  28. [R2ospf-1]area 0
  29. [R2ospf-1area-0.0.0.0]network 192.168.23.0 0.0.0.255
  30. [R2ospf-1area-0.0.0.0]quit
  31. <Huawei>undo terminal monitor
  32. <Huawei>systemview
  33. [Huawei]sysname R3
  34. [R3]interface GigabitEthernet 0/0/1
  35. [R3GigabitEthernet0/0/1]ip add 192.168.23.3 24
  36. [R3GigabitEthernet0/0/1]quit
  37. [R3]interface GigabitEthernet 0/0/0
  38. [R3GigabitEthernet0/0/0]ip add 192.168.34.3 24
  39. [R3GigabitEthernet0/0/0]quit
  40. [R3]ospf 1 routerid 3.3.3.3
  41. [R3ospf-1]area 0
  42. [R3ospf-1area-0.0.0.0]network 192.168.23.0 0.0.0.255
  43. [R3ospf-1area-0.0.0.0]network 192.168.34.0 0.0.0.255
  44. [R3ospf-1area-0.0.0.0]quit
  45. <Huawei>undo terminal monitor
  46. <Huawei>systemview
  47. [Huawei]sysname R4
  48. [R4]interface GigabitEthernet 0/0/1
  49. [R4GigabitEthernet0/0/1]ip add 192.168.34.4 24
  50. [R4GigabitEthernet0/0/1]quit
  51. [R4]interface GigabitEthernet 0/0/0
  52. [R4GigabitEthernet0/0/0]ip add 192.168.45.4 24
  53. [R4GigabitEthernet0/0/0]quit
  54. [R4]ospf 1 routerid 4.4.4.4
  55. [R4ospf-1]area 0
  56. [R4ospf-1area-0.0.0.0]network 192.168.45.0 0.0.0.255
  57. [R4ospf-1area-0.0.0.0]network 192.168.34.0 0.0.0.255
  58. [R4ospf-1area-0.0.0.0]quit
  59. <Huawei>undo terminal monitor
  60. <Huawei>systemview
  61. [Huawei]sysname R5
  62. [R5]interface GigabitEthernet 0/0/1
  63. [R5GigabitEthernet0/0/1]ip add 192.168.45.5 24
  64. [R5GigabitEthernet0/0/1]quit
  65. [R5]interface GigabitEthernet 0/0/0
  66. [R5GigabitEthernet0/0/0]ip add 192.168.56.5 24
  67. [R5GigabitEthernet0/0/0]quit
  68. [R5]ospf 1 routerid 5.5.5.5
  69. [R5ospf-1]area 56
  70. [R5ospf-1area-0.0.0.56]network 192.168.56.0 0.0.0.255
  71. [R5ospf-1area-0.0.0.56]quit
  72. [R5ospf-1]area 0
  73. [R5ospf-1area-0.0.0.0]network 192.168.45.0 0.0.0.255
  74. [R5ospf-1area-0.0.0.0]quit
  75. <Huawei>undo terminal monitor
  76. <Huawei>systemview
  77. [Huawei]sysname R6
  78. [R6]interface GigabitEthernet 0/0/0
  79. [R6GigabitEthernet0/0/0]ip add 192.168.67.6 24
  80. [R6GigabitEthernet0/0/0]quit
  81. [R6]interface GigabitEthernet 0/0/1
  82. [R6GigabitEthernet0/0/1]ip add 192.168.56.6 24
  83. [R6GigabitEthernet0/0/1]quit
  84. [R6]interface GigabitEthernet 0/0/2
  85. [R6GigabitEthernet0/0/2]ip add 192.168.2.254 24
  86. [R6GigabitEthernet0/0/2]quit
  87. [R6]ospf 1 routerid 6.6.6.6
  88. [R6ospf-1]area 56
  89. [R6ospf-1area-0.0.0.56]network 192.168.56.0 0.0.0.255
  90. [R6ospf-1area-0.0.0.56]network 192.168.2.0 0.0.0.255
  91. [R6ospf-1area-0.0.0.56]quit
  92. <Huawei>undo terminal monitor
  93. <Huawei>systemview
  94. [Huawei]sysname R7
  95. [R7]interface GigabitEthernet 0/0/1
  96. [R7GigabitEthernet0/0/0]ip add 192.168.67.7 24
  97. [R7GigabitEthernet0/0/0]quit
  98. [R7]interface GigabitEthernet 0/0/2
  99. [R7GigabitEthernet0/0/2]ip add 192.168.3.254 24
  100. [R7GigabitEthernet0/0/2]quit
  101. [R7]ip routestatic 192.168.0.0 16 192.168.67.6

2)配置 R6 与 R7 之间的互通路由,并引入 OSPF

  1. [R6]ip routestatic 192.168.3.0 24 192.168.67.7
  2. [R6]ospf 1
  3. [R6ospf-1]importroute static

3)查看 R1 的 OSPF 数据库,确认 192.168.3.0/24 的路由信息

  1. <R1>display ospf lsdb
  2.      OSPF Process 1 with Router ID 1.1.1.1
  3.          Link State Database
  4.          Area: 0.0.0.12
  5. Type LinkState ID AdvRouter Age Len Sequence Metric
  6. Router 2.2.2.2 2.2.2.2 1353 48 8000000B 1
  7. Router 1.1.1.1 1.1.1.1 1352 48 80000008 1
  8. SumNet 192.168.45.0 2.2.2.2 1800 28 80000001 3
  9. SumNet 192.168.23.0 2.2.2.2 46 28 80000002 1
  10. SumNet 192.168.56.0 2.2.2.2 1765 28 80000001 4
  11. SumNet 192.168.34.0 2.2.2.2 1800 28 80000001 2
  12. SumAsbr 6.6.6.6 2.2.2.2 5 28 80000001 4
  13.          AS External Database
  14. Type LinkState ID AdvRouter Age Len Sequence Metric
  15. External 192.168.3.0 6.6.6.6 9 36 80000001 1

4)查看表示 192.168.3.0/24 的 5类LSA

  1. <R1>display ospf lsdb ase 192.168.3.0
  2.      OSPF Process 1 with Router ID 1.1.1.1
  3.          Link State Database
  4. Type : External
  5. Ls id : 192.168.3.0
  6. Adv rtr : 6.6.6.6
  7. Ls age : 26
  8. Len : 36
  9. Options : E
  10. seq# : 80000001
  11. chksum : 0x77d4
  12. Net mask : 255.255.255.0
  13. TOS 0 Metric: 1
  14. E type : 2
  15. Forwarding Address : 0.0.0.0
  16. Tag : 1
  17. Priority : Low

4)查看表示 ASBR 信息的4类LSA

  1. <R1>display ospf lsdb asbr 6.6.6.6
  2.      OSPF Process 1 with Router ID 1.1.1.1
  3.          Area: 0.0.0.12
  4.          Link State Database
  5. Type : SumAsbr
  6. Ls id : 6.6.6.6
  7. Adv rtr : 2.2.2.2
  8. Ls age : 63
  9. Len : 28
  10. Options : E
  11. seq# : 80000001
  12. chksum : 0x3404
  13. Tos 0 metric: 4

5)确保PC-1/2 与 PC3之间的互通

  1. PC-1>ping 192.168.3.1
  2. Ping 192.168.3.1: 32 data bytes, Press Ctrl_C to break
  3. From 192.168.3.1: bytes=32 seq=1 ttl=125 time=31 ms
  4. From 192.168.3.1: bytes=32 seq=2 ttl=125 time=31 ms
  5. From 192.168.3.1: bytes=32 seq=3 ttl=125 time=16 ms
  6. From 192.168.3.1: bytes=32 seq=4 ttl=125 time=16 ms
  7. From 192.168.3.1: bytes=32 seq=5 ttl=125 time=31 ms
  8. 192.168.3.1 ping statistics
  9. 5 packet(s) transmitted
  10. PC-2>ping 192.168.3.1
  11. Ping 192.168.3.1: 32 data bytes, Press Ctrl_C to break
  12. From 192.168.3.1: bytes=32 seq=1 ttl=125 time=31 ms
  13. From 192.168.3.1: bytes=32 seq=2 ttl=125 time=31 ms
  14. From 192.168.3.1: bytes=32 seq=3 ttl=125 time=16 ms
  15. From 192.168.3.1: bytes=32 seq=4 ttl=125 time=16 ms
  16. From 192.168.3.1: bytes=32 seq=5 ttl=125 time=31 ms
  17. 192.168.3.1 ping statistics
  18. 5 packet(s) transmitted

5 案例:OSPF路由选路

5.1 问题

  1. 如图配置 VLAN、IP和OSPF
  2. R1/R2配置静态路由,访问PC-2
  3. 确保 PC-1与PC-2可以互相访问
  4. PC-1的网关配置在 SW1 上
  5. R1是主出口设备,R2是备份出口设备
  6. 要求数据转发是最优路径

5.2 方案

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

OSPF数据库概述 、 4/5类LSA介绍 、 特殊区域之stub 、 OSFP路由引入 、 3类LSA介绍 、 1/2 类LSA介绍图-5

5.3 步骤

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

1)配置终端设备

  1. PC-1
  2. 192.168.6.1
  3. 255.255.255.0
  4. 192.168.6.254
  5. PC-2
  6. 192.168.2.1
  7. 255.255.255.0
  8. 192.168.2.254

2)配置交换机

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname SW1
  4. [SW1]vlan batch 6 10 20
  5. [SW1]interface GigabitEthernet 0/0/1
  6. [SW1GigabitEthernet0/0/1]port linktype access
  7. [SW1GigabitEthernet0/0/1]port default vlan 10
  8. [SW1GigabitEthernet0/0/1]quit
  9. [SW1]interface GigabitEthernet 0/0/2
  10. [SW1GigabitEthernet0/0/2]port linktype access
  11. [SW1GigabitEthernet0/0/2]port default vlan 20
  12. [SW1GigabitEthernet0/0/2]quit
  13. [SW1]interface GigabitEthernet 0/0/3
  14. [SW1GigabitEthernet0/0/3]port linktype access
  15. [SW1GigabitEthernet0/0/3]port default vlan 6
  16. [SW1GigabitEthernet0/0/3]quit
  17. [SW1]interface Vlanif 6
  18. [SW1Vlanif6]ip address 192.168.6.254 24
  19. [SW1Vlanif6]quit
  20. [SW1]interface Vlanif 10
  21. [SW1Vlanif10]ip address 192.168.10.1 24
  22. [SW1Vlanif10]quit
  23. [SW1]interface Vlanif 20
  24. [SW1Vlanif20]ip address 192.168.20.1 24
  25. [SW1Vlanif20]quit

3)配置路由器

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname R1
  4. [R1]interface gi0/0/0
  5. [R1GigabitEthernet0/0/0]ip address 192.168.10.2 24
  6. [R1GigabitEthernet0/0/0]quit
  7. [R1]interface gi0/0/1
  8. [R1GigabitEthernet0/0/1]ip address 192.168.13.1 24
  9. [R1GigabitEthernet0/0/1]quit
  10. [R1]ip routestatic 0.0.0.0 0 192.168.13.3
  11. <Huawei>undo terminal monitor
  12. <Huawei>systemview
  13. [Huawei]sysname R2
  14. [R2]interface gi0/0/0
  15. [R2GigabitEthernet0/0/0]ip address 192.168.20.2 24
  16. [R2GigabitEthernet0/0/0]quit
  17. [R2]interface gi0/0/2
  18. [R2GigabitEthernet0/0/2]ip address 192.168.23.2 24
  19. [R2GigabitEthernet0/0/2]quit
  20. [R2]ip routestatic 0.0.0.0 0 192.168.23.3
  21. <Huawei>undo terminal monitor
  22. <Huawei>systemview
  23. [Huawei]sysname R3
  24. [R3]interface GigabitEthernet 0/0/1
  25. [R3GigabitEthernet0/0/1]ip address 192.168.13.3 24
  26. [R3GigabitEthernet0/0/1]quit
  27. [R3]interface GigabitEthernet 0/0/2
  28. [R3GigabitEthernet0/0/2]ip address 192.168.23.3 24
  29. [R3GigabitEthernet0/0/2]quit
  30. [R3]interface gi0/0/0
  31. [R3GigabitEthernet0/0/0]ip address 192.168.2.254 24
  32. [R3GigabitEthernet0/0/0]quit

4)配置基本的OSPF

  1. [SW1]ospf 1 routerid 6.6.6.6
  2. [SW1ospf-1]area 0
  3. [SW1ospf-1area-0.0.0.0]network 192.168.6.0 0.0.0.255
  4. [SW1ospf-1area-0.0.0.0]network 192.168.10.0 0.0.0.255
  5. [SW1ospf-1area-0.0.0.0]network 192.168.20.0 0.0.0.255
  6. [SW1ospf-1area-0.0.0.0]quit
  7. [R1]ospf 1 routerid 1.1.1.1
  8. [R1ospf-1]area 0
  9. [R1ospf-1area-0.0.0.0]network 192.168.10.0 0.0.0.255
  10. [R1ospf-1area-0.0.0.0]quit
  11. [R2]ospf 1 routerid 2.2.2.2
  12. [R2ospf-1]area 0
  13. [R2ospf-1area-0.0.0.0]network 192.168.20.0 0.0.0.255
  14. [R2ospf-1area-0.0.0.0]quit

5)配置OSPF默认路由

  1. [R1]ospf 1
  2. [R1ospf-1]defaultrouteadvertise
  3. [R2]ospf 1
  4. [R2ospf-1]defaultrouteadvertise cost 2

6)配置浮动静态路由

  1. [R3]ip routestatic 192.168.6.0 24 192.168.13.1
  2. [R3]ip routestatic 192.168.6.0 24 192.168.23.2 preference 100

7)测试 PC-1和 PC-2 之间的连通性

  1. PC-1>ping 192.168.2.1
  2. Ping 192.168.2.1: 32 data bytes, Press Ctrl_C to break
  3. From 192.168.2.1: bytes=32 seq=1 ttl=125 time=47 ms
  4. From 192.168.2.1: bytes=32 seq=2 ttl=125 time=47 ms
  5. From 192.168.2.1: bytes=32 seq=3 ttl=125 time=32 ms
  6. From 192.168.2.1: bytes=32 seq=4 ttl=125 time=31 ms
  7. From 192.168.2.1: bytes=32 seq=5 ttl=125 time=47 ms
  8. 192.168.2.1 ping statistics
  9. 5 packet(s) transmitted
  10. 5 packet(s) received
  11. 0.00% packet loss
  12. roundtrip min/avg/max = 31/40/47 ms
  13. PC-2>ping 192.168.6.1
  14. Ping 192.168.6.1: 32 data bytes, Press Ctrl_C to break
  15. From 192.168.6.1: bytes=32 seq=1 ttl=125 time=47 ms
  16. From 192.168.6.1: bytes=32 seq=2 ttl=125 time=31 ms
  17. From 192.168.6.1: bytes=32 seq=3 ttl=125 time=62 ms
  18. From 192.168.6.1: bytes=32 seq=4 ttl=125 time=63 ms
  19. From 192.168.6.1: bytes=32 seq=5 ttl=125 time=62 ms
  20. 192.168.6.1 ping statistics
  21. 5 packet(s) transmitted
  22. 5 packet(s) received
  23. 0.00% packet loss
  24. roundtrip min/avg/max = 31/53/63 ms

6 案例:配置 OSPF 特殊区域

6.1 问题

  1. 如图,配置设备 IP 地址和 OSPF 区域
  2. R6 与 R7 之间不运行 OSPF,通过静态路由互通
  3. 区域 12 没有外部路由
  4. 确保 PC-1 与 PC-3 可以互通

6.2 方案

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

OSPF数据库概述 、 4/5类LSA介绍 、 特殊区域之stub 、 OSFP路由引入 、 3类LSA介绍 、 1/2 类LSA介绍图-6

6.3 步骤

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

1)配置IP地址,设置OSPF区域

  1. <Huawei>undo terminal monitor
  2. <Huawei>systemview
  3. [Huawei]sysname R1
  4. [R1]interface GigabitEthernet 0/0/0
  5. [R1GigabitEthernet0/0/0]ip add 192.168.12.1 24
  6. [R1GigabitEthernet0/0/0]quit
  7. [R1]interface GigabitEthernet 0/0/2
  8. [R1GigabitEthernet0/0/2]ip add 192.168.1.254 24
  9. [R1GigabitEthernet0/0/2]quit
  10. [R1]ospf 1 routerid 1.1.1.1
  11. [R1ospf-1]area 12
  12. [R1ospf-1area-0.0.0.12]network 192.168.12.0 0.0.0.255
  13. [R1ospf-1area-0.0.0.12]network 192.168.1.0 0.0.0.255
  14. [R1ospf-1area-0.0.0.12]quit
  15. <Huawei>undo terminal monitor
  16. <Huawei>systemview
  17. [Huawei]sysname R2
  18. [R2]interface GigabitEthernet 0/0/1
  19. [R2GigabitEthernet0/0/1]ip add 192.168.12.2 24
  20. [R2GigabitEthernet0/0/1]quit
  21. [R2]interface GigabitEthernet 0/0/0
  22. [R2GigabitEthernet0/0/0]ip add 192.168.23.2 24
  23. [R2GigabitEthernet0/0/0]quit
  24. [R2]ospf 1 routerid 2.2.2.2
  25. [R2ospf-1]area 12
  26. [R2ospf-1area-0.0.0.12]network 192.168.12.0 0.0.0.255
  27. [R2ospf-1area-0.0.0.12]quit
  28. [R2ospf-1]area 0
  29. [R2ospf-1area-0.0.0.0]network 192.168.23.0 0.0.0.255
  30. [R2ospf-1area-0.0.0.0]quit
  31. <Huawei>undo terminal monitor
  32. <Huawei>systemview
  33. [Huawei]sysname R3
  34. [R3]interface GigabitEthernet 0/0/1
  35. [R3GigabitEthernet0/0/1]ip add 192.168.23.3 24
  36. [R3GigabitEthernet0/0/1]quit
  37. [R3]interface GigabitEthernet 0/0/0
  38. [R3GigabitEthernet0/0/0]ip add 192.168.34.3 24
  39. [R3GigabitEthernet0/0/0]quit
  40. [R3]ospf 1 routerid 3.3.3.3
  41. [R3ospf-1]area 0
  42. [R3ospf-1area-0.0.0.0]network 192.168.23.0 0.0.0.255
  43. [R3ospf-1area-0.0.0.0]network 192.168.34.0 0.0.0.255
  44. [R3ospf-1area-0.0.0.0]quit
  45. <Huawei>undo terminal monitor
  46. <Huawei>systemview
  47. [Huawei]sysname R4
  48. [R4]interface GigabitEthernet 0/0/1
  49. [R4GigabitEthernet0/0/1]ip add 192.168.34.4 24
  50. [R4GigabitEthernet0/0/1]quit
  51. [R4]interface GigabitEthernet 0/0/0
  52. [R4GigabitEthernet0/0/0]ip add 192.168.45.4 24
  53. [R4GigabitEthernet0/0/0]quit
  54. [R4]ospf 1 routerid 4.4.4.4
  55. [R4ospf-1]area 0
  56. [R4ospf-1area-0.0.0.0]network 192.168.45.0 0.0.0.255
  57. [R4ospf-1area-0.0.0.0]network 192.168.34.0 0.0.0.255
  58. [R4ospf-1area-0.0.0.0]quit
  59. <Huawei>undo terminal monitor
  60. <Huawei>systemview
  61. [Huawei]sysname R5
  62. [R5]interface GigabitEthernet 0/0/1
  63. [R5GigabitEthernet0/0/1]ip add 192.168.45.5 24
  64. [R5GigabitEthernet0/0/1]quit
  65. [R5]interface GigabitEthernet 0/0/0
  66. [R5GigabitEthernet0/0/0]ip add 192.168.56.5 24
  67. [R5GigabitEthernet0/0/0]quit
  68. [R5]ospf 1 routerid 5.5.5.5
  69. [R5ospf-1]area 56
  70. [R5ospf-1area-0.0.0.56]network 192.168.56.0 0.0.0.255
  71. [R5ospf-1area-0.0.0.56]quit
  72. [R5ospf-1]area 0
  73. [R5ospf-1area-0.0.0.0]network 192.168.45.0 0.0.0.255
  74. [R5ospf-1area-0.0.0.0]quit
  75. <Huawei>undo terminal monitor
  76. <Huawei>systemview
  77. [Huawei]sysname R6
  78. [R6]interface GigabitEthernet 0/0/0
  79. [R6GigabitEthernet0/0/0]ip add 192.168.67.6 24
  80. [R6GigabitEthernet0/0/0]quit
  81. [R6]interface GigabitEthernet 0/0/1
  82. [R6GigabitEthernet0/0/1]ip add 192.168.56.6 24
  83. [R6GigabitEthernet0/0/1]quit
  84. [R6]interface GigabitEthernet 0/0/2
  85. [R6GigabitEthernet0/0/2]ip add 192.168.2.254 24
  86. [R6GigabitEthernet0/0/2]quit
  87. [R6]ospf 1 routerid 6.6.6.6
  88. [R6ospf-1]area 56
  89. [R6ospf-1area-0.0.0.56]network 192.168.56.0 0.0.0.255
  90. [R6ospf-1area-0.0.0.56]network 192.168.2.0 0.0.0.255
  91. [R6ospf-1area-0.0.0.56]quit
  92. <Huawei>undo terminal monitor
  93. <Huawei>systemview
  94. [Huawei]sysname R7
  95. [R7]interface GigabitEthernet 0/0/1
  96. [R7GigabitEthernet0/0/0]ip add 192.168.67.7 24
  97. [R7GigabitEthernet0/0/0]quit
  98. [R7]interface GigabitEthernet 0/0/2
  99. [R7GigabitEthernet0/0/2]ip add 192.168.3.254 24
  100. [R7GigabitEthernet0/0/2]quit
  101. [R7]ip routestatic 192.168.0.0 16 192.168.67.6

2)配置 R6 与 R7 之间的互通路由,并引入 OSPF

  1. [R6]ip routestatic 192.168.3.0 24 192.168.67.7
  2. [R6]ospf 1
  3. [R6ospf-1]importroute static

3)配置区域12 为特殊区域

  1. [R1]ospf 1
  2. [R1ospf-1]area 12
  3. [R1ospf-1area-0.0.0.12]stub
  4. [R1ospf-1area-0.0.0.12]quit
  5. [R2]ospf 1
  6. [R2ospf-1]area 12
  7. [R2ospf-1area-0.0.0.12]stub
  8. [R2ospf-1area-0.0.0.12]quit

3)确保PC-1/2 与 PC3之间的互通

  1. PC-1>ping 192.168.3.1
  2. Ping 192.168.3.1: 32 data bytes, Press Ctrl_C to break
  3. From 192.168.3.1: bytes=32 seq=1 ttl=125 time=31 ms
  4. From 192.168.3.1: bytes=32 seq=2 ttl=125 time=31 ms
  5. From 192.168.3.1: bytes=32 seq=3 ttl=125 time=16 ms
  6. From 192.168.3.1: bytes=32 seq=4 ttl=125 time=16 ms
  7. From 192.168.3.1: bytes=32 seq=5 ttl=125 time=31 ms
  8. 192.168.3.1 ping statistics
  9. 5 packet(s) transmitted
  10. PC-2>ping 192.168.3.1
  11. Ping 192.168.3.1: 32 data bytes, Press Ctrl_C to break
  12. From 192.168.3.1: bytes=32 seq=1 ttl=125 time=31 ms
  13. From 192.168.3.1: bytes=32 seq=2 ttl=125 time=31 ms
  14. From 192.168.3.1: bytes=32 seq=3 ttl=125 time=16 ms
  15. From 192.168.3.1: bytes=32 seq=4 ttl=125 time=16 ms
  16. From 192.168.3.1: bytes=32 seq=5 ttl=125 time=31 ms
  17. 192.168.3.1 ping statistics
  18. 5 packet(s) transmitted[/hidecontent]

给TA打赏
共{{data.count}}人
人已打赏
华为数通

OSPF单区域配置 、 OSPF 多区域配置 、 OSPF 链路解析 、 OSPF协议概述 、 OSPF 综合案例

2021-12-27 14:37:19

华为数通

OSPFv3配置 、 特殊区域之NSSA 、 OSPF安全认证 、 IPv6协议介绍 、 OSPF 虚链路 、 OSPF 路由汇总

2021-12-27 14:41:07

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索