2nd DNS (blue) の入れ替えログ 03/23


  1. eth1 の設定
  2. 1. 設定ファイルのバックアップ
  3. 2. blue をシャットダウン
  4. 3. 現 blue の eth1 側(プライベート側)のネットワーク線を抜いて
  5. 4. ホスト名、IP アドレスの変更
  6. 5. 新設定の読み込み
  7. 6. gate-toroku-system のインストール(2)
  8. 7. 新ルータ稼働
  9. 8. 各ソフトウェアの動作確認
  10. 入れ替え後のチェック 2007/03/24

eth1 の設定

/etc/network/interface

auto eth1 iface eth1 inet static

address 192.168.16.2
netmask 255.255.255.0
network 192.168.16.0
broadcast 192.168.16.255

root@aoi:~# /etc/init.d/networking restart

Setting up IP spoofing protection: rp_filter.
Reconfiguring network interfaces...ifup: interface lo already configured
SIOCADDRT: File exists
Failed to bring up eth0.
done.

ifconfig を見ると正常に動いている。

eth0      Link encap:Ethernet  HWaddr 00:30:48:74:5F:7E
          inet addr:133.87.45.136  Bcast:133.87.45.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:376883 errors:0 dropped:0 overruns:0 frame:0
          TX packets:115007 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:41836403 (39.8 MiB)  TX bytes:19760334 (18.8 MiB)
          Base address:0xa400 Memory:f2000000-f2020000

eth1      Link encap:Ethernet  HWaddr 00:30:48:74:5F:7F
          inet addr:192.168.16.2  Bcast:192.168.16.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Base address:0xa800 Memory:f2020000-f2040000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:20167 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20167 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2612281 (2.4 MiB)  TX bytes:2612281 (2.4 MiB)

1. 設定ファイルのバックアップ

手元の計算機に blue の以下のファイルをバックアップ パーミッションに注意

/etc/shadow, /etc/passwd, /etc/group, /etc/sudoers
/etc/bind/named.conf, (または /etc/named.conf)
/var/named (ディレクトリ)
/etc/dhcpd.conf

2. blue をシャットダウン

プライベート LAN 停止

3. 現 blue の eth1 側(プライベート側)のネットワーク線を抜いて

新 blue の eth1 側につなぐ

4. ホスト名、IP アドレスの変更

aoi から blue へ.

blue のプライベート IP アドレスを 192.168.16.2 に. グローバル IP アドレスを 133.87.45.66 に.

具体的には以下のファイル書き換え

/etc/hosts
/etc/hostname
/etc/motd
/etc/network/interfaces

  /etc/gate.conf

$DHCP_SERVER ='blue.ep.sci.hokudai.ac.jp'

5. 新設定の読み込み

# /etc/init.d/networking restart
# hostname --file /etc/hostname
# /etc/init.d/klogd restart
# /etc/init.d/sysklogd restart

6. gate-toroku-system のインストール(2)

www サーバにログイン(管理者)

$ sudo -u gate -s -H 

/home/gate/.ssh/known_hosts の blue に関する行を削除

ssh blue.ep.sci.hokudai.ac.jp

/etc/gate.conf の設定が反映されているか確認

##  プライベートIPアドレス管理に関する設定
#
      # iptables によるルーティングを有効にする.
      $IPTABLES_ENABLE = 0;           # 0: 無効, 1: 有効

1 → 0 に変更

www サーバにログインして、

$ sudo -u gate -s -H
$ telnet localhost 8888

blue で /etc/dhcp.confg を確認したところ リストが更新されていない。

原因は gate のバグ (iptables の設定を無効にしとことに起因)

森川さんがサクッと修正

もう一度 www サーバで

$ telnet localhost 8888

blue で /etc/dhcp.confg を確認したところ リストが更新されている。

passwd が更新されていることを確認

$ ls -lt /etc/passwd

7. 新ルータ稼働

dhcp, dns が正常に動作していることを確認

安全に動作しているので /ETC , /HOME を削除する.

# rm -r /ETC /HOME

また, mondo ユーザも削除する.

# deluser --remove-home mondo1

8. 各ソフトウェアの動作確認

bind の動作確認 → 正常

入れ替え後のチェック 2007/03/24

ホスト名変更漏れチェック

aoi → blue への変更に漏れたものがないかチェック

# grep aoi /etc/*
# grep aoi /etc/*/*

/etc/mailname に aoi を発見したので blue に変更

/etc/exim4/update-exim4.conf.conf に aoi を発見したので blue に変更

あると便利なパッケージをインストール

# apt-get install vim vim-common