LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1136|回复: 10

dhcpcd获取IP超时

[复制链接]
发表于 2009-9-11 11:23:46 | 显示全部楼层 |阅读模式
刚装完的系统,启动时候在network等很久,起来以后,ifconfig里eth0没获取到Ip,手动dhcpcd eth0,报超时。该怎么解决呀?
线路没问题,同样设备在win下获取IP正常
/var/log/every什么的文件里也只说timeout
发表于 2009-9-11 12:23:05 | 显示全部楼层
修改一下/etc/dhcpcd.conf
加上timeout参数延长一下。
具体可以man dhcpcd.conf。
回复 支持 反对

使用道具 举报

发表于 2009-9-11 13:07:00 | 显示全部楼层
先贴你的rc.conf的network部分来看看吧
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-9-11 14:40:42 | 显示全部楼层
我timeout设置成60了,应该够大了吧?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-9-11 14:50:49 | 显示全部楼层
#
# /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)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-9-11 16:16:30 | 显示全部楼层
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
---------------------------------------------------------------------------------------------
回复 支持 反对

使用道具 举报

发表于 2009-9-11 17:15:03 | 显示全部楼层
从日志来看,只是30秒就timeout了,显然设置没有生效。
我用的是net-profiles,就是/etc/netword.d/里设置的,所以不知道network的要怎么设置。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-9-11 19:06:33 | 显示全部楼层
回zlowly,rc.conf是jobinson99叫我贴的
加参数-t 60,现在是60秒了,不过还是不行
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-9-11 19:11:27 | 显示全部楼层
刚tcpdump看了,只发现我这广播发出去了,但是没收到路由器的回应
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-9-11 19:32:15 | 显示全部楼层
路由器上瞅了瞅,没dhcpcd时,ARP表就3个条目。开始DHCP后,ARP一下子变成10多条,而且都是imcomplete.....
archlinux上除了dhcpcd以外还有什么dhcp client么?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表