2009年6月9日火曜日

quagga on lxc

T/O debian/lenny amd64 でやってみました。こちらにイメージ? 置いときます。/opt/lxc 配下に展開仮定なので fstab を適宜直して使ってやって下さい。# レイノゴトクルートデ....
# seq とゆーもの覚えた。
# for i in `seq 0 7`; do
> br=br${i}
> brctl addbr $br
> brctl setfd $br 0
> brctl stp $br off
> ip link set $br up
> done

# ip link ls | grep "br[0-7]"
630: br0: mtu 1500 qdisc noqueue state UNKNOWN
631: br1: mtu 1500 qdisc noqueue state UNKNOWN
632: br2: mtu 1500 qdisc noqueue state UNKNOWN
633: br3: mtu 1500 qdisc noqueue state UNKNOWN
634: br4: mtu 1500 qdisc noqueue state UNKNOWN
635: br5: mtu 1500 qdisc noqueue state UNKNOWN
636: br6: mtu 1500 qdisc noqueue state UNKNOWN
637: br7: mtu 1500 qdisc noqueue state UNKNOWN
# ip addr add 192.168.200.1/24 dev br0
# pwd
/opt/lxc/quagga
# lxc-execute -n quagga -f lxc-quagga.conf -- /etc/init.d/quagga start &
[1] 5417
# Loading capability module if not yet done.
Starting Quagga daemons (prio:10): zebra ospfd ospf6d.

#
で稼働。起動の仕方がイマイチの気もするけど、まぁ。zebra と ospfd、 ospf6d が起動しているハズです。ホスト側のアドレスはこんな感じ。
# ip addr ls | egrep "(^[0-9]|inet )"
1: lo: mtu 16436 qdisc noqueue state UNKNOWN
inet 127.0.0.1/8 scope host lo
2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
3: sit0: mtu 1480 qdisc noop state DOWN
4: ip6tnl0: mtu 1460 qdisc noop state DOWN
5: wmaster0: <> mtu 0 qdisc noop state DOWN qlen 1000
6: wlan0: mtu 1500 qdisc noop state DOWN qlen 1000
7: vlan10@eth0: mtu 1500 qdisc noqueue state UP
inet 172.27.129.2/24 brd 172.27.129.255 scope global vlan10
8: vlan11@eth0: mtu 1500 qdisc noqueue state UP
inet 192.168.1.3/24 brd 192.168.1.255 scope global vlan11
630: br0: mtu 1500 qdisc noqueue state UNKNOWN
inet 192.168.200.1/24 scope global br0
631: br1: mtu 1500 qdisc noqueue state UNKNOWN
632: br2: mtu 1500 qdisc noqueue state UNKNOWN
....
やっぱりホスト側でも ospfd 動いているので、寂しい経路数ですが....
# telnet 192.168.200.10 zebra
Trying 192.168.200.10...
Connected to 192.168.200.10.
Escape character is '^]'.

Hello, this is Quagga (version 0.99.10).
Copyright 1996-2005 Kunihiro Ishiguro, et al.


User Access Verification

Password:
zebra@quagga> en
Password:
zebra@quagga# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route

C>* 127.0.0.0/8 is directly connected, lo
C>* 192.168.200.0/24 is directly connected, eth0
C>* 192.168.201.0/24 is directly connected, eth1
C>* 192.168.202.0/24 is directly connected, eth2
C>* 192.168.203.0/24 is directly connected, eth3
C>* 192.168.204.0/24 is directly connected, eth4
C>* 192.168.205.0/24 is directly connected, eth5
C>* 192.168.206.0/24 is directly connected, eth6
C>* 192.168.207.0/24 is directly connected, eth7
zebra@quagga#
申し遅れましたが、パスワードは共に zebra です。
# telnet 192.168.200.10 ospfd
Trying 192.168.200.10...
Connected to 192.168.200.10.
Escape character is '^]'.

Hello, this is Quagga (version 0.99.10).
Copyright 1996-2005 Kunihiro Ishiguro, et al.


User Access Verification

Password:
ospfd@quagga> en
Password:
ospfd@quagga# conf t
ospfd@quagga(config)# router ospf
ospfd@quagga(config-router)# network 192.168.200.0/24 area 0.0.0.128
ospfd@quagga(config-router)#
で再度 zebra に
# telnet 192.168.200.10 zebra
Trying 192.168.200.10...
Connected to 192.168.200.10.
Escape character is '^]'.

Hello, this is Quagga (version 0.99.10).
Copyright 1996-2005 Kunihiro Ishiguro, et al.


User Access Verification

Password:
zebra@quagga> en
Password:
zebra@quagga# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
I - ISIS, B - BGP, > - selected route, * - FIB route

C>* 127.0.0.0/8 is directly connected, lo
O>* 172.27.1.0/24 [110/40] via 192.168.200.1, eth0, 00:00:58
O>* 172.27.68.0/24 [110/40] via 192.168.200.1, eth0, 00:00:58
O>* 172.27.129.0/24 [110/20] via 192.168.200.1, eth0, 00:00:59
O>* 172.27.193.0/24 [110/30] via 192.168.200.1, eth0, 00:00:59
O 192.168.200.0/24 [110/10] is directly connected, eth0, 00:00:59
C>* 192.168.200.0/24 is directly connected, eth0
C>* 192.168.201.0/24 is directly connected, eth1
C>* 192.168.202.0/24 is directly connected, eth2
C>* 192.168.203.0/24 is directly connected, eth3
C>* 192.168.204.0/24 is directly connected, eth4
C>* 192.168.205.0/24 is directly connected, eth5
C>* 192.168.206.0/24 is directly connected, eth6
C>* 192.168.207.0/24 is directly connected, eth7
をぉ....後片付けは
# lxc-stop -n quagga
#
[1]+ Exit 137 lxc-execute -n quagga -f lxc-quagga.conf -- /etc/init.d/quagga start
# lxc-destroy -n quagga
最近のものを git で持ってこないと、後が何かおかしくなるコトあり。

# 沢山稼働させる場合は、きちんと絵を描いてから。って自分に言いきかせる。

0 件のコメント: