質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Cisco IOS

Cisco IOSは、シスコシステムズ社が提供しているOSです。同社のほとんどのルーターやスイッチに使用されており、特徴のあるコマンドラインインターフェースをもちます。実行操作に制限があるユーザーモードと特権モードのセキュリティレベルがあります。

Cisco

シスコ(Cisco Systems,Inc.)は、アメリカ合衆国に本社を置く、世界最大のコンピュータネットワーク機器開発会社及び同社の製品

Q&A

1回答

3546閲覧

【BGP】正常にアドバタイズされない&AS間の疎通不可

narururu

総合スコア170

Cisco IOS

Cisco IOSは、シスコシステムズ社が提供しているOSです。同社のほとんどのルーターやスイッチに使用されており、特徴のあるコマンドラインインターフェースをもちます。実行操作に制限があるユーザーモードと特権モードのセキュリティレベルがあります。

Cisco

シスコ(Cisco Systems,Inc.)は、アメリカ合衆国に本社を置く、世界最大のコンピュータネットワーク機器開発会社及び同社の製品

0グッド

1クリップ

投稿2018/02/10 06:56

編集2018/02/10 07:06

###環境
GNS3
イメージ説明

###現状
AS1内/AS2内の疎通はできてる。
AS1←→AS2間の疎通はできない。(R1とR5は疎通可)
R1←→R5間のループバックアドレスによる疎通できてる。
R1のルーティングテーブル/BGPテーブルには10.0.0.0/24だけでなく、172.16.1.0/24もBGPによりアドバタイズされると想像していたが、されていない。
R5のルーティングテーブル/BGPテーブルには想定通り192.168.2.0/24がBGPによりアドバタイズされている。

