コンフィグレーションガイド

[目次][用語][索引][前へ][次へ]


9.4.2 BGP4プロトコル(基本:ルーティングピア)

<この項の構成>
(1) 設定内容の概要
(2) 構成図と設定条件
(3) コンフィグレーション例

(1) 設定内容の概要

AS番号200(AS200),AS番号300(AS300),AS番号400(AS400)およびAS番号500(AS500)の自律システムに接続されたAS番号100の自律システム(AS100)において,AS200およびAS300から広告された経路情報をAS内およびAS400,AS500に配布し,AS400およびAS500から広告された特定ネットワーク宛の経路情報をAS内およびAS200,AS300に配布します。また,AS内のネットワークをスタティック定義し,AS200,AS300,AS400およびAS500に広告します。

(2) 構成図と設定条件

[構成図]

図9-19 構成図

[図データ]

[設定条件]

<本装置A/Bの環境>
  1. AS200およびAS300のBGP4スピーカと外部ピアによりピアリングします。
  2. AS内の他のBGP4スピーカと内部ピアによりピアリングします。
  3. OSPFにより直結経路を,BGP4によりAS200およびAS300から受信した経路をAS内に広告します。その際,AS200およびAS300からの経路はAS200を優先します。
  4. AS400およびAS500からの経路をAS200およびAS300に広告します。また,AS内のネットワークをスタティック定義し,AS200およびAS300に広告します。

<本装置C/Dの環境>
  1. AS400およびAS500のBGP4スピーカと外部ピアによりピアリングします。
  2. AS内の他のBGP4スピーカと内部ピアによりピアリングします。
  3. OSPFにより直結経路を,BGP4によりAS400およびAS500から受信した特定ネットワーク宛の経路をAS内に広告します。
  4. AS200およびAS300からの経路をAS400およびAS500に広告します。また,AS内のネットワークをスタティック定義し,AS400およびAS500に広告します。

(3) コンフィグレーション例

[コマンドによる設定]

<本装置A>
 1    (config)# local-address 172.16.2.1
 2    (config)# autonomoussystem 100
 3    (config)# routerid 172.16.2.1
 4    (config)# ospf yes
      [ospf]
 5    (config)# backbone
      [ospf backbone]
 6    (config)# interface 172.16.1.4
      [ospf backbone interface 172.16.1.4]
 7    (config)# exit
      [ospf backbone]
 8    (config)# interface 172.16.1.8
      [ospf backbone interface 172.16.1.8]
 9    (config)# exit
      [ospf backbone]
10    (config)# interface 172.16.1.12
      [ospf backbone interface 172.16.1.12]
11    (config)# exit
      [ospf backbone]
12    (config)# interface 172.16.2.1
      [ospf backbone interface 172.16.2.1]
13    (config)# passive
      [ospf backbone interface 172.16.2.1]
14    (config)# exit
      [ospf backbone]
15    (config)# exit
      [ospf]
16    (config)# exit
17    (config)# bgp yes
      [bgp]
18    (config)# externalpeeras 200
      [bgp externalpeeras 200]
19    (config)# peer 172.17.1.1
      [bgp externalpeeras 200 peer 172.17.1.1]
20    (config)# exit
      [bgp externalpeeras 200]
21    (config)# exit
      [bgp]
22    (config)# routingpeeras 100
      [bgp routingpeeras 100]
23    (config)# lcladdr 172.16.2.1
      [bgp routingpeeras 100]
24    (config)# peer 172.16.2.2
      [bgp routingpeeras 100 peer 172.16.2.2]
25    (config)# exit
      [bgp routingpeeras 100]
26    (config)# peer 172.16.2.3
      [bgp routingpeeras 100 peer 172.16.2.3]
27    (config)# exit
      [bgp routingpeeras 100]
28    (config)# peer 172.16.2.4
      [bgp routingpeeras 100 peer 172.16.2.4]
29    (config)# exit
      [bgp routingpeeras 100]
30    (config)# exit
      [bgp]
31    (config)# exit
32    (config)# attribute-list set-attribute 10
      [attribute-list set-attribute 10]
33    (config)# localpref 300
      [attribute-list set-attribute 10]
