" />
絶滅したシマウマのこと(ぉぃ。もとい、ルーティングソフトウェア。
一般に利用されているルーティングプロトコルのほとんどを網羅している。IPv6用のそれとしては RIPng BGP4+ OSPFv3 があるが、ここでは RIPng を使用する。ルーティングプロトコル毎にdaemonが分かれているのが特徴。
RPMを作成しませう。
$ tar zxvf quagga-0.99.7.tar.gz $ cp -a quagga-0.99.7/redhat/quagga.spec ~/rpm/SPECS $ vi ~/rpm/SPECS/quagga.spec $ cp -a quagga-0.99.7.tar.gz ~/rpm/SOURCES $ rpmbuild -ba ~/rpm/SPECS/quagga.spec
RPMをインストールする。
$ cd ~/rpm/RPMS/i386 $ sudo rpm -ivh quagga-devel-0.99.7-2007042901.i386.rpm quagga-contrib-0.99.7-2007042901.i386.rpm quagga-0.99.7-2007042901.i386.rpm
RPMをインストールすると、/etc/quagga というディレクトリが作成される。このディレクトリは一般ユーザは参照できない。quagga:quagga だけが参照可能である。(このユーザ/グループの設定もRPMをインストールしたときに追加される)
まず、zebra の設定ファイルを「とりあえず」作成する。後で設定変更するから「とりあえず」である。zebra はルーティングプロトコル毎の処理を統合し、種々の判断を行うdaemonである。ゆえに、zebra daemonは各種ルーティングdaemonを起動する際には、あらかじめ起動しておく必要がある。
sampleファイルをテンプレートとして使用する。
# cp -a /etc/quagga/zebra.conf.sample /etc/quagga/zebra.conf
続いて、ripngd の設定ファイルを作成します。こちらもsampleファイルをテンプレートに使用します。とりあえず、コピーしましょう。
# cp -a /etc/quagga/ripngd.conf.sample /etc/quagga/ripngd.conf
zebra ripngd を起動する。
$ sudo /etc/rc.d/init.d/zebra start $ sudo /etc/rc.d/init.d/ripngd start
今のままでも動きますが、動くだけなので、ある程度きちんとした内容に更新させます。
$ telnet localhost zebra Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Hello, this is Quagga (version 0.99.7). Copyright 1996-2005 Kunihiro Ishiguro, et al. User Access Verification Password: (たぶん zebra ) Router>
VTYへアクセスする際のパスワードを変更します。ついでに暗号化させておきましょう。
Router> enable Password: (たぶん zebra ) Router# configure terminal Router(config)# password hogehoge <--- vty(zebra)にアクセスするためのパスワードを入力してくだされ Router(config)# enable password hogehoge <--- 特権モード(enable)に移るときのパスワードを入力してくだされ Router(config)# service password-encryption Router(config)# write memory Configuration saved to /etc/quagga/zebra.conf Router(config)# exit Router#
とりあえず、ローカルPCからだけアクセスできるように制御リストを作成しましょう。
Router> enable Password: (たぶん hogehoge ) Router# configure terminal Router(config)# access-list LOCALHOST permit 127.0.0.1/32 Router(config)# ipv6 access-list LOCALHOST permit ::1/128 Router(config)# line vty Router(config-line)# access-class LOCALHOST Router(config-line)# exit Router(config)# write memory Configuration saved to /etc/quagga/zebra.conf Router(config)# exit Router#
こんな感じです。特権モードで show running-config でも確認できます。
# cat /etc/quagga/zebra.conf
!
! Zebra configuration saved from vty
! 2007/05/05 03:24:42
!
hostname Router
password 8 {VTYほげほげぇ〜}
enable password 8 {特権モードほげほげぇ〜}
service password-encryption
!
interface eth0
ipv6 nd suppress-ra
!
interface lo
!
interface ppp0
ipv6 nd suppress-ra
!
interface sit0
ipv6 nd suppress-ra
!
interface sit1
ipv6 nd suppress-ra
!
access-list LOCALHOST permit 127.0.0.1/32
!
ipv6 access-list LOCALHOST permit ::1/128
!
!
line vty
access-class LOCALHOST
!
#
今のままでも動きますが、動くだけなので、ある程度きちんとした内容に更新させます。
$ telnet ::1 ripngd Trying ::1... Connected to ::1. Escape character is '^]'. Hello, this is Quagga (version 0.99.7). Copyright 1996-2005 Kunihiro Ishiguro, et al. User Access Verification Password: (たぶん zebra ) ripngd>
VTYへアクセスする際のパスワードを変更します。ついでに暗号化させておきましょう。
Router> enable Password: (たぶん zebra ) Router# configure terminal Router(config)# password hogehoge <--- vty(ripngd)にアクセスするためのパスワードを入力してくだされ Router(config)# enable password hogehoge <--- 特権モード(enable)に移るときのパスワードを入力してくだされ Router(config)# service password-encryption Router(config)# write memory Configuration saved to /etc/quagga/ripngd.conf Router(config)# exit Router#
とりあえず、ローカルPCからだけアクセスできるように制御リストを作成しましょう。
Router> enable Password: (たぶん hogehoge ) Router# configure terminal Router(config)# ipv6 access-list LOCALHOST permit ::1/128 Router(config)# line vty Router(config-line)# access-class LOCALHOST Router(config-line)# exit Router(config)# write memory Configuration saved to /etc/quagga/ripngd.conf Router(config)# exit Router#
以上は前置きであって、これから本番。
ripngd> enable Password: (たぶん hogehoge) ripngd# configure terminal ripngd(config)# router ripng ripngd(config-router)# network sit1 <--- ipv6を外と語り合うI/Fを設定する ripngd(config-router)# aggregate-address 2001:240:50a::/48 <--- 集約経路が不要な方は要らないかも。 ripngd(config-router)# route 2001:240:50a::/48 ripngd(config-router)# exit rpingd(config)# ipv6 prefix-list OUTGOING seq 10 permit 2001:240:50a::/48 <--- へんてこりんな経路情報を上位に漏らさないためのリストの作成 ripngd(config)# ipv6 prefix-list OUTGOING seq 20 deny any ripngd(config)# router ripng ripngd(config-router)# distribute-list prefix OUTGOING out sit1 <--- 作成したリストをI/F(sit1)に適用する ripngd(config-router)# write memory ripngd(config-router)# exit ripngd(config)# exit ripngd#
こんな感じです。特権モードで show running-config でも確認できます。
# cat /etc/quagga/ripngd.conf
!
! Zebra configuration saved from vty
! 2007/05/11 01:20:19
!
hostname ripngd
password 8 {VTYほげほげぇ〜}
enable password 8 {特権モードほげほげぇ〜}
log stdout
service password-encryption
!
router ripng
network sit1
aggregate-address 2001:240:50a::/48
route 2001:240:50a::/48
distribute-list prefix OUTGOING out sit1
!
ipv6 access-list LOCALHOST permit ::1/128
!
ipv6 prefix-list OUTGOING seq 10 permit 2001:240:50a::/48
ipv6 prefix-list OUTGOING seq 20 deny any
!
line vty
access-class LOCALHOST
!
#