A-A+

利用OSPF协议过滤外部路由的实验报告

2015年11月19日 站长资讯 暂无评论

【实验拓扑】

【实验要求】

1、按照上图配置好网络

2、在R5上增加1条静态路由150.1.50.0/24 指向null 0,并重发布到OSPF中

3、在R6上增加1条静态路由150.1.60.0/24 指向null 0,并重发布到OSPF中

4、在R1与R4上设置过滤,过滤掉来自R6的外部路由

【实验思考】

我们知道OSPF从外部学习的路由都会标记为E2,我们可以通过route-map来过滤外部标记,但是如何只过滤来自于R6的呢?

同样用Route-map 中的过滤路由来源。

【配置方法】

  1. R1 & R4  
  2. access-list 1 permit 150.1.6.6  
  3. !  
  4. route-map FILTER_OSPF deny 10  
  5. match route-type external type-2  
  6. match ip route-source 1  
  7. route-map FILTER_OSPF permit 1000  
  8. !  
  9. router ospf 1  
  10. distribute-list route-map FILTER_OSPF in  
  11. R5:  
  12. ip route 160.1.50.0 255.255.255.0 null 0  
  13. router ospf 1  
  14. redistribute static subnets  
  15. R6:  
  16. ip route 160.1.60.0 255.255.255.0 null 0  
  17. router ospf 1  
  18. redistribute static subnets  

【过滤后验证方法】

过滤之前
----------------------------------------------------------------------------------------------->>

  1. R1#show ip route ospf  
  2.      160.1.0.0/24 is subnetted, 2 subnets  
  3. O E2    160.1.50.0 [110/20] via 155.1.0.5, 00:01:00, Serial0/0  
  4. O E2    160.1.60.0 [110/20] via 155.1.146.6, 00:01:00, FastEthernet0/0  
  5.      150.1.0.0/16 is variably subnetted, 4 subnets, 2 masks  
  6. O       150.1.6.6/32 [110/11] via 155.1.146.6, 00:01:00, FastEthernet0/0  
  7. O       150.1.5.5/32 [110/65] via 155.1.0.5, 00:01:00, Serial0/0  
  8. O       150.1.4.4/32 [110/11] via 155.1.146.4, 00:01:00, FastEthernet0  

过滤之后,仅剩余1条外部学习到的路由

----------------------------------------------------------------------------------------------->>

  1. R1#show ip route ospf  
  2.      160.1.0.0/24 is subnetted, 1 subnets  
  3. O E2    160.1.50.0 [110/20] via 155.1.0.5, 00:00:03, Serial0/0  
  4.      150.1.0.0/16 is variably subnetted, 4 subnets, 2 masks  
  5. O       150.1.6.6/32 [110/11] via 155.1.146.6, 00:00:03, FastEthernet0/0  
  6. O       150.1.5.5/32 [110/65] via 155.1.0.5, 00:00:03, Serial0/0  
  7. O       150.1.4.4/32 [110/11] via 155.1.146.4, 00:00:03, FastEther  

【实验前的基本配置】

----------------------------------------------------------------------------------------------

  1. R1:  
  2. interface Fa 0/0  
  3. ip address 155.1.146.1 255.255.255.0  
  4. no shut  
  5. !  
  6. interface Serial 0/0  
  7. encapsulation frame-relay  
  8. no frame-relay inverse-arp  
  9. ip address 155.1.0.1 255.255.255.0   
  10. http://www.xiaoxiongboke.com  
  11. frame-relay map ip 155.1.0.5 105  
  12. frame-relay map ip 155.1.0.4 105  
  13. ip ospf priority 0  
  14. no shutdown  
  15. !  
  16. interface Loopback0  
  17. ip address 150.1.1.1 255.255.255.0  
  18. !  
  19. router ospf 1  
  20. router-id 150.1.1.1  
  21. network 155.1.146.1 0.0.0.0 area 1  
  22. network 150.1.1.1 0.0.0.0 area 1  
  23. network 155.1.0.1 0.0.0.0 area 0  
  24. R4:  
  25. interface Eth 0/1  
  26. ip address 155.1.146.4 255.255.255.0  
  27. !  
  28. interface Serial 0/0  
  29. encapsulation frame-relay  
  30. no frame-relay inverse-arp  
  31. ip address 155.1.0.4 255.255.255.0  
  32. frame-relay map ip 155.1.0.5 405  
  33. frame-relay map ip 155.1.0.1 405  
  34. ip ospf priority 0  
  35. !  
  36. interface Loopback0  
  37. ip address 150.1.4.4 255.255.255.0  
  38. !  
  39. router ospf 1  
  40. router-id 150.1.4.4  
  41. network 155.1.146.4 0.0.0.0 area 1  
  42. network 150.1.4.4 0.0.0.0 area 1  
  43. network 155.1.0.4 0.0.0.0 area 0  
  44. R5:  
  45. interface Serial 0/0  
  46. encapsulation frame-relay  
  47. no frame-relay inverse-arp  
  48. ip address 155.1.0.5 255.255.255.0  
  49. frame-relay map ip 155.1.0.4 504  
  50. frame-relay map ip 155.1.0.1 501  
  51. !  
  52. interface Loopback0  
  53. ip address 150.1.5.5 255.255.255.0  
  54. !  
  55. router ospf 1  
  56. router-id 150.1.5.5  
  57. network 150.1.5.5 0.0.0.0 area 0  
  58. network 155.1.0.5 0.0.0.0 area 0  
  59. neighbor 155.1.0.4  
  60. neighbor 155.1.0.1  
  61. R6:  
  62. interface Gig 0/1  
  63. ip address 155.1.146.6 255.255.255.0  
  64. !  
  65. interface Loopback0  
  66. ip address 150.1.6.6 255.255.255.0  
  67. !  
  68. router ospf 1  
  69. router-id 150.1.6.6  
  70. network 155.1.146.6 0.0.0.0 area 1  
  71. network 150.1.6.6 0.0.0.0 area 1  
标签:

给我留言