今回やること
前回引き続きBGPで構築していこうと思います。
コマンドも忘れてしまっているため、手探り感がありますがなんとか構築できればと思います。
前回の記事はこちら
⇒【前編】ネットワーク構築(BGP)
使用ツール
GNS3
IOS: c2600-adventerprisek9-mz.124-17
ネットワーク構成図
構築
では構築してみようと思います。
今回設定する内容は以下
1、各インターフェイス設定
2、デフォルトルート設定
3、BGP設定
4、自動集約無効
5、同期無効
6、ルータID付与
7、ネイバー設定
8、ネットワーク設定
まずはR1からやっていきます。
まずはデフォルトルート設定まで投入。
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int l0
R1(config-if)#
*Mar 1 00:07:01.122: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip add 10.0.0.1 255.255.255.255
R1(config-if)#exit
R1(config)#int f0/1
R1(config-if)#ip add 192.168.12.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#
*Mar 1 00:07:37.153: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar 1 00:07:38.155: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2
R1(config)#
そしてBGPの設定を投入していきます。
R1(config)#router bgp 10
R1(config-router)#no auto
R1(config-router)#no au
R1(config-router)#no syn
R1(config-router)#no synchronization
R1(config-router)#bgp router
R1(config-router)#bgp router-id 1.1.1.1
R1(config-router)#nei 192.168.12.2 remo
R1(config-router)#nei 192.168.12.2 remote
R1(config-router)#nei 192.168.12.2 remote-as 20
R1(config-router)#network 10.0.0.1 mask 255.255.255.255
R1(config-router)#end
R1#
*Mar 1 00:13:30.316: %SYS-5-CONFIG_I: Configured from console by console
R1#
次にR2の設定です。
流れは同じですがAS10とAS20両方の投入をしないといけません。
R1とのeBGPの確立とR3とのiBGPの確立ですね。
ログを一気に貼ります。
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int f0/0
R2(config-if)#ip add 192.168.12.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#
*Mar 1 00:17:29.219: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:17:30.221: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config)#int f0/1
R2(config-if)#ip add 192.168.23.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
*Mar 1 00:18:05.868: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar 1 00:18:06.869: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R2(config-if)#exit
R2(config)#router bgp 20
R2(config-router)#no au
R2(config-router)#no syn
R2(config-router)#bgp rou
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#nei 192.168.12.1 remo
R2(config-router)#nei 192.168.12.1 remot
R2(config-router)#nei 192.168.12.1 remote-as 10
R2(config-router)#nei 192.168.23.3
*Mar 1 00:20:39.375: %BGP-5-ADJCHANGE: neighbor 192.168.12.1 Up
R2(config-router)#nei 192.168.23.3 remot 20
R2(config-router)#end]
^
% Invalid input detected at '^' marker.
R2(config-router)#end
R2#
最後にR3の設定です。
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#int f0/0
R3(config-if)#ip add 192.168.23.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#
*Mar 1 00:22:34.540: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 1 00:22:35.542: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config)#router bgp 20
R3(config-router)#no su
^
% Invalid input detected at '^' marker.
R3(config-router)#no au
R3(config-router)#no sy
R3(config-router)#nei 192.168.23.2 remot 20
R3(config-router)#end
R3#
では設定投入完了したので、状態を見てみましょう。
状態確認
まずはピアが確立しているか見てみます。
R2#show ip bgp summary
BGP router identifier 2.2.2.2, local AS number 20
BGP table version is 2, main routing table version 2
1 network entries using 117 bytes of memory
1 path entries using 52 bytes of memory
2/1 BGP path/bestpath attribute entries using 248 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 441 total bytes of memory
BGP activity 1/0 prefixes, 1/0 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.12.1 4 10 8 7 2 0 0 00:03:51 1
192.168.23.3 4 20 4 5 2 0 0 00:00:58 0
R2#
見た感じAS10とAS20両方割当たっているので、OKそうですね。
次にBGPテーブルを見てみます。
R3#show ip bgp
BGP table version is 1, local router ID is 192.168.23.3
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
* i10.0.0.1/32 192.168.12.1 0 100 0 10 i
R3#
BGPテーブルを見るとR1のLoopback0までのルートが載ってますね。
ルーティングテーブルも見てみます。
R3#show ip route bgp
R3#
あれ・・・
何もでないですね。
なぜだろう。
ping打ってみます。
R3#ping 10.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R3#
飛ばない!
分からない!!
【調べ中・・・】
どうやらR3にスタティックで設定が必要っぽい?
R1の12.1までのルーティングができていないっぽいです。
試しに投入してみます。
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#ip route 192.168.12.0 255.255.255.0 192.168.23.2
R3(config)#end
R3#
さすがにスタティックでいれているからルートはでるはず。
見てみます。
R3#show ip route bgp
10.0.0.0/32 is subnetted, 1 subnets
B 10.0.0.1 [200/0] via 192.168.12.1, 00:00:19
R3#
でました。
pingも打ってみます。
R3#ping 10.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/48/56 ms
R3#
よし、飛びますね。
これで設定が完了しました。
まとめ
いやー、BGP難しいですね。
基本設定だけでも時間がだいぶかかりました。
前回で概要は理解していますが、構築するとなるとうまくいかないものですね。
机上で理解したつもりでも、いざコマンド叩いてみると知識不足を痛感します。
これはもっと構築していって、コマンドを叩いて覚えようと思います。
しばらくBGPやらないとですかね・・・
VPNも構築してみたいなー。
以上となります。