| BGP community 属性の設定 | Dynalconf HOME | 
Dynamips/Dynagenを使用してBGP community属性の確認を行います。AS65001のR3で5.5.5.5/32に対して、community値として65001:100を設定し、AS65000にアドバタイズします。AS65000ではR3と隣接関係にあるR11において、community値に65001:100が設定されているルートに対して、Local Preference値をデフォルトの100から110に変更します。
 
  ip bgp-community new-formatcommunity属性には、Well-known communityとしてあらかじめ決められた値が定義されているが、 定義されていない範囲は自由に使用することが可能で、設定した値に意味を持たせ運用者間で 相互に制御が可能となる。
ip bgp-community new-format
ip prefix-list R5_loopback0 seq 5 permit 5.5.5.5/32 route-map SETCOM permit 10 match ip address prefix-list R5_loopback0 set community 65001:100 route-map SETCOM permit 20
router bgp 65001 neighbor 10.3.11.11 remote-as 65000 neighbor 10.3.11.11 send-community neighbor 10.3.11.11 route-map SETCOM out
ip bgp-community new-format
ip community-list 1 permit 65001:100 route-map MATCHCOM permit 10 match community 1 set local-preference 110 route-map MATCHCOM permit 20
router bgp 65000 neighbor 10.3.11.3 remote-as 65001 neighbor 10.3.11.3 route-map MATCHCOM in
R11#sh bgp ipv4 unicast 5.5.5.5
BGP routing table entry for 5.5.5.5/32, version 2
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     2
  Refresh Epoch 1
  65001 65002
    10.3.11.3 from 10.3.11.3 (3.3.3.3)
      Origin IGP, localpref 110, valid, external, best
      Community: 65001:100  ---> Community 65001:100
R1#sh bgp ipv4 unicast
     Network      Next Hop     Metric LocPrf Weight Path
 *>  1.1.1.1/32   0.0.0.0           0         32768 i
 *>i 5.5.5.5/32   11.11.11.11       0    110      0 65001 65002 i  ---> Local Preference 110
 *>i 10.5.5.0/24  10.10.10.10       0    100      0 65001 65002 i
 * i              11.11.11.11       0    100      0 65001 65002 i
R10#sh bgp ipv4 unicast
     Network      Next Hop     Metric LocPrf Weight Path
 r>i 1.1.1.1/32   1.1.1.1           0    100      0 i
 *>i 5.5.5.5/32   11.11.11.11       0    110      0 65001 65002 i  ---> Local Preference 110
 *                10.2.10.2                       0 65001 65002 i
 * i 10.5.5.0/24  11.11.11.11       0    100      0 65001 65002 i
 *>               10.2.10.2                       0 65001 65002 i
    1. Dynagen .net file 2. R1 3. R2 4. R3 5. R4 6. R5 7. R10 8. R11
R1 : sh bgp ipv4 unicast sh ip route R11 : sh bgp ipv4 unicast R10 : sh bgp ipv4 unicast 1. show command
| Dynalconf HOME |