拓扑

实验05 - Community-List - 图1

要求

  • R4对所有携带Community 111:111的路由条目,修改其Community:444:444 444:555,做在进站方向?
  • R5对所有携带Community 444:555的路由条目,修改其 Weight

步骤

  • 在R11 和 R1上,分别对192.168.11.13 和 192.168.1.12 设置111:111 的 Community —— prefix-list + route-map
  • 在R4 上,对community 为111:111 的路由条目,修改其 community —— community-list + route-map
  1. ip community-list 1 permit 111:111
  2. !
  3. route-map RM_ALL permit 10
  4. match community 1
  5. set community 444:444 444:555
  6. !
  7. route-map RM_ALL permit 20
  8. !

实验05 - Community-List - 图2

  • 在R5 上修改Weight,Weight 只在本地生效,不会传播
  1. ip community-list 1 permit 444:444 444:555
  2. !
  3. route-map RM_ALL permit 10
  4. set weight 555
  5. !
  6. route-map RM_ALL permit 20
  7. !
  • 来看个192.168.11.13 这条路由在R3、R4、R5上的整体对比
    • 在R3上,Community 仍为111:111
    • 在R4上,Community 从进站方向被修改为 444:444 444:555
    • 在R5上,Weight 从进站方向被修改为555

实验05 - Community-List - 图3

疑问

  • in 和 out 到底怎么选