34    (config)# exit
35    (config)# import proto bgp peer 172.17.1.1 set-attribute 10
      [import proto bgp peer 172.17.1.1 set-attribute 10]
36    (config)# exit
37    (config)# export proto bgp as 100
      [export proto bgp as 100]
38    (config)# proto bgp peer 172.17.1.1
      [export proto bgp as 100 proto bgp peer 172.17.1.1]
39    (config)# exit
      [export proto bgp as 100]
40    (config)# exit
41    (config)# static
      [static]
42    (config)# 172.16.0.0 mask 255.255.0.0 interface null
      [static]
43    (config)# exit
44    (config)# export proto bgp peer 172.17.1.1
      [export proto bgp peer 172.17.1.1]
45    (config)# proto static
      [export proto bgp peer 172.17.1.1 proto static]
46    (config)# 172.16.0.0 mask 255.255.0.0 exact
      [export proto bgp peer 172.17.1.1 proto static]
47    (config)# exit
      [export proto bgp peer 172.17.1.1]
48    (config)# exit
49    (config)# attribute-list attribute-filter 10
      [attribute-list attribute-filter 10]
50    (config)# aspath-regexp "(^400_|^500_)"
      [attribute-list attribute-filter 10]
51    (config)# exit
52    (config)# export proto bgp peer 172.17.1.1
      [export proto bgp peer 172.17.1.1]
53    (config)# proto bgp attribute-filter 10
      [export proto bgp peer 172.17.1.1 proto bgp attribute-filter 10]
54    (config)# exit
      [export proto bgp peer 172.17.1.1]
55    (config)# exit

表9-66 本装置Aのコンフィグレーション解説

解説番号 解説
1 自装置アドレスを定義します。
2 自装置の属するAS番号を定義します。
3 自装置のルータIDを定義します。
4〜11 自AS内向けの各インタフェースでOSPFを定義します。
12〜16 自装置アドレスをOSPFインタフェースとして広告することを定義します。
17〜21 BGP4プロトコルを動作させることを定義します。また,AS200に対する外部ピアを定義します。
22,23 内部ピアでの自装置側ピアリングアドレスに自装置アドレスを使用することを定義します。
24〜31 本装置B,C,Dへの内部ピアを定義します。
32〜36 AS200から受信した経路のLOCALPREF値を300にするよう定義します。
37〜40 AS200から受信した経路をAS内の内部ピアに広告するよう定義します。
41〜43 AS内のネットワークをスタティック経路として定義します。
44〜55 生成したスタティック経路,AS400から受信した経路,AS500から受信した経路をAS200との外部ピアに広告するよう定義します。

<本装置B>
 1    (config)# local-address 172.16.2.2
 2    (config)# autonomoussystem 100
 3    (config)# routerid 172.16.2.2
 4    (config)# ospf yes
      [ospf]
 5    (config)# backbone
      [ospf backbone]
 6    (config)# interface 172.16.1.3
      [ospf backbone interface 172.16.1.3]
 7    (config)# exit
      [ospf backbone]
 8    (config)# interface 172.16.1.10
      [ospf backbone interface 172.16.1.10]
 9    (config)# exit
      [ospf backbone]
10    (config)# interface 172.16.1.14
      [ospf backbone interface 172.16.1.14]
11    (config)# exit
      [ospf backbone]
12    (config)# interface 172.16.2.2
      [ospf backbone interface 172.16.2.2]
13    (config)# passive
      [ospf backbone interface 172.16.2.2]
14    (config)# exit
      [ospf backbone]
15    (config)# exit
      [ospf]
16    (config)# exit
17    (config)# bgp yes
      [bgp]
18    (config)# externalpeeras 300
      [bgp externalpeeras 300]
19    (config)# peer 172.18.1.1
      [bgp externalpeeras 300 peer 172.18.1.1]
20    (config)# exit
      [bgp externalpeeras 300]
21    (config)# exit
      [bgp]
22    (config)# routingpeeras 100
      [bgp routingpeeras 100]
23    (config)# lcladdr 172.16.2.2
      [bgp routingpeeras 100]
24    (config)# peer 172.16.2.1
      [bgp routingpeeras 100 peer 172.16.2.1]
25    (config)# exit
      [bgp routingpeeras 100]
