当前位置:   article > 正文

hcip实验5:ospf综合实验

hcip实验5:ospf综合实验

实验拓扑:

实验目的:

1、R4为ISP,其上只配置IP地址;R4与其他所直连设备间均使用公有IP;
2、R3-R5、R6、R7为MGRE环境,R3为中心站点;
3、整个OSPF环境IP基于172.16.0.0/16划分;除了R12有两个环回,其他路由器均有一个环回IP
4、所有设备均可访问R4的环回;
5、减少LSA的更新量,加快收敛,保障更新安全;
6、全网可达

实验思路:

1.划分IP地址(如实验拓扑图所示)

2.配置IP地址

3.配置内网通和公网通,搭建MGRE环境

4.配置nat easy ip能够访问R4的环回

5.ABR/ASBR汇总

6.设特殊区域

7.更改hello时间加快收敛

8.配置认证保证安全

实验配置:

IP配置:

  1. #R1配置
  2. [R1]int g0/0/0
  3. [R1-GigabitEthernet0/0/0]ip add 172.16.33.1 24
  4. [R1-GigabitEthernet0/0/0]int l0
  5. [R1-LoopBack0]ip add 172.16.34.1 24
  6. #R2配置
  7. [R2]int g0/0/0
  8. [R2-GigabitEthernet0/0/0]ip add 172.16.33.2 24
  9. [R2-GigabitEthernet0/0/0]int l0
  10. [R2-LoopBack0]ip add 172.16.35.2 24
  11. #R3配置
  12. [R3]int se4/0/0
  13. [R3-Serial4/0/0]ip add 34.0.0.3 24
  14. [R3]int g0/0/0
  15. [R3-GigabitEthernet0/0/0]ip add 172.16.33.3 24
  16. [R3]int l0
  17. [R3-LoopBack0]ip add 172.16.36.3 24
  18. #R4配置
  19. [R4]int se4/0/0
  20. [R4-Serial4/0/0]ip add 34.0.0.4 24
  21. [R4-Serial4/0/0]int se4/0/1
  22. [R4-Serial4/0/1]ip add 45.0.0.4 24
  23. [R4-Serial4/0/1]int se3/0/0
  24. [R4-Serial3/0/0]ip add 46.0.0.4 24
  25. [R4-Serial3/0/0]int g0/0/0
  26. [R4-GigabitEthernet0/0/0]ip add 47.0.0.4 24
  27. [R4]int LoopBack 0
  28. [R4-LoopBack0]ip add 172.16.2.4 24
  29. #R5配置
  30. [R5]int se4/0/0
  31. [R5-Serial4/0/0]ip add 45.0.0.5 24
  32. [R5]int LoopBack 0
  33. [R5-LoopBack0]ip add 172.16.3.5 24
  34. #R6配置
  35. [R6-GigabitEthernet0/0/0]
  36. [R6-GigabitEthernet0/0/0]ip add 172.16.65.1 30
  37. [R6]int se4/0/0
  38. [R6-Serial4/0/0]ip add 46.0.0.6 24
  39. [R6-Serial4/0/0]int l0
  40. [R6-LoopBack0]ip add 172.16.4.6 24
  41. #R7配置
  42. [R7]int g0/0/0
  43. [R7-GigabitEthernet0/0/0]ip add 47.0.0.7 24
  44. [R7-GigabitEthernet0/0/0]int g0/0/1
  45. [R7-GigabitEthernet0/0/1]ip add 172.16.97.1 24
  46. [R7-GigabitEthernet0/0/1]int l0
  47. [R7-LoopBack0]ip add 172.16.5.7 24
  48. #R8配置
  49. [R8]int g0/0/0
  50. [R8-GigabitEthernet0/0/0]ip add 172.16.97.2 30
  51. [R8-GigabitEthernet0/0/0]int g0/0/1
  52. [R8-GigabitEthernet0/0/1]ip add 172.16.97.5 30
  53. [R8-LoopBack0]ip add 172.16.98.8 24
  54. #R9配置
  55. [R9-GigabitEthernet0/0/0]ip add 172.16.97.6 30
  56. [R9-GigabitEthernet0/0/0]int g0/0/1
  57. [R9-GigabitEthernet0/0/1]ip add 172.16.129.9 24
  58. [R9-GigabitEthernet0/0/1]int l0
  59. [R9-LoopBack0]ip add 172.16.130.9 24
  60. #R10配置
  61. [R10]int l0
  62. [R10-LoopBack0]ip add 172.16.131.10 24
  63. [R10-LoopBack0]int g0/0/0
  64. [R10-GigabitEthernet0/0/0]ip add 172.16.129.10 24
  65. #R11配置
  66. [R11]int g0/0/1
  67. [R11-GigabitEthernet0/0/1]ip add 172.16.65.5 30
  68. [R11-GigabitEthernet0/0/1]int g0/0/0
  69. [R11-GigabitEthernet0/0/0]ip add 172.16.65.2 30
  70. [R11-GigabitEthernet0/0/0]int l0
  71. [R11-LoopBack0]ip add 172.16.66.11 24
  72. #R12配置
  73. [R12]int g0/0/0
  74. [R12-GigabitEthernet0/0/0]ip add 172.16.65.6 30
  75. [R12-LoopBack0]ip add 172.16.160.1 24
  76. [R12-LoopBack1 ]ip add 172.16.161.1 24

