2004年10月24日日曜日

iproute2入門(その4)


iproute2入門(その3)の続き。



複数のアップリンク/プロバイダに対するルーティング

まさに、やりたいのはこれ(^^)


________
+--------+ /
219.99.179.129 | | |
+-------------------+ qidc +-------
__ 219.99.179.188 | | | /
___/ \_ +--------+----------+ +--------+ |
_/ \__ | eth0 | /
/ \ | | |
| Maintenance -----+eth2 his.luky.org | | The Internet
\_ LAN __/ | | |
\__ __/ | eth1 | \
\___/ +--------+----------+ +--------+ |
210.203.222.218 | | | \
+-------------------+ BBIQ +-------
210.203.222.217 | | |
+--------+ \________

トポロジも例題そのまんま。

��しかし、話はそんなに簡単ではなかった。




アクセス分割

まずは、/etc/iproute2/rt_tables


#
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
1 inr.ruhep
200 qidc
201 BBIQ

Debian/woodyの標準設定に、最後の2行を追加した。

例題をベースに考えるに、ルーティングの設定は以下のようになった。


#
ip route add 219.99.179.128 dev eth0 src 219.99.179.188 table qidc
ip route add default via 219.99.179.129 table qidc
ip route add 210.203.222.216 dev eth1 src 210.203.222.218 table BBIQ
ip route add default via 210.203.222.218 table BBIQ
#
ip route add 219.99.179.128 dev eth0 src 219.99.179.188
ip route add 210.203.222.216 dev eth1 src 210.203.222.218
#
ip route add default via 219.99.179.129
#
ip rule add from 219.99.179.188 table qidc
ip rule add from 210.203.222.218 table BBIQ
#
ip route add 192.168.200.0 dev eth2 table qidc
ip route add 210.203.222.216 dev eth1 table qidc
ip route add 127.0.0.0/8 dev lo table qidc
#
ip route add 192.168.200.0 dev eth2 table BBIQ
ip route add 219.99.179.128 dev eth0 table BBIQ
ip route add 127.0.0.0/8 dev lo table BBIQ

上記の設定は間違いであり、動いていない。

続きiproute2入門(その5)iproute2入門(その6)を読むべし。


0 件のコメント:

コメントを投稿