26    (config)# peer 172.16.2.3
      [bgp routingpeeras 100 peer 172.16.2.3]
27    (config)# exit
      [bgp routingpeeras 100]
28    (config)# peer 172.16.2.4
      [bgp routingpeeras 100 peer 172.16.2.4]
29    (config)# exit
      [bgp routingpeeras 100]
30    (config)# exit
      [bgp]
31    (config)# exit
32    (config)# attribute-list set-attribute 10
      [attribute-list set-attribute 10]
33    (config)# localpref 200
      [attribute-list set-attribute 10]
34    (config)# exit
35    (config)# import proto bgp peer 172.18.1.1 set-attribute 10
      [import proto bgp peer 172.18.1.1 set-attribute 10]
36    (config)# exit
37    (config)# export proto bgp as 100
      [export proto bgp as 100]
38    (config)# proto bgp peer 172.18.1.1
      [export proto bgp as 100 proto bgp peer 172.18.1.1]
39    (config)# exit
      [export proto bgp as 100]
40    (config)# exit
41    (config)# static
      [static]
42    (config)# 172.16.0.0 mask 255.255.0.0 interface null
      [static]
43    (config)# exit
44    (config)# export proto bgp peer 172.18.1.1
      [export proto bgp peer 172.18.1.1]
45    (config)# proto static
      [export proto bgp peer 172.18.1.1 proto static]
46    (config)# 172.16.0.0 mask 255.255.0.0 exact
      [export proto bgp peer 172.18.1.1 proto static]
47    (config)# exit
      [export proto bgp peer 172.18.1.1]
48    (config)# exit
49    (config)# attribute-list attribute-filter 10
      [attribute-list attribute-filter 10]
50    (config)# aspath-regexp "(^400_|^500_)"
      [attribute-list attribute-filter 10]
51    (config)# exit
52    (config)# export proto bgp peer 172.18.1.1
      [export proto bgp peer 172.18.1.1]
53    (config)# proto bgp attribute-filter 10
      [export proto bgp peer 172.18.1.1 proto bgp attribute-filter 10]
54    (config)# exit
      [export proto bgp peer 172.18.1.1]
55    (config)# exit

表9-67 本装置Bのコンフィグレーション解説

解説番号 解説
1〜16 <本装置A>の解説番号1〜16に同じ
17〜21 BGP4プロトコルを動作させることを定義します。また,AS300に対する外部ピアを定義します。
22,23 内部ピアでの自装置側ピアリングアドレスに自装置アドレスを使用することを定義します。
24〜31 本装置A,C,Dへの内部ピアを定義します。
32〜36 AS300から受信した経路のLOCALPREF値を200にするよう定義します。
37〜40 AS300から受信した経路をAS内の内部ピアに広告するよう定義します。
41〜43 AS内のネットワークをスタティック経路として定義します。
44〜55 生成したスタティック経路,AS400から受信した経路,AS500から受信した経路をAS300との外部ピアに広告するよう定義します。

<本装置C>
 1    (config)# local-address 172.16.2.3
 2    (config)# autonomoussystem 100
 3    (config)# routerid 172.16.2.3
 4    (config)# ospf yes
      [ospf]
 5    (config)# backbone
      [ospf backbone]
 6    (config)# interface 172.16.1.6
      [ospf backbone interface 172.16.1.6]
 7    (config)# exit
      [ospf backbone]
 8    (config)# interface 172.16.1.7
      [ospf backbone interface 172.16.1.7]
 9    (config)# exit
      [ospf backbone]
10    (config)# interface 172.16.1.13
      [ospf backbone interface 172.16.1.13]
11    (config)# exit
      [ospf backbone]
12    (config)# interface 172.16.2.3
      [ospf backbone interface 172.16.2.3]
13    (config)# passive
      [ospf backbone interface 172.16.2.3]
14    (config)# exit
      [ospf backbone]
15    (config)# exit
      [ospf]
16    (config)# exit
17    (config)# bgp yes
      [bgp]
18    (config)# externalpeeras 400
      [bgp externalpeeras 400]
19    (config)# peer 172.19.1.1
      [bgp externalpeeras 400 peer 172.19.1.1]
