+ -
当前位置:首页 → 问答吧 → dhcpcd获取IP超时

dhcpcd获取IP超时

时间:2009-09-11

来源:互联网

刚装完的系统,启动时候在network等很久,起来以后,ifconfig里eth0没获取到Ip,手动dhcpcd eth0,报超时。该怎么解决呀?
线路没问题,同样设备在win下获取IP正常
/var/log/every什么的文件里也只说timeout

作者: magiciany   发布时间: 2009-09-11

修改一下/etc/dhcpcd.conf
加上timeout参数延长一下。
具体可以man dhcpcd.conf。

作者: zlowly   发布时间: 2009-09-11

先贴你的rc.conf的network部分来看看吧

作者: jobinson99   发布时间: 2009-09-11

我timeout设置成60了,应该够大了吧?

作者: magiciany   发布时间: 2009-09-11

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.utf8"
HARDWARECLOCK="localtime"
USEDIRECTISA="no"
TIMEZONE="Asia/Shanghai"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=()

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="myhost"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
# - prefix an entry in INTERFACES with a ! to disable it
# - no hyphens in your interface names - Bash doesn't like it
#
# DHCP: Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#

#Static IP example
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="dhcp"
wlan0="dhcp"
INTERFACES=(eth0 wlan0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
# - prefix an entry in ROUTES with a ! to disable it
#
#gateway="default gw 192.168.0.1"
#ROUTES=(!gateway)

# Enable these network profiles at boot-up. These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
# - set to 'menu' to present a menu during boot-up (dialog package required)
# - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(main)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
# - prefix a daemon with a ! to disable it
# - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng network netfs crond)

作者: magiciany   发布时间: 2009-09-11

everything.log里相关的Log
----------------------------------
Sep 11 15:56:13 myhost kernel: iwlagn 0000:04:00.0: loaded firmware version 8.24.2.12
Sep 11 15:56:13 myhost kernel: Registered led device: iwl-phy0::radio
Sep 11 15:56:13 myhost kernel: Registered led device: iwl-phy0::assoc
Sep 11 15:56:13 myhost kernel: Registered led device: iwl-phy0::RX
Sep 11 15:56:13 myhost kernel: Registered led device: iwl-phy0::TX
Sep 11 15:57:13 myhost dhcpcd: timed out
Sep 11 16:00:08 myhost kernel: wlan0: authenticate with AP 00:18:f8:28:39:88
Sep 11 16:00:08 myhost kernel: wlan0: authenticated
Sep 11 16:00:08 myhost kernel: wlan0: associate with AP 00:18:f8:28:39:88
Sep 11 16:00:08 myhost kernel: wlan0: RX AssocResp from 00:18:f8:28:39:88 (capab=0x11 status=0 aid=8)
Sep 11 16:00:08 myhost kernel: wlan0: associated
Sep 11 16:00:10 myhost dhcpcd[1989]: wlan0: dhcpcd 4.0.7 starting
Sep 11 16:00:10 myhost dhcpcd[1989]: wlan0: broadcasting for a lease
Sep 11 16:00:40 myhost dhcpcd[1989]: wlan0: timed out
---------------------------------------------------------------------------------------------

作者: magiciany   发布时间: 2009-09-11

从日志来看,只是30秒就timeout了,显然设置没有生效。
我用的是net-profiles,就是/etc/netword.d/里设置的,所以不知道network的要怎么设置。

作者: zlowly   发布时间: 2009-09-11

回zlowly,rc.conf是jobinson99叫我贴的
加参数-t 60,现在是60秒了,不过还是不行

作者: magiciany   发布时间: 2009-09-11

刚tcpdump看了,只发现我这广播发出去了,但是没收到路由器的回应

作者: magiciany   发布时间: 2009-09-11

路由器上瞅了瞅,没dhcpcd时,ARP表就3个条目。开始DHCP后,ARP一下子变成10多条,而且都是imcomplete.....
archlinux上除了dhcpcd以外还有什么dhcp client么?

作者: magiciany   发布时间: 2009-09-11

换成dhclient问题解决。。。。。。

作者: magiciany   发布时间: 2009-09-12