R1#sho ip route Gateway of last resort is not set 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 100.0.0.0/24 is subnetted, 1 subnets C 100.100.0.0 is directly connected, FastEthernet1/5 5.0.0.0/32 is subnetted, 1 subnets S 5.5.5.5 [1/0] via 100.100.0.5 10.0.0.0/24 is subnetted, 1 subnets B 10.0.0.0 [20/0] via 100.100.0.5, 00:50:47 C 192.168.0.0/24 is directly connected, FastEthernet1/2 C 192.168.1.0/24 is directly connected, FastEthernet1/3 O 192.168.2.0/24 [110/2] via 192.168.0.2, 01:14:55, FastEthernet1/2
R5#show ip route Gateway of last resort is not set 1.0.0.0/32 is subnetted, 1 subnets S 1.1.1.1 [1/0] via 100.100.0.1 100.0.0.0/24 is subnetted, 1 subnets C 100.100.0.0 is directly connected, FastEthernet1/5 5.0.0.0/32 is subnetted, 1 subnets C 5.5.5.5 is directly connected, Loopback0 R 172.16.0.0/16 [120/1] via 10.0.0.7, 00:01:06, FastEthernet1/7 10.0.0.0/24 is subnetted, 1 subnets C 10.0.0.0 is directly connected, FastEthernet1/7 B 192.168.2.0/24 [20/2] via 100.100.0.1, 00:16:47
R1#show ip bgp BGP table version is 9, local router ID is 1.1.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 10.0.0.0/24 5.5.5.5 0 0 2 i * 100.100.0.5 0 0 2 i *> 192.168.2.0 192.168.0.2 2 32768 i
R5#show ip bgp BGP table version is 9, local router ID is 5.5.5.5 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 10.0.0.0/24 0.0.0.0 0 32768 i *> 192.168.2.0 1.1.1.1 2 0 1 i * 100.100.0.1 2 0 1 i
R1#show run Building configuration... Current configuration : 2178 bytes ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! no aaa new-model memory-size iomem 5 no ip icmp rate-limit unreachable ip cef ! ! ! ! no ip domain lookup ip auth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ip tcp synwait-time 5 ! ! ! ! ! interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface FastEthernet0/0 no ip address shutdown duplex auto speed auto ! interface Serial0/0 no ip address shutdown clock rate 2000000 ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface Serial0/1 no ip address shutdown clock rate 2000000 ! interface Serial0/2 no ip address shutdown clock rate 2000000 ! interface FastEthernet1/0 ! interface FastEthernet1/1 ! interface FastEthernet1/2 no switchport ip address 192.168.0.1 255.255.255.0 ! interface FastEthernet1/3 no switchport ip address 192.168.1.1 255.255.255.0 ! interface FastEthernet1/4 ! interface FastEthernet1/5 no switchport ip address 100.100.0.1 255.255.255.0 ! interface FastEthernet1/6 ! interface FastEthernet1/7 ! interface FastEthernet1/8 ! interface FastEthernet1/9 ! interface FastEthernet1/10 ! interface FastEthernet1/11 ! interface FastEthernet1/12 ! interface FastEthernet1/13 ! interface FastEthernet1/14 ! interface FastEthernet1/15 ! interface Vlan1 no ip address ! router ospf 1 log-adjacency-changes network 192.168.0.1 0.0.0.0 area 0 network 192.168.1.1 0.0.0.0 area 0 ! router bgp 1 no synchronization bgp log-neighbor-changes network 192.168.2.0 neighbor 5.5.5.5 remote-as 2 neighbor 5.5.5.5 ebgp-multihop 2 neighbor 5.5.5.5 update-source Loopback0 neighbor 100.100.0.5 remote-as 2 no auto-summary ! ip forward-protocol nd ip route 5.5.5.5 255.255.255.255 100.100.0.5 ! ! no ip http server no ip http secure-server ! no cdp log mismatch duplex ! ! ! control-plane ! ! ! ! ! ! ! ! ! ! line con 0 exec-timeout 0 0 privilege level 15 logging synchronous line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous line vty 0 4 login ! ! end
R5#show run Building configuration... Current configuration : 2108 bytes ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R5 ! boot-start-marker boot-end-marker ! ! no aaa new-model memory-size iomem 5 no ip icmp rate-limit unreachable ip cef ! ! ! ! no ip domain lookup ip auth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ip tcp synwait-time 5 ! ! ! ! ! interface Loopback0 ip address 5.5.5.5 255.255.255.255 ! interface FastEthernet0/0 no ip address shutdown duplex auto speed auto ! interface Serial0/0 no ip address shutdown clock rate 2000000 ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface Serial0/1 no ip address shutdown clock rate 2000000 ! interface Serial0/2 no ip address shutdown clock rate 2000000 ! interface FastEthernet1/0 ! interface FastEthernet1/1 ! interface FastEthernet1/2 ! interface FastEthernet1/3 ! interface FastEthernet1/4 ! interface FastEthernet1/5 no switchport ip address 100.100.0.5 255.255.255.0 ! interface FastEthernet1/6 ! interface FastEthernet1/7 no switchport ip address 10.0.0.5 255.255.255.0 ! interface FastEthernet1/8 ! interface FastEthernet1/9 ! interface FastEthernet1/10 ! interface FastEthernet1/11 ! interface FastEthernet1/12 ! interface FastEthernet1/13 ! interface FastEthernet1/14 ! interface FastEthernet1/15 ! interface Vlan1 no ip address ! router rip version 2 network 10.0.0.0 ! router bgp 2 no synchronization bgp log-neighbor-changes network 10.0.0.0 mask 255.255.255.0 network 172.16.1.0 mask 255.255.255.0 neighbor 1.1.1.1 remote-as 1 neighbor 1.1.1.1 ebgp-multihop 2 neighbor 1.1.1.1 update-source Loopback0 neighbor 100.100.0.1 remote-as 1 no auto-summary ! ip forward-protocol nd ip route 1.1.1.1 255.255.255.255 100.100.0.1 ! ! no ip http server no ip http secure-server ! no cdp log mismatch duplex ! ! ! control-plane ! ! ! ! ! ! ! ! ! ! line con 0 exec-timeout 0 0 privilege level 15 logging synchronous line aux 0 exec-timeout 0 0 privilege level 15 logging synchronous line vty 0 4 login ! ! end