20    (config)# exit
      [bgp externalpeeras 400]
21    (config)# exit
      [bgp]
22    (config)# routingpeeras 100
      [bgp routingpeeras 100]
23    (config)# lcladdr 172.16.2.3
      [bgp routingpeeras 100]
24    (config)# peer 172.16.2.1
      [bgp routingpeeras 100 peer 172.16.2.1]
25    (config)# exit
      [bgp routingpeeras 100]
26    (config)# peer 172.16.2.2
      [bgp routingpeeras 100 peer 172.16.2.2]
27    (config)# exit
      [bgp routingpeeras 100]
28    (config)# peer 172.16.2.4
      [bgp routingpeeras 100 peer 172.16.2.4]
29    (config)# exit
      [bgp routingpeeras 100]
30    (config)# exit
      [bgp]
31    (config)# exit
32    (config)# attribute-list attribute-filter 10
      [attribute-list attribute-filter 10]
33    (config)# aspath-regexp "^400$"
      [attribute-list attribute-filter 10]
34    (config)# exit
35    (config)# attribute-list set-attribute 10
      [attribute-list set-attribute 10]
36    (config)# localpref 400
      [attribute-list set-attribute 10]
37    (config)# exit
38    (config)# import proto bgp peer 172.19.1.1 attribute-filter 10
                set-attribute 10
      [import proto bgp peer 172.19.1.1 attribute-filter 10
       set-attribute 10]
39    (config)# 192.19.0.0 masklen 16
      [import proto bgp peer 172.19.1.1 attribute-filter 10
       set-attribute 10]
40    (config)# exit
41    (config)# import proto bgp peer 172.19.1.1 restrict
42    (config)# export proto bgp as 100
      [export proto bgp as 100]
43    (config)# proto bgp peer 172.19.1.1
      [export proto bgp as 100 proto bgp peer 172.19.1.1]
44    (config)# exit
      [export proto bgp as 100]
45    (config)# exit
46    (config)# static
      [static]
47    (config)# 172.16.0.0/16 interface null
      [static]
48    (config)# exit
49    (config)# export proto bgp peer 172.19.1.1
      [export proto bgp peer 172.19.1.1]
50    (config)# proto static
      [export proto bgp peer 172.19.1.1 proto static]
51    (config)# 172.16.0.0/16 exact
      [export proto bgp peer 172.19.1.1 proto static]
52    (config)# exit
      [export proto bgp peer 172.19.1.1]
53    (config)# proto bgp as 100
      [export proto bgp peer 172.19.1.1 proto bgp as 100]
54    (config)# exit
      [export proto bgp peer 172.19.1.1]
55    (config)# exit

表9-68 本装置Cのコンフィグレーション解説

解説番号 解説
1〜16 <本装置A>の解説番号1〜16に同じ
17〜21 BGP4プロトコルを動作させることを定義します。また,AS400に対する外部ピアを定義します。
22,23 内部ピアでの自装置側ピアリングアドレスに自装置アドレスを使用することを定義します。
24〜31 本装置A,B,Dへの内部ピアを定義します。
32〜41 AS400から受信する経路をASPATH:400,ネットワーク:192.19.0.0/16に限定し,当該経路のLOCALPREF値を400にするよう定義します。
42〜45 AS400から受信した経路をAS内の内部ピアに広告するよう定義します。
46〜48 AS内のネットワークをスタティック経路として定義します。
49〜55 生成したスタティック経路,AS200,AS300,AS500から受信した経路をAS400との外部ピアに広告するよう定義します。

<本装置D>
 1    (config)# local-address 172.16.2.4
 2    (config)# autonomoussystem 100
 3    (config)# routerid 172.16.2.4
 4    (config)# ospf yes
      [ospf]
 5    (config)# backbone
      [ospf backbone]
 6    (config)# interface 172.16.1.5
      [ospf backbone interface 172.16.1.5]
 7    (config)# exit
      [ospf backbone]
 8    (config)# interface 172.16.1.9
      [ospf backbone interface 172.16.1.9]
 9    (config)# exit
      [ospf backbone]
10    (config)# interface 172.16.1.11
      [ospf backbone interface 172.16.1.11]
11    (config)# exit
      [ospf backbone]
