旧LinuxBOXと入れ替え

パッケージの追加、カーネルの再構築が終了してフィルターの設定の段階ではeth1をネットワークから外しておきます。フィルター等の設定が完了したなら /etc/pcmcia/network.opts などの設定を本来やろうとしている設定にしてやります。

■ /etc/pcmcia/network.opts を本来の姿に編集

# NOTE: This file was generated automatically by the pcnetconfig script.
# Network adapter configuration
#
# The address format is "scheme,socket,instance,hwaddr".
#
# Note: the "network address" here is NOT the same as the IP address.
# See the Networking HOWTO. In short, the network address is the IP
# address masked by the netmask.
#
case "$ADDRESS" in
*,0,*,*)
# ------------------definitions for network card in socket 0
INFO="Sample private network setup"
# Transceiver selection, for some cards -- see 'man ifport'
IF_PORT=""
# Use BOOTP (via /sbin/bootpc, or /sbin/pump)? [y/n]
BOOTP="n"
# Use DHCP (via /sbin/dhcpcd, /sbin/dhclient, or /sbin/pump)? [y/n]
DHCP="n"
# If you need to explicitly specify a hostname for DHCP requests
DHCP_HOSTNAME=""
# Host's IP address, netmask, network address, broadcast address
IPADDR="xx1.xx2.xx3.xx4"
NETMASK="255.255.255.0"
NETWORK="xx1.xx2.xx3.0"
BROADCAST="xx1.xx2.xx3.255"
# Gateway address for static routing
GATEWAY="xx1.xx2.xx3.1"
# Things to add to /etc/resolv.conf for this interface
DOMAIN="ns.test.com"
SEARCH=""
# The nameserver IP addresses specified here complement the
# nameservers already defined in /etc/resolv.conf. These nameservers
# will be added to /etc/resolv.conf automatically when the PCMCIA
# network connection is established and removed from this file when
# the connection is broken.
DNS_1="xx1.xx2.xx3.xx4"
DNS_2="xx5.xx6.xx7.xx8"
DNS_3=""
# NFS mounts, should be listed in /etc/fstab
MOUNTS=""
# If you need to override the interface's MTU...
MTU=""
# For IPX interfaces, the frame type and network number
IPX_FRAME=""
IPX_NETNUM=""
# Run ipmasq? [y/n] (see the Debian ipmasq package)
IPMASQ="n"
# Extra stuff to do after setting up the interface
start_fn () { return; }
# Extra stuff to do before shutting down the interface
stop_fn () { return; }
# Card eject policy options
NO_CHECK="n"
NO_FUSER="n"
;;
*,1,*,*)
# ----------------definitions for network card in socket 1
INFO="Sample private network setup"
# Transceiver selection, for some cards -- see 'man ifport'
IF_PORT=""
# Use BOOTP (via /sbin/bootpc, or /sbin/pump)? [y/n]
BOOTP="n"
# Use DHCP (via /sbin/dhcpcd, /sbin/dhclient, or /sbin/pump)? [y/n]
DHCP="n"
# If you need to explicitly specify a hostname for DHCP requests
DHCP_HOSTNAME=""
# Host's IP address, netmask, network address, broadcast address
IPADDR="192.168.1.1"
NETMASK="255.255.255.0"
NETWORK="192.168.1.0"
BROADCAST="192.168.1.255"
# Gateway address for static routing
# Things to add to /etc/resolv.conf for this interface
SEARCH=""
# The nameserver IP addresses specified here complement the
# nameservers already defined in /etc/resolv.conf. These nameservers
# will be added to /etc/resolv.conf automatically when the PCMCIA
# network connection is established and removed from this file when
# the connection is broken.
DNS_1="192.168.1.254"
DNS_2=""
DNS_3=""
# NFS mounts, should be listed in /etc/fstab
MOUNTS=""
# If you need to override the interface's MTU...
MTU=""
# For IPX interfaces, the frame type and network number
IPX_FRAME=""
IPX_NETNUM=""
# Run ipmasq? [y/n] (see the Debian ipmasq package)
IPMASQ="y"
# Extra stuff to do after setting up the interface
start_fn () {
ifconfig eth1 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255
ifconfig eth1:0 192.168.1.254 netmask 255.255.255.0 broadcast 192.168.1.255
return;
}
# Extra stuff to do before shutting down the interface
stop_fn () {
ifconfig eth1 down
ifconfig eth1:1 down
return;
}
# Card eject policy options
NO_CHECK="n"
NO_FUSER="n"
;;
esac

■ 新ネットワーク構成の接続

全ての設定が完了して、旧LinuxBOXからwebのデータ(カウンター値)などが転送できているなら既製のルータを外し、新LinuxBOXを稼動させます。

私の場合 DHCP に多少問題が出ました。pcmcai の認識の時間的なズレが原因と判断し /etc/pcmcai/network.opts をこんな感じにしてみました。内向け、外向けBIND、DHCPを一度ストップさせ再度スタートする。これで何とか思い通り動いてくれました。

start_fn () {
ifconfig eth1 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255
ifconfig eth1:1 192.168.1.254 netmask 255.255.255.0 broadcast 192.168.1.255
#----時間差攻撃でbind/dhcpdをstartさせる-------------------
/etc/init.d/bind-inner stop
/etc/init.d/bind-outer stop
/etc/init.d/dhcp stop
#
/etc/init.d/bind-inner start
/etc/init.d/bind-outer start
/etc/init.d/dhcp start

return;
}
# Extra stuff to do before shutting down the interface
stop_fn () {
ifconfig eth1 down
ifconfig eth1:1 down
/etc/init.d/dhcp stop
/etc/init.d/bind-inner stop
/etc/init.d/bind-outer stop

return;
}