###実現したいこと
AS間での疎通ができるようにしたい。
R1のルーティングテーブル/BGPテーブルに172.16.1.0/24が表示されるようにしたい。

以上の情報で何か原因が分かる方いらっしゃいましたらアドバイスいただけると助かります。
よろしくお願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

すいませんが検証してません。
たぶんあってると思います。

■原因
①R5の172.16.1.0/24はRIPv1によりクラスフルで学習しているため172.16.0.0/16として学習している
R5のルーティングテーブルを見てください。
172.16.0.0/16 で登録されていますね。
これは172.16.1.0/24はRIPv1によるルーティング学習を行っているからだと思います。
RIPv1はクラスフルなので172.16-31.x.x(クラスB)のサブネットは/16で固定されます。

②R5は存在しない172.16.1.0/24を配信している
①の理由により存在しない172.16.1.0/24をBGPのnetworkコマンドで配信しようとしていますね。
その証拠にR5のBGPテーブルには172.16.1.0/24は存在しません。

■解決策(いくつか策はあると思うが思いついたもの)
A.RIPをv2にしてクラスレスで学習する
RIPv1はクラスフルでしか学習できませんが、RIPv2ならクラスレスでルーティングを学習できます。
やり方はripにversion2っていれるだけっぽいです。
http://www.infraexpert.com/study/distancevector6.html

B.172.16.1.0/24はRIPはやめてスタティックとが別のルーティングプロトコルにする
上記のとおりです。コマンドは簡単で以下でよいと思います。
no router rip
ip route 172.16.1.0 255.255.255.0 10.0.0.7

とにかくうまくいけば、まずR5のshow ip route と show ip bgp に172.16.1.0/24が登録されるはずです。

投稿2018/02/10 15:19

taichi_0807

総合スコア252

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

narururu

2018/02/11 13:56 編集

ご回答ありがとうございます。taichiさん☺ いつもお世話になっております。 確かに/16でクラスBで登録されていました。あれれ、おかしいな、わたしversion 2の設定してるのです。 show run で設定を確認してもR5,R7,R8の3つにrouter rip の箇所にversion 2の文字が確認できております。 試しに、 R7(config)#router rip R7(config-router)#no network 172.16.0.0 R7(config-router)#network 172.16.1.0 R7(config-router)#end をしてから再度show runで確認しましたが、結果変わらず router rip version 2 network 10.0.0.0 network 172.16.0.0 でした('_') no router ripで丸ごと削除してから再度作成しても同様に172.16.0.0で登録されてしまいます。 一方、スタティックルートの解決策は、taichiさんのおっしゃる通りの結果になりました。 R5のルーティング/BGPテーブルには172.16.1.0/24が登録されています。 そして、R1のルーティング/BGPテーブルにも172.16.1.0/24が登録されています。 ちゃんとアドバタイズされました! しかし、新たな疑問点が(*_*)スミマセン R1のルーティングテーブルに C 5.5.5.5 is directly connected, Loopback0 172.16.0.0/24 is subnetted, 1 subnets R5のルーティングテーブルに S 5.5.5.5 [1/0] via 100.100.0.5 172.16.0.0/24 is subnetted, 1 subnets が登録されているのです。show runでもripの設定は削除されているのに(>_<) 少し時間をおいて確認しても表示されてしまいます。 なぜ172.16.0.0/24がルーティングテーブルに表示されてしまうのか疑問です。 また、私の認識では、この時点でAS間の疎通が可能だと思っていたのですが、疎通できないのです。 BGPむずかしです('_')プシュー
taichi_0807

2018/02/11 14:10