12    (config)# interface 172.16.2.4
      [ospf backbone interface 172.16.2.4]
13    (config)# passive
      [ospf backbone interface 172.16.2.4]
14    (config)# exit
      [ospf backbone]
15    (config)# exit
      [ospf]
16    (config)# exit
17    (config)# bgp yes
      [bgp]
18    (config)# externalpeeras 500
      [bgp externalpeeras 500]
19    (config)# peer 172.20.1.1
      [bgp externalpeeras 500 peer 172.20.1.1]
20    (config)# exit
      [bgp externalpeeras 500]
21    (config)# exit
      [bgp]
22    (config)# routingpeeras 100
      [bgp routingpeeras 100]
23    (config)# lcladdr 172.16.2.4
      [bgp routingpeeras 100]
24    (config)# peer 172.16.2.1
      [bgp routingpeeras 100 peer 172.16.2.1]
25    (config)# exit
      [bgp routingpeeras 100]
26    (config)# peer 172.16.2.2
      [bgp routingpeeras 100 peer 172.16.2.2]
27    (config)# exit
      [bgp routingpeeras 100]
28    (config)# peer 172.16.2.3
      [bgp routingpeeras 100 peer 172.16.2.3]
29    (config)# exit
      [bgp routingpeeras 100]
30    (config)# exit
      [bgp]
31    (config)# exit
32    (config)# attribute-list attribute-filter 10
      [attribute-list attribute-filter 10]
33    (config)# aspath-regexp "^500$"
      [attribute-list attribute-filter 10]
34    (config)# exit
35    (config)# attribute-list set-attribute 10
      [attribute-list set-attribute 10]
36    (config)# localpref 400
      [attribute-list set-attribute 10]
37    (config)# exit
38    (config)# import proto bgp peer 172.20.1.1 attribute-filter 10
                set-attribute 10
      [import proto bgp peer 172.20.1.1 attribute-filter 10
       set-attribute 10]
39    (config)# 192.20.0.0 masklen 16
      [import proto bgp peer 172.20.1.1 attribute-filter 10
       set-attribute 10]
40    (config)# exit
41    (config)# import proto bgp peer 172.20.1.1 restrict
42    (config)# export proto bgp as 100
      [export proto bgp as 100]
43    (config)# proto bgp peer 172.20.1.1
      [export proto bgp as 100 proto bgp peer 172.20.1.1]
44    (config)# exit
      [export proto bgp as 100]
45    (config)# exit
46    (config)# static
      [static]
47    (config)# 172.16.0.0/16 interface null
      [static]
48    (config)# exit
49    (config)# export proto bgp peer 172.20.1.1
      [export proto bgp peer 172.20.1.1]
50    (config)# proto static
      [export proto bgp peer 172.20.1.1 proto static]
51    (config)# 172.16.0.0/16 exact
      [export proto bgp peer 172.20.1.1 proto static]
52    (config)# exit
      [export proto bgp peer 172.20.1.1]
53    (config)# proto bgp as 100
      [export proto bgp peer 172.20.1.1 proto bgp as 100]
54    (config)# exit
      [export proto bgp peer 172.20.1.1]
55    (config)# exit

表9-69 本装置Dのコンフィグレーション解説

解説番号 解説
1〜16 <本装置A>の解説番号1〜16に同じ
17〜21 BGP4プロトコルを動作させることを定義します。また,AS500に対する外部ピアを定義します。
22,23 内部ピアでの自装置側ピアリングアドレスに自装置アドレスを使用することを定義します。
24〜31 本装置A,B,Cへの内部ピアを定義します。
32〜41 AS500から受信する経路をASPATH:500,ネットワーク:192.20.0.0/16に限定し,当該経路のLOCALPREF値を400にするよう定義します。
42〜45 AS500から受信した経路をAS内の内部ピアに広告するよう定義します。
46〜48 AS内のネットワークをスタティック経路として定義します。
49〜55 生成したスタティック経路,AS200,AS300,AS400から受信した経路をAS500との外部ピアに広告するよう定義します。

[コンフィグレーションの表示]

