2004年11月1日月曜日

routing変更


【変更前】


# LANG=C /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
210.203.222.216 * 255.255.255.248 U 0 0 0 eth1
219.99.179.128 * 255.255.255.192 U 0 0 0 eth0
192.168.200.0 * 255.255.255.0 U 0 0 0 eth2
default 219.99.179.129 0.0.0.0 UG 0 0 0 eth0


# ip rule show
0: from all lookup local
32765: from 210.203.222.218 lookup BBIQ
32766: from all lookup main
32767: from all lookup default


# ip route show
210.203.222.216/29 dev eth1 proto kernel scope link src 210.203.222.218
219.99.179.128/26 dev eth0 proto kernel scope link src 219.99.179.188
192.168.200.0/24 dev eth2 proto kernel scope link src 192.168.200.188
default via 219.99.179.129 dev eth0


# ip route show table BBIQ
default via 210.203.222.217 dev eth1


# ip route show table main
210.203.222.216/29 dev eth1 proto kernel scope link src 210.203.222.218
219.99.179.128/26 dev eth0 proto kernel scope link src 219.99.179.188
192.168.200.0/24 dev eth2 proto kernel scope link src 192.168.200.188
default via 219.99.179.129 dev eth0






【変更作業】:念のため、シリアル経由で入って実施。


  • /etc/iproute2/rt_tablesにQIDC追加
  • /etc/network/interface修正:eth0のdefault gatewayをはずして、eth1側のdefault gatewayをBBIQ側に
  • ip route del default via 210.203.222.217 dev eth1
  • ip rule del from 210.203.222.218 lookup BBIQ
  • ip route add default via 219.99.179.129 table QIDC
  • ip route add 0/0 dev eth0 table QIDC
  • ip rule add from 219.99.179.188 lookup QIDC
  • ifdown eth0; ifdown eth1; ifup eth0; ifup eth1



【変更後】


# LANG=C /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
210.203.222.216 0.0.0.0 255.255.255.248 U 0 0 0 eth1
219.99.179.128 0.0.0.0 255.255.255.192 U 0 0 0 eth0
192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
0.0.0.0 210.203.222.217 0.0.0.0 UG 0 0 0 eth1


# ip rule show
0: from all lookup local
32765: from 219.99.179.188 lookup QIDC
32766: from all lookup main
32767: from all lookup default


# ip route show
210.203.222.216/29 dev eth1 proto kernel scope link src 210.203.222.218
219.99.179.128/26 dev eth0 proto kernel scope link src 219.99.179.188
192.168.200.0/24 dev eth2 proto kernel scope link src 192.168.200.188
default via 210.203.222.217 dev eth1


# ip route show table QIDC
default via 219.99.179.129 dev eth0


# ip route show table main
210.203.222.216/29 dev eth1 proto kernel scope link src 210.203.222.218
219.99.179.128/26 dev eth0 proto kernel scope link src 219.99.179.188
192.168.200.0/24 dev eth2 proto kernel scope link src 192.168.200.188
default via 210.203.222.217 dev eth1


0 件のコメント:

コメントを投稿