>> 確かに/16でクラスBで登録されていました。あれれ、おかしいな、わたしversion 2の設定してるのです。 なんでしょうね。 どこかしらにRIPv1の設定が残っているとか。 clear ip route * とかでルートくらいしないとダメとか。 すいません。原因はよくわからないです。 >> R1のルーティングテーブルに >> C 5.5.5.5 is directly connected, Loopback0 >> 172.16.0.0/24 is subnetted, 1 subnets R5でなくて、R1ですか。 上記のルートはR5のものですよね? 172.16.0.0/24はRIPで学習したもの? であればRIPの設定消したなら消えるはずですけど変ですね。 念のため clear ip route * とかやってみますかね。 >> R5のルーティングテーブルに >> S 5.5.5.5 [1/0] via 100.100.0.5 >> 172.16.0.0/24 is subnetted, 1 subnets 逆にこれはR1ですよね。 >> また、私の認識では、この時点でAS間の疎通が可能だと思っていたのですが、疎通できないのです。 AS間通信とはどの通信でしょうか。 掲載頂いたルーティングテーブルにはお互いのアドレスをBGPで学習できているようです。 R1#sho ip route B 10.0.0.0 [20/0] via 100.100.0.5, 00:50:47 R5#sho ip route B 192.168.2.0/24 [20/2] via 100.100.0.1, 00:16:47 >> BGPむずかしです('_')プシュー BGPだけで専門書やBGPオペレーターなどほ専門職があるくらいですからね。 私もよくわかりません(^^;
narururu

2018/02/12 01:54

ご回答ありがとうございます☺ 【AS2:RIPVer】 clear ip route *で試してみましたが、結果変わらずでした。 とりあえず保留にしておきます。 >>R5でなくて、R1ですか。 >>上記のルートはR5のものですよね? >>逆にこれはR1ですよね。 仰る通りです。私の手違いで逆に記載してしまいました。 大変申し訳ございませんでした。 >>AS間通信とはどの通信でしょうか。 【AS2:スタティックルートVer】 今回のケースでは、R1←→R5間のEBGPにより、 R1は10.0.0.0/24と172.16.1.0/24のアドレスを、 R5は192.168.2.0/24のアドレスを、アドバタイズするように設定しました。 そして実際アドバタイズされております。 BGPの目的は、アドバタイズされた情報を基に、最適経路を選択しパケット転送することだと認識しております。 よって、今回のケースでは2つしかないので最適経路の選択はありませんが、R4←→R5/R7/R8へは疎通可能だと思っております。 しかし、検証したところ R4→R5/R7/R8へは疎通可能ですが、 R4←R5/R7/R8へは疎通できないのです。 双方向で疎通できると思っていたので、なぜ片方向(AS1→AS2)しか疎通できないのか疑問に思っております。
taichi_0807

2018/02/12 14:45

>> R4→R5/R7/R8へは疎通可能ですが、 >> R4←R5/R7/R8へは疎通できないのです。 少なくともR5のルーティングテーブルには192.168.2.0/24が登録されていますが、なぜ疎通できないのでしょうか。 R5→R4でtraceするとどこまで届くのかで問題の切り分けができると思います。
narururu

2018/02/13 13:24 編集

ご回答ありがとうございます。 trace 192.168.2.4で経路を確認したところ、100.100.0.1までしか到達していなかったので改めてshow ip routeでルーティングテーブルを確認すると、192.168.0.0の情報が入っていませんでした。そのため、router bgp 1でnetwork 192.168.0.0 mask 255.255.255.0の設定を追加しました。 これでイケるかなと思ったのですが、結果は残念ながらping届かず('_')100.100.0.1で止まってしまいました('_') この件に関してはしばらく迷宮入りかもしれません。 時間に余裕がありましたら、再度チャレンジしてみます。 いろいろとアドバイスありがとうございました!大変勉強になりました! 引き続き、よろしくお願いいたします!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問