<本装置A>
local-address 172.16.2.1
!
autonomoussystem 100
!
routerid 172.16.2.1
!
ospf yes
  backbone
    interface 172.16.1.4
    interface 172.16.1.8
    interface 172.16.1.12
    interface 172.16.2.1
      passive
!
bgp yes
  routingpeeras 100
    lcladdr 172.16.2.1
    peer 172.16.2.2
    peer 172.16.2.3
    peer 172.16.2.4
  externalpeeras 200
    peer 172.17.1.1
!
static
  172.16.0.0 mask 255.255.0.0 interface null
!
attribute-list set-attribute 10
  localpref 300
!
attribute-list attribute-filter 10
  aspath-regexp "(^400_|^500_)"
!
import proto bgp peer 172.17.1.1 set-attribute 10
!
export proto bgp peer 172.17.1.1
  proto static
    172.16.0.0 mask 255.255.0.0 exact
  proto bgp attribute-filter 10
!
export proto bgp as 100
  proto bgp peer 172.17.1.1

<本装置B>
local-address 172.16.2.2
!
autonomoussystem 100
!
routerid 172.16.2.2
!
ospf yes
  backbone
    interface 172.16.1.3
    interface 172.16.1.10
    interface 172.16.1.14
    interface 172.16.2.2
      passive
!
bgp yes
  routingpeeras 100
    lcladdr 172.16.2.2
    peer 172.16.2.1
    peer 172.16.2.3
    peer 172.16.2.4
  externalpeeras 300
    peer 172.18.1.1
!
static
  172.16.0.0 mask 255.255.0.0 interface null
!
attribute-list set-attribute 10
  localpref 200
!
attribute-list attribute-filter 10
  aspath-regexp "(^400_|^500_)"
!
import proto bgp peer 172.18.1.1 set-attribute 10
!
export proto bgp peer 172.18.1.1
  proto static
    172.16.0.0 mask 255.255.0.0 exact
  proto bgp attribute-filter 10
!
export proto bgp as 100
  proto bgp peer 172.18.1.1

<本装置C>
local-address 172.16.2.3
!
autonomoussystem 100
!
routerid 172.16.2.3
!
ospf yes
  backbone
    interface 172.16.1.6
    interface 172.16.1.7
    interface 172.16.1.13
    interface 172.16.2.3
      passive
!
bgp yes
  routingpeeras 100
    lcladdr 172.16.2.3
    peer 172.16.2.1
    peer 172.16.2.2
    peer 172.16.2.4
  externalpeeras 400
    peer 172.19.1.1
!
static
  172.16.0.0/16 interface null
!
attribute-list set-attribute 10
  localpref 400
!
attribute-list attribute-filter 10
  aspath-regexp "^400$"
!
import proto bgp peer 172.19.1.1 attribute-filter 10 set-attribute 10
  192.19.0.0 masklen 16
!
import proto bgp peer 172.19.1.1 restrict
!
export proto bgp peer 172.19.1.1
  proto static
    172.16.0.0/16 exact
  proto bgp as 100
!
export proto bgp as 100
  proto bgp peer 172.19.1.1

<本装置D>
local-address 172.16.2.4
!
autonomoussystem 100
!
routerid 172.16.2.4
!
ospf yes
  backbone
    interface 172.16.1.5
    interface 172.16.1.9
    interface 172.16.1.11
    interface 172.16.2.4
      passive
!
bgp yes
  routingpeeras 100
    lcladdr 172.16.2.4
    peer 172.16.2.1
    peer 172.16.2.2
    peer 172.16.2.3
  externalpeeras 500
    peer 172.20.1.1
!
static
  172.16.0.0/16 interface null
!
attribute-list set-attribute 10
  localpref 400
!
attribute-list attribute-filter 10
  aspath-regexp "^500$"
!
import proto bgp peer 172.20.1.1 attribute-filter 10 set-attribute 10
  192.20.0.0 masklen 16
!
import proto bgp peer 172.20.1.1 restrict
!
export proto bgp peer 172.20.1.1
  proto static
    172.16.0.0/16 exact
  proto bgp as 100
!
export proto bgp as 100
  proto bgp peer 172.20.1.1

[目次][前へ][次へ]


[他社商品名称に関する表示]

Copyright (c)2005, 2011, ALAXALA Networks Corporation. All rights reserved.