以前、メルマガで「おうちでBGP」と題した
quaggaを使ってBGPを学ぶ、というコーナーを
やってた時期がありました。
あの当時は、タワー型PCや
ベアボーンPCに、LANカードを2枚,3枚挿して、
Red Hat Linuxや
Fedoraなどをインストールし、
quaggaを動かしました。
今は、VMwareがあります。
VMwareの仮想マシン・仮想アダプタで、
BGPやOSPFなどのルーティングを学べます。以前書いていたように、
quaggaのコマンドは、Ciscoのルーターやスイッチの
コマンドと似ています。
(必然的に、Foundaryにも似てるな(^^) )
最近のPCは2GBメモリが当たり前。
ヨドバシなどの家電量販店では、
4GBメモリが当たり前、な時代です。
VMware上の仮想マシンにFedoraをインストールし、
ランレベル3で不要なデーモン類を
片っ端からSTOPさせておけば、
メモリ128MBくらいでも、
大量のBGPスピーカ(BGPを動かしているということ)が
作成できますね。
これは、すごい事です。LinuxとquaggaとVMwareだけで、
BGPやOSPFを、実機操作しながら、
リアルにルーティングできます。
それも、仮想的とはいえ、
数台レベルで回せます。
まあ、VMwareのところで、少してこづりましたが(^^)。
いや、結構、てこづったな(^^)。
一度動かし始めると、
かなりのことができます。
もう1つのブログと連動させつつ、
ネットワークも学べるLinuxというテーマで、
再度、「おうちでBGP」をやりたいと思います。
しかし、quaggaとVMwareは、すごいな。
R1#
show ip bgpBGP table version is 0, local router ID is 192.168.1.20
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i10.10.10.0/24 172.16.1.20 0 100 0 55000 i
*>i172.16.1.0/24 192.168.1.200 0 100 0 i
*> 192.168.0.0 0.0.0.0 0 32768 i
* i192.168.1.0 192.168.1.200 0 100 0 i
*> 0.0.0.0 0 32768 i
Total number of prefixes 4
R1#
show ip bgp neighborsBGP neighbor is 192.168.0.200, remote AS 65000, local AS 60000, external link
BGP version 4, remote router ID 0.0.0.0
BGP state = Active
Last read 00:33:13, hold time is 180, keepalive interval is 60 seconds
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 0 0
Notifications: 0 0
Updates: 0 0
Keepalives: 0 0
Route Refresh: 0 0
Capability: 0 0
Total: 0 0
Minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
Community attribute sent to this neighbor(both)
0 accepted prefixes
Connections established 0; dropped 0
Last reset never
Next connect timer due in 106 seconds
Read thread: off Write thread: off
BGP neighbor is 192.168.1.200, remote AS 60000, local AS 60000, internal link
BGP version 4, remote router ID 192.168.1.200
BGP state = Established, up for 00:19:21
Last read 00:00:20, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family IPv4 Unicast: advertised and received
Message statistics:
Inq depth is 0
Outq depth is 0
Sent Rcvd
Opens: 1 0
Notifications: 0 0
Updates: 1 2
Keepalives: 21 20
Route Refresh: 0 0
Capability: 0 0
Total: 23 22
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
Community attribute sent to this neighbor(both)
3 accepted prefixes
Connections established 1; dropped 0
Last reset never
Local host: 192.168.1.20, Local port: 179
Foreign host: 192.168.1.200, Foreign port: 34905
Nexthop: 192.168.1.20
Nexthop global: fe80::20c:29ff:fee2:6a53
Nexthop local: ::
BGP connection: non shared network
Read thread: on Write thread: off
R1#
show ip bgp scanBGP scan is running
BGP scan interval is 60
Current BGP nexthop cache:
172.16.1.20 valid [IGP metric 0]
192.168.1.200 valid [IGP metric 1]
BGP connected route:
192.168.0.0/24
192.168.1.0/24
R1#
show ip bgp attribute-infoattr[2] nexthop 0.0.0.0
attr[2] nexthop 192.168.1.200
attr[2] nexthop 192.168.1.20
attr[1] nexthop 172.16.1.20
R4# show ip bgp summaryBGP router identifier 192.168.1.200, local AS number 60000
RIB entries 7, using 448 bytes of memory
Peers 2, using 5016 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.16.1.20 4 55000 31 33 0 0 0 00:28:16 2
192.168.1.20 4 60000 31 33 0 0 0 00:28:14 2
Total number of neighbors 2
#
show ip routeCodes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route
K>* 0.0.0.0/0 via 192.168.1.20, eth2
B>* 10.10.10.0/24 [20/0] via 172.16.1.20, eth3, 00:34:38C>* 127.0.0.0/8 is directly connected, lo
K>* 169.254.0.0/16 is directly connected, eth3
C>* 172.16.1.0/24 is directly connected, eth3
B>* 192.168.0.0/24 [200/0] via 192.168.1.20, eth2, 00:34:37C>* 192.168.1.0/24 is directly connected, eth2
アドミニストレーティブディスタンスの
20と200も表示されてますね。
関心のある方は、
yum -y install quagga ですぐにインストールできるので、
試してみて下さい。
ちなみに、bgpdを起動した場合と
zebraデーモンを起動した場合の接続ポートは、
違います。
zebra:2601番ポート
bgpd:2605番ポート
ゆえ、telnet 0 2601 とか telnet 0 2605で
アクセスすることになります。
show ip routeは、2601ポートへのアクセス時に
使用可能です。
show ip bgpとかshow ip bgp summaryなどは、
2605番ポートアクセスト時に、
使用可能です。
既に、Ciscoルーターを触っている人は、
違和感があるかもしれませんが、慣れれば
どうってことありません。
■設定ファイルを作成しておくと
便利です。
/etc/quagga/zebra.conf や
/etc/quagga/bgpd.conf を見ると、
Ciscoを触っていた人は、
理解できると思います。
zebra.confはpassword設定行も書かれていないはずなので、
password zebraなどを記述しておくと
良いでしょう。

徹底攻略 Cisco CCNP ONT 問題集 [642-845J]
出版社:インプレスジャパン
価格:¥3,990(税込)このリンクに「要点解説IPルーティング入門」がありますが、
ルーティング全般をわかりやすく
かつ、実機操作も含んでルーティングを学びたい人は、
まず、オススメです。
最初の1冊としても、長く使うにしても、
すばらしいコストパフォーマンスです。