MGRE配置:

  1. #R3配置(R3为中心站点)
  2. [R3]int Tunnel 0/0/0
  3. [R3-Tunnel0/0/0]ip add 172.16.6.3 24
  4. [R3-Tunnel0/0/0]tunnel-protocol p2mp
  5. [R3-Tunnel0/0/0]tunnel-protocol gre p2mp
  6. [R3-Tunnel0/0/0]source 34.0.0.3
  7. #R5配置
  8. [R5]int Tunnel 0/0/0
  9. [R5-Tunnel0/0/0]ip add 172.16.6.5 24
  10. [R5-Tunnel0/0/0]tunnel-protocol gre p2mp
  11. [R5-Tunnel0/0/0]source Serial4/0/0
  12. #R6配置
  13. [R6]int Tunnel 0/0/0
  14. [R6-Tunnel0/0/0]ip add 172.16.6.6 24
  15. [R6-Tunnel0/0/0]tunnel-protocol gre p2mp
  16. [R6-Tunnel0/0/0]source Serial4/0/0
  17. #R7配置
  18. [R7]int Tunnel 0/0/0
  19. [R7-Tunnel0/0/0]ip add 172.16.6.7 24
  20. [R7-Tunnel0/0/0]tunnel-protocol gre p2mp
  21. [R7-Tunnel0/0/0]source GigabitEthernet 0/0/0
  22. #NHRP的配置
  23. #中心站点(R3)配置:
  24. [R3]int Tunnel 0/0/0
  25. [R3-Tunnel0/0/0]nhrp network-id 100
  26. #R5配置
  27. [R5]int Tunnel 0/0/0
  28. [R5-Tunnel0/0/0]nhrp network-id 100
  29. [R5-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
  30. #R6配置
  31. [R6]int Tunnel 0/0/0
  32. [R6-Tunnel0/0/0]nhrp network-id 100
  33. [R6-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
  34. #R7配置
  35. [R7]int Tunnel 0/0/0
  36. [R7-Tunnel0/0/0]nhrp network-id 100
  37. [R7-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
  38. #指向R4的静态缺省
  39. [R3]ip route-static 0.0.0.0 0 34.0.0.4
  40. [R5]ip route-static 0.0.0.0 0 45.0.0.4
  41. [R6]ip route-static 0.0.0.0 0 46.0.0.4
  42. [R7]ip route-static 0.0.0.0 0 47.0.0.4
宣告隧道地址:
  1. [R3]ospf 1
  2. [R3-ospf-1]a 0
  3. [R3-ospf-1-area-0.0.0.0]net 172.16.6.0 0.0.0.255
  4. [R5]ospf 1
  5. [R5-ospf-1]a 0
  6. [R5-ospf-1-area-0.0.0.0]net 172.16.6.0 0.0.0.255
  7. [R6]ospf 1
  8. [R6-ospf-1]a 0
  9. [R6-ospf-1-area-0.0.0.0]net 172.16.6.0 0.0.0.255
  10. [R7]ospf 1
  11. [R7-ospf-1]a 0
  12. [R7-ospf-1-area-0.0.0.0]net 172.16.6.0 0.0.0.255
更改接口类型:
  1. [R3]int Tunnel 0/0/0
  2. [R3-Tunnel0/0/0]ospf network-type broadcast
  3. [R5]int Tunnel 0/0/0
  4. [R5-Tunnel0/0/0]ospf network-type broadcast
  5. [R6]int Tunnel 0/0/0
  6. [R6-Tunnel0/0/0]ospf network-type broadcast
  7. [R7]int Tunnel 0/0/0
  8. [R7-Tunnel0/0/0]ospf network-type broadcast
取消分支站点的被选举资格:
  1. [R5-Tunnel0/0/0]ospf dr-priority 0
  2. [R6-Tunnel0/0/0]ospf dr-priority 0
  3. [R7-Tunnel0/0/0]ospf dr-priority 0

查看中心站点NHRP表:

测试公网通:

RIP配置

  1. [R12]rip 1
  2. [R12-rip-1]v 2
  3. [R12-rip-1]undo summary
  4. [R12-rip-1]network 172.16.0.0
  5. #R12中将域外路由引入域内
  6. [R12-ospf-1]import-route rip

OSPF配置

area 1
  1. [R1]ospf 1
  2. [R1-ospf-1]ar
  3. [R1-ospf-1]area 1
  4. [R1-ospf-1-area-0.0.0.1]network 172.16.33.0 0.0.0.255
  5. [R1-ospf-1-area-0.0.0.1]network 172.16.34.1 0.0.0.0
  6. #R2配置
  7. [R2]ospf 1
  8. [R2-ospf-1]area 1
  9. [R2-ospf-1-area-0.0.0.1]net 172.16.33.0 0.0.0.255
  10. [R2-ospf-1-area-0.0.0.1]network 172.16.35.2 0.0.0.0
  11. #R3配置
  12. [R3]ospf 1
  13. [R3-ospf-1]area 1
  14. [R3-ospf-1-area-0.0.0.1]net 172.16.33.0 0.0.0.255
  15. [R3-ospf-1-area-0.0.0.1]net 172.16.36.3 0.0.0.0
area 0
  1. #R5配置
  2. [R5]ospf 1 router-id 5.5.5.5
  3. [R5-ospf-1]a 0
  4. [R5-ospf-1-area-0.0.0.0]net 172.16.3.0 0.0.0.255
  5. #R6配置
  6. [R6]ospf 1 router-id 6.6.6.6
  7. [R6-ospf-1]a 0
  8. [R6-ospf-1-area-0.0.0.0]net 172.16.4.0 0.0.0.255
  9. #R7配置
  10. [R7]ospf 1 router-id 7.7.7.7
  11. [R7-ospf-1]a 0
  12. [R7-ospf-1-area-0.0.0.0]net 172.16.5.0 0.0.0.255
area 2
  1. #R6配置
  2. [R6-ospf-1]a 2
  3. [R6-ospf-1-area-0.0.0.2]net 172.16.65.1 0.0.0.0
  4. #R11配置
  5. [R11-ospf-1]a 2
  6. [R11-ospf-1-area-0.0.0.2]net 172.16.66.0 0.0.0.255
  7. [R11-ospf-1-area-0.0.0.2]net 172.16.65.2 0.0.0.0
  8. [R11-ospf-1-area-0.0.0.2]net 172.16.65.5 0.0.0.0
  9. #R12配置
  10. [R12]ospf 1 router-id 12.12.12.12
  11. [R12-ospf-1]a 2
  12. [R12-ospf-1-area-0.0.0.2]net 172.16.65.6 0.0.0.0
area 3
  1. #R7配置
  2. [R7-ospf-1]a 3
  3. [R7-ospf-1-area-0.0.0.3]net 172.16.97.1 0.0.0.0
  4. #R8配置
  5. [R8]ospf 1 router-id 8.8.8.8
  6. [R8-ospf-1]a 3
  7. [R8-ospf-1-area-0.0.0.3]net 172.16.97.2 0.0.0.0
  8. [R8-ospf-1-area-0.0.0.3]net 172.16.97.5 0.0.0.0
  9. [R8-ospf-1-area-0.0.0.3]net 172.16.98.0 0.0.0.255
  10. #R9配置
  11. #R10配置
  12. [R10-ospf-2-area-0.0.0.4]net 172.16.129.10 0.0.0.0
  13. [R10-ospf-2-area-0.0.0.4]net 172.16.131.0 0.0.0.255
不同进程之间分别引入路由:
  1. [R9-ospf-1]import-route ospf 2
  2. [R9-ospf-1]q
  3. [R9]ospf 2
  4. [R9-ospf-2]import-route ospf 1
各私网建邻情况:

area 1

area 2

area 3

area 4

配置nat easy ip能够访问R4的环回

  1. [R3]acl 2000
  2. [R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
  3. [R3]int s 4/0/0
  4. [R3-Serial4/0/0]nat outbound 2000
  5. [R5]acl 2000
  6. [R5-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
  7. [R5]int s 4/0/0
  8. [R5-Serial4/0/0]nat outbound 2000
  9. [R6]acl 2000
  10. [R6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
  11. [R6]int s 4/0/0
  12. [R6-Serial4/0/0]nat outbound 2000
  13. [R7]acl 2000
  14. [R7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
  15. [R7]int g0/0/0
  16. [R7-GigabitEthernet0/0/0]nat outbound 2000

私网的ip还是不能够访问公网上R4的环回地址 ,因为公网口的地址并没有宣告进私网(这里需要下发一条默认缺省让其他路由器能够访问公网口----在配置特殊区域后会自动下发默认缺省

路由聚合

ABR汇总:
  1. area 1
  2. [R3]ospf 1
  3. [R3-ospf-1]a 1
  4. [R3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
  5. area 2
  6. [R6]ospf 1
  7. [R6-ospf-1]a 2
  8. [R6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
  9. area 3
  10. [R7]ospf 1
  11. [R7-ospf-1]a 3
  12. [R7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
ASBR汇总:
  1. [R12]ospf 1
  2. [R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
  3. [R9]ospf 1
  4. [R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0

配置特殊区域

area 1配置为totally stub

  1. [R3]ospf 1
  2. [R3-ospf-1]a 1
  3. [R3-ospf-1-area-0.0.0.1]stub no-summary
  4. [R1]ospf 1
  5. [R1-ospf-1]a 1
  6. [R1-ospf-1-area-0.0.0.1]stub no-summary
  7. [R2]ospf 1
  8. [R2-ospf-1]a 1
  9. [R2-ospf-1-area-0.0.0.1]stub no-summary

设置后的路由表和lsdb表:

area 2配置为totally nssa

  1. [R6]ospf 1
  2. [R6-ospf-1]a 2
  3. [R6-ospf-1-area-0.0.0.2]nssa no-summary
  4. [R11]ospf 1
  5. [R11-ospf-1]a 2
  6. [R11-ospf-1-area-0.0.0.2]nssa no-summary
  7. [R12]ospf 1
  8. [R12-ospf-1]a 2
  9. [R12-ospf-1-area-0.0.0.2]nssa no-summary

area 3配置为totally nssa

  1. [R7]ospf 1
  2. [R7-ospf-1]a 3
  3. [R7-ospf-1-area-0.0.0.3]nssa no-summary
  4. [R8]ospf 1
  5. [R8-ospf-1]a 3
  6. [R8-ospf-1-area-0.0.0.3]nssa no-summary
  7. [R9]ospf 1
  8. [R9-ospf-1]a 3
  9. [R9-ospf-1-area-0.0.0.3]nssa no-summary

各个区域都依靠缺省路由去访问公网,R10无法学习到其他的路由而导致其无法访问公网

在R9上面给R10下发一条默认缺省:

  1. [R9]ospf 2
  2. [R9-ospf-2]default-route-advertise

从这里看到有一条默认缺省指向R9

加快收敛(修改hello时间或是修改death时间,一般情况修改hello时间,这里以修改hello时间为例)

area 0:

  1. [R3]int t0/0/0
  2. [R3-Tunnel0/0/0]ospf timer hello 5
  3. [R5]int t0/0/0
  4. [R5-Tunnel0/0/0]ospf timer hello 5
  5. [R6]int t0/0/0
  6. [R6-Tunnel0/0/0]ospf timer hello 5
  7. [R7]int t0/0/0
  8. [R7-Tunnel0/0/0]ospf timer hello 5

area 1:

  1. [R1]int g0/0/0
  2. [R1-GigabitEthernet0/0/0]ospf timer hello 5
  3. [R2]int g0/0/0
  4. [R3-GigabitEthernet0/0/0]ospf timer hello 5
  5. [R3]int g0/0/0
  6. [R3-GigabitEthernet0/0/0]ospf timer hello 5

 area 2:

  1. [R6]int g0/0/0
  2. [R6-GigabitEthernet0/0/0]ospf timer hello 5
  3. [R11]int g0/0/0
  4. [R11-GigabitEthernet0/0/0]ospf timer hello 5
  5. [R11]int g0/0/1
  6. [R11-GigabitEthernet0/0/1]ospf timer hello 5
  7. [R12]int g0/0/0
  8. [R12-GigabitEthernet0/0/0]ospf timer hello 5

area 3:

  1. [R7]int g0/0/1
  2. [R7-GigabitEthernet0/0/1]ospf timer hello 5
  3. [R8]int g0/0/0
  4. [R8-GigabitEthernet0/0/0]ospf timer hello 5
  5. [R8]int g0/0/1
  6. [R8-GigabitEthernet0/0/1]ospf timer hello 5
  7. [R9]int g0/0/0
  8. [R9-GigabitEthernet0/0/0]ospf timer hello 5

 area 4:

  1. [R9]int g0/0/1
  2. [R9-GigabitEthernet0/0/1]ospf timer hello 5
  3. [R10]int g0/0/0
  4. [R10-GigabitEthernet0/0/0]ospf timer hello 5

配置认证保证安全(在ospf下做区域验证或是接口验证,这里以区域验证为例)

area 0:

  1. [R3]ospf 1
  2. [R3-ospf-1]a 0
  3. [R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123
  4. [R5]ospf 1
  5. [R5-ospf-1]a 0
  6. [R5-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123
  7. [R7]ospf 1
  8. [R7-ospf-1]a 0
  9. [R7-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123
  10. [R6]ospf 1
  11. [R6-ospf-1]a 0
  12. [R6-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123

area 1:

  1. [R3]ospf 1
  2. [R3-ospf-1]a 1
  3. [R3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123
  4. [R1]ospf 1
  5. [R1-ospf-1]a 1
  6. [R1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123
  7. [R2]ospf 1
  8. [R2-ospf-1]a 1
  9. [R2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123

area 2:

  1. [R6]ospf 1
  2. [R6-ospf-1]a 2
  3. [R6-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123
  4. [R11]ospf 1
  5. [R11-ospf-1]a 2
  6. [R11-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123
  7. [R12]ospf 1
  8. [R12-ospf-1]a 2
  9. [R12-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123

area 3:

  1. [R7]ospf 1
  2. [R7-ospf-1]a 3
  3. [R7-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123
  4. [R8]ospf 1
  5. [R8-ospf-1]a 3
  6. [R8-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123
  7. [R9]ospf 1
  8. [R9-ospf-1]a 3
  9. [R9-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123

area 4:

  1. [R9]ospf 2
  2. [R9-ospf-2]a 4
  3. [R9-ospf-2-area-0.0.0.4]authentication-mode md5 1 cipher 123
  4. [R10]ospf 2
  5. [R10-ospf-2]a 4
  6. [R10-ospf-2-area-0.0.0.4]authentication-mode md5 1 cipher 123

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号