[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[plamo:03280] Re: DHCPについて



サイトーです。

In message <19990707180938V.masa@i.kyushu-u.ac.jp>
   "[plamo:03258] Re: DHCPについて"
   "masa@i.kyushu-u.ac.jp (Masao MORI)" wrote:

> /etc/rc.d/rc.dhcp が設定されてるのが大切なんですよ.こいつが
> rc.inet{1,2}の代わりをしているはずだと思います.これがインストールされ
> ているか(実行ビットは立っているか),

申し訳ありません。pkgtoolで自動インストールされていました。
/etc/rc.d/rc.inet2 から呼び出されていましたし、
実行ビットもOKです。

 **********************************************************

>また,クライアントデーモンdhcpcd
> が起動しているかpsコマンドなどで確認して下さい.

psのオプションが今一分からないのですが(-aef で出てこなかった)
(manで分かるだろうと言われそー)
/var/run/ 以下に、dhcpcd-eth0.pid あったので大丈夫でしょう。
関係ないとは思いますが、そのディレクトリには
Klogd.pid, Sendmail.pid, Sendmail.pid, Sendmail.pid
がありました。
これって、悪魔君ですか?

  *********************************************************

>また,DHCPのクライアントが
> サーバに用意されているIPアドレスの数を上回ってはいませんか? RT80iでは
> メモリの容量に応じて管理できるIPアドレスの数が決まってくるそうです(下記
> URL参照).

この辺は問題ないと思います。
間違いなくクライアント数は全部で20は超えていないと思うので。

  **********************************************************

> 投稿される時の情報があいまいだし,ログを張り付けてくれてないと埒があかない
> 気がするのですが…

いや、ホント申し訳ありません。
いまだ、何がどう動いているのかさっぱりなもんで。
けれど、今回の件でだいぶ分かってきました。
最後に、関連するであろうファイルを載せておきます。

  **********************************************************

 
> > 念のため、DHCPについて管理人さんに正規に確認したところ
> > 「DHCPサーバーは、LinuxでもBSDでもなくRT80iというルータに付属のもの」
> http://www.murashima.matsudo.chiba.jp/YamahaISDN/RT80i/index.html
> にRT80iのDHCP機能についての情報があります.以下気になる部分を(無断では
> ありますが問題はないと思いつつ)引用しておきます.
> 
> --<引用>----<引用>----<引用>----<引用>----<引用>----<引用>----<引用>----<引用>--
> 
> >>「lllegal DHCP datagram from 0.0.0.0:op=1,type=0,chaddr=aa:bb:cc:dd:ee:ff」 
> >> というエラーがsyslogに吐かれています。何か問題があるのでしょうか? 
> >>
> >>DHCPパケットには、パケットの種別を表わすメッセージタイプというも のが必ず含
> >>まれていなければなりません。このログは、メッセージタイ プの不明なパケットを受
> >>け取ったことを表わしています。おそらく、 BOOTPメッセージを受け取ったためと思
> >>われます。 
> >>
> >>LAN内に、IPアドレスの取得にBOOTPを用いる機器はないでしょうか。 ログの内容か
> >>ら該当する機器のMACアドレスが「aa:bb:cc:dd:ee:ff」 であることがわかります。 も
> >>し、IPアドレスが不要な機器であればBOOTPの使用を止めるように設定す るか、ある
> >>いは固定的にIPアドレスを付与する方がいいと思います。 
> >>
> >>例えば、SNMPなどの管理機能を持ったスイッチングハブが、定期的にBOOTPでIPア
> >>ドレスの取得を試みるといった事例が確認されております。 

この辺はどうなんでしょう?
Windows95で取得できているので問題ないのでしょうか?


  ********************************************************************

関係(あると判断した)ファイルやメッセージなんですが、
まず、ブート時には

・・・(略)・・・
NE*000 ethercard probe at 0x240: 11 11 2d 2c b6 dd
eth0: NE2000 found at 0x240, using IRQ 11.
・・・(略)・・・
dhcpcdStarting Sendmail ・・・・・
・・・(略)・・・

とあります。(MACアドレス?は変えてあります)
NICが認識されているようですし、
dhcpcd が起動しているようです。


  ********************************************************************

#ifconfig は書いてもしようがないですが、以下の通りです。

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0
          UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1
          RX packets:544 errors:0 dropped:0 overruns:0 frame:0
          TX packets:544 errors:0 dropped:0 overruns:0 carrier:0
          Collisions:0 

eth0      Link encap:Ethernet  HWaddr 11:11:2D:2C:B6:DD  
          inet addr:0.0.0.0  Bcast:255.255.255.255  Mask:0.0.0.0
          UP BROADCAST NOTRAILERS RUNNING  MTU:1500  Metric:1
          RX packets:972 errors:0 dropped:0 overruns:0 frame:0
          TX packets:544 errors:0 dropped:0 overruns:0 carrier:0
          Collisions:0 
          Interrupt:11 Base address:0x240 

  *******************************************************************


そんでもって、ログなんですが、
/var/adm/messages, /var/adm/syslog より

cat messages(syslog) |  grep dhcp

Jul  5 20:18:26 JST 1999 dhcpcd: IP address changed to

これしかありません。
日付に問題ありなんでしょうか?
ここ毎日やっているのですが(一週間くらい前から)。

  *******************************************************************


あとは、/etc/rc.d/ 以下のファイルだと思うのですが、
rc.M, rc.inet1, rc.inet2, rc.dhcp を載せておきます。

rc.inet2 の最後の部分で /usr/sbin/dhcpcd が起動するところを

-c /etc/rc.d/rc.dhcp のオプションの他に、

  -r
  -l 259200  ==> リース3日分(Windowsではそうなっていたので)
  eth0       ==> デフォルトだからいらないような・・・。

を組み合わせてやりましたが、全部駄目でした。

/etc/HOSTNAME には、固定IPアドレスの時のままだと思うのですが、
panther.bunzin.gr.jp
です。
確かに、ホスト名 :panther
    ドメイン名:bunzin.gr.jp
でした。


  ***************************  rc.M *********************************

#!/bin/sh
#
# rc.M		This file is executed by init(8) when the system is being
#		initialized for one of the "multi user" run levels (i.e.
#		levels 1 through 6).  It usually does mounting of file
#		systems et al.
#
# Version:	@(#)/etc/rc.d/rc.M	2.02	02/26/93
#
# Author:	Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
#		Heavily modified by Patrick Volkerding <volkerdi@ftp.cdrom.com>
#

# Tell the viewers what's going to happen...
echo "Going multiuser..."

# Screen blanks after 15 minutes idle time.
/bin/setterm -blank 15

# Look for a CD-ROM in a CD-ROM drive, and if one is found,
# mount it under /cdrom.  This must happen before any of the
# binaries on the CD are needed.
#
# If you don't have a CD-ROM and want to disable this, set the
# /etc/rc.d/rc.cdrom permissions to non-executable: chmod 644 /etc/rc.d/rc.cdrom
# 
if [ -x /etc/rc.d/rc.cdrom ]; then
  . /etc/rc.d/rc.cdrom
fi

# If there's no /etc/HOSTNAME, fall back on this default:
if [ ! -r /etc/HOSTNAME ]; then
 echo "darkstar.frop.org" > /etc/HOSTNAME
fi

# Set the hostname.  This might not work correctly if TCP/IP is not 
# compiled in the kernel.
/bin/hostname `cat /etc/HOSTNAME | cut -f1 -d .`

# Initialize the NET subsystem.
if [ -x /etc/rc.d/rc.inet1 ]; then
  . /etc/rc.d/rc.inet1
  . /etc/rc.d/rc.inet2
else
  if [ -x /usr/sbin/syslogd ]; then
    /usr/sbin/syslogd & # Backgrounded to avoid an ugly notice from bash-2.0
    /usr/sbin/klogd
  fi
  if [ -x /usr/sbin/lpd ]; then
    /usr/sbin/lpd
  fi
fi

# Start crond (Dillon's crond):
# If you want cron to actually log activity to /var/adm/cron, then change
# -l10 to -l8 to increase the logging level.
/usr/sbin/crond -l10 >>/var/adm/cron 2>&1

# Remove stale locks and junk files (must be done after mount -a!)
/bin/rm -f /var/spool/locks/* /var/lock/* /var/spool/uucp/LCK..* /tmp/.X*lock /tmp/core /core 1> /dev/null 2> /dev/null

# Remove stale hunt sockets so the game can start.
if [ -r /tmp/hunt -o -r /tmp/hunt.stats ]; then
  echo "Removing your stale hunt sockets from /tmp..."
  /bin/rm -f /tmp/hunt*
fi

# Ensure basic filesystem permissions sanity.
chmod 755 /
chmod 1777 /tmp /var/tmp

# Update all the shared library links automatically
/sbin/ldconfig

# Start the sendmail daemon:
if [ -x /usr/sbin/sendmail ]; then
  echo "Starting sendmail daemon (/usr/sbin/sendmail -bd -q15m)..."
  /usr/sbin/sendmail -bd -q15m
fi

# Load a custom screen font if the user has an rc.font script.
if [ -x /etc/rc.d/rc.font ]; then
  . /etc/rc.d/rc.font
fi

# iBCS Emulation for Linux
# The Intel Binary Compatibility Specification, or iBCS, specifies the
# interfaces between application programs and the surrounding operating
# system environment for i386 based systems. There are however several
# flavours of iBCS in use - SVR4, SVR3 plus several vendor specific
# extensions to SVR3 which are slightly different and incompatible. The
# iBCS emulator for Linux supports all flavours known so far.
if [ -x /etc/rc.d/rc.ibcs2 ]; then
  . /etc/rc.d/rc.ibcs2
fi

# Start Web server:
if [ -x /etc/rc.d/rc.httpd ]; then
  . /etc/rc.d/rc.httpd
fi

# Start Samba (a file/print server for Win95/NT machines):
if [ -x /etc/rc.d/rc.samba ]; then
  . /etc/rc.d/rc.samba
fi

# start netatalk 
if [ -x /etc/rc.d/rc.atalk ]; then
  . /etc/rc.d/rc.atalk
fi

# Load a custom keymap if the user has an rc.keymap script.
if [ -x /etc/rc.d/rc.keymap ]; then
  . /etc/rc.d/rc.keymap
fi

# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ]; then
  . /etc/rc.d/rc.local
fi

# All done.


  ***************************  rc.inet1 *********************************

#! /bin/sh
#
# rc.inet1	This shell script boots up the base INET system.
#
# Version:	@(#)/etc/rc.d/rc.inet1	1.01	05/27/93
#

HOSTNAME=`cat /etc/HOSTNAME`

# Attach the loopback device.
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0

# IF YOU HAVE AN ETHERNET CONNECTION, use these lines below to configure the 
# eth0 interface. If you're only using loopback or SLIP, don't include the
# rest of the lines in this file.

# Edit for your setup.
IPADDR=""		# REPLACE with YOUR IP address!
NETMASK=""		# REPLACE with YOUR netmask!
NETWORK=""		# REPLACE with YOUR network address!
BROADCAST=""	# REPLACE with YOUR broadcast address, if you
				# have one. If not, leave blank and edit below.
GATEWAY=""		# REPLACE with YOUR gateway address!

# Uncomment ONLY ONE of the three lines below. If one doesn't work, try again.
# /sbin/ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
# /sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
# /sbin/ifconfig  eth0 ${IPADDR} netmask ${NETMASK} 

# Uncomment these to set up your IP routing table.
#/sbin/route add -net ${NETWORK} netmask ${NETMASK}
#/sbin/route add default gw ${GATEWAY} metric 1

# End of rc.inet1


  ***************************  rc.inet2 *********************************

#!/bin/sh
#
# rc.inet2	This shell script boots up the entire INET system.
#		Note, that when this script is used to also fire
#		up any important remote NFS disks (like the /usr
#		distribution), care must be taken to actually
#		have all the needed binaries online _now_ ...
#
# Author:	Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
# Modifier:     Yoichi Hariguchi <yoichi@fore.com>  09/14/96
#

# Constants.
NET="/usr/sbin"
IN_SERV="lpd"
LPSPOOL="/var/spool/lpd"

# At this point, we are ready to talk to The World...
echo "Mounting remote file systems..."
/sbin/mount -a -t nfs		# This may be our /usr runtime!!!

echo -n "Starting daemons:"

# Start the SYSLOGD/Klogd daemons.  These must come first.
if [ -f ${NET}/syslogd ]; then
  echo -n " syslogd"
  ${NET}/syslogd
#  echo -n " klogd"
  echo " klogd"
  ${NET}/klogd
fi

# invoke DHCP client here if I do not use PCMCIA device.
# you should invoke dhcpcd from /etc/pcmcia/network
# if you use PCMCIA network card.
#
if [ ! -x /etc/rc.d/rc.pcmcia ] ; then
  if [ -f ${NET}/dhcpcd ]; then
    echo -n "dhcpcd"
    if [ -f /etc/rc.d/rc.dhcp ]; then
      ${NET}/dhcpcd -c /etc/rc.d/rc.dhcp
    else
      ${NET}/dhcpcd
    fi
  fi
fi


  ***************************  rc.dhcp *********************************

#!/bin/sh
#
# $Id$
#
# sample command file which can be invoked from dhcpcd
# This script derived from "rc.inet2"
#
# Author: Yoichi Hariguchi <yoichi@fore.com>
#

NET=/usr/sbin
IN_SERV="xntpd"

# make configuration files for DNS and NTP
for serv in resolv ntp ; do
  if [ -f /etc/dhcpc/${serv}.conf ]; then
    if [ -L /etc/${serv}.conf ]; then
      rm -f /etc/${serv}.conf
    elif [ -f /etc/${serv}.conf ]; then
      mv /etc/${serv}.conf /etc/${serv}.conf.ORG
    fi
    ln -s /etc/dhcpc/${serv}.conf /etc
  fi
done

# Start the INET SuperServer
if [ -f ${NET}/inetd ]; then
  ${NET}/inetd
else
  exec false
  #exit 1
fi

# # Start the NAMED/BIND name server.
# if [ -f ${NET}/named ]; then
#   ${NET}/named
# fi

# Start the ROUTEd server.
#if [ -f ${NET}/routed ]; then
#   ${NET}/routed -q
#fi

# Start the various INET servers.
for server in ${IN_SERV} ; do
  if [ -f ${NET}/${server} ]; then
    ${NET}/${server}
  fi
done

# Start the various SUN RPC servers.

if [ -f ${NET}/rpc.portmap ]; then
  ${NET}/rpc.portmap

  # Start the NFS server daemons.
  if [ -f ${NET}/rpc.mountd ]; then
    ${NET}/rpc.mountd
  fi
#  if [ -f ${NET}/rpc.nfsd ]; then
#    echo -n " nfsd"
#    ${NET}/rpc.nfsd
#  fi
#  # Fire up the PC-NFS daemon(s).
#  if [ -f ${NET}/rpc.pcnfsd ]; then
#    echo -n " pcnfsd"
#    ${NET}/rpc.pcnfsd ${LPSPOOL}
#  fi
#  if [ -f ${NET}/rpc.bwnfsd ]; then
#    echo -n " bwnfsd"
#    ${NET}/rpc.bwnfsd ${LPSPOOL}
#  fi
fi # Done starting various SUN RPC servers.


# # Setting up NIS:
# # (NOTE: For detailed information about setting up NIS, see the
# #  documentation in /usr/doc/yp-clients* and /usr/doc/ypserv*.)
# #
# if [ -z "$NISDOMAINNAME" ] ; then
#   domainname-yp `cat /etc/nisdomainname`
# fi
# # Then, we start up ypbind.  It will use broadcast to find a server.
# if [ -d /var/yp ] ; then
#   /usr/sbin/ypbind 
# fi

# if you just 'exit' and do not issue 'exec trure', this process does not
# finish (I do not know why :p)
exec true
# Done!

  *********************************************************************

以上です。
長くなりましたが、よろしくお願いします。




--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--
(株)ラデックス
齋藤 朋紀 <Tomonori Saito>    E-mail:saito@kanda.rdx.co.jp

Follow-Ups
[plamo:03283] Re: DHCPについて, hical satow
[plamo:03285] Re: DHCPについて, Masao MORI
References
[plamo:03258] Re: DHCPについて, Masao MORI

[検索ページ] [メール一覧]
Plamo ML 公開システム