You are not logged in.

#1 2010-10-01 17:42:11

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

[Help] DHCP Fails

Hi,

I recently moved from Italy to a small flat in the UK, provided with ethernet sockets.
Since the first time I tried to connect my Arch x86_64 laptop to the internet I found I was unable to connect.
After incredible struggles I figured out the problem was related to DHCP: basically I continuously get this error message:

SIOCGIFADDR: Cannot assign requested address

until I do:

sudo dhcpcpd eth0

This seems to be quite a common issue and I found that most of the people solve it by adding:

dhcpcd -k eth0
dhcpcd -nd eth0

to /etc/rc.local, but this doesn't work for me.

So my question is: how do I set up dhcpcd (or dhclient if ut's better) so that it starts on boot and I can automatically connect to my wired network?

Any help is much appreciated, thank you very much indeed!


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#2 2010-10-01 17:57:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Help] DHCP Fails

Post your rc.conf and the output of 'ifconfig -a'.

Offline

#3 2010-10-01 18:13:44

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [Help] DHCP Fails

Thanks for answering.

/etc/rc.conf

#
# /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", any other value will result
#   in the hardware clock being left untouched (useful for virtualization)
# 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_GB.UTF-8"
HARDWARECLOCK="UTC"
TIMEZONE="Europe/London"
KEYMAP="it"
CONSOLEFONT="ter-114n"
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=(acpi-cpufreq vboxdrv)

# 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="aspire"

# 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)
 
# Setting this to "yes" will skip network shutdown.
# This is required if your root device is on NFS.
NETWORK_PERSIST="no"

# 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 acpid dbus hal wicd netfs @crond @laptop-mode @alsa @cups @mpd @bitlbee)

ifconfig -a (when not connected and encountering the problem):

eth0      Link encap:Ethernet  HWaddr 00:1B:24:A1:3D:50  
          inet6 addr: fe80::21b:24ff:fea1:3d50/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:764 (764.0 b)
          Interrupt:17 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3250 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3250 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:238954 (233.3 Kb)  TX bytes:238954 (233.3 Kb)

wlan0     Link encap:Ethernet  HWaddr 00:1B:77:EA:E6:7B  
          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)


BTW, I found that inserting:

dhclient eth0

in /etc/rc.local makes my boot last longer but when X starts I'm connected.
However if I disconnect I can no longer connect until I manually enter sudo dhclient eth0 (or sudo dhcpcd eth0).


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#4 2010-10-01 18:48:21

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Help] DHCP Fails

I see you have wicd in your DAEMONS array. Did you follow http://wiki.archlinux.org/index.php/Wicd especially http://wiki.archlinux.org/index.php/Wic … e-shooting: "Don't forget to select dhclient as the primary dhcp client in wicd options afterwards!"?

What do you mean "disconnect"? Pull the plug out of the wall / notebook?

Last edited by karol (2010-10-01 18:49:15)

Offline

#5 2010-10-01 21:25:24

rent0n
Member
From: Italy
Registered: 2009-10-29
Posts: 457
Website

Re: [Help] DHCP Fails

Yes I did follow the instructions carefully. Consider that Wicd and network were working fine before moving to the new flat.
dhclient is now flagged in Wicd preferences, though dhpcd is still installed.
With disconnect I mean using the Disconnect function in Wicd.

Every time I disconnect and try to reconnect through Wicd I get this error (in tty1):

SIOCGIFADDR: Cannot assign requested address

until I do:

sudo dhclient eth0

This is very annoying of course and I really can't understand what's going on. My guess is that it has something to do with the kind of network (never had this problem in other locations)...

So if there's no a real reason for the issue and a real solution it would be nice to find at least a nice workaround.

Thanks!

Last edited by rent0n (2010-10-01 21:26:56)


rent0n@deviantART | rent0n@bitbucket | rent0n@identi.ca | LRU #337812
aspire: Acer Aspire 5920 Arch Linux x86_64 | beetle: Gericom Beetle G733 Arch Linux i686

Offline

#6 2010-10-01 21:29:24

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Help] DHCP Fails

I've never used wicd, but you can chain commands

sudo dhclient eth0 && <wicd connect>

and make an alias of it or something.

Maybe you can try other network managers.

Offline

#7 2010-10-02 15:43:53

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: [Help] DHCP Fails

In wicd preferences you can select it to use dhclient instead of dhcpd


Website - Blog - arch-home
Arch User since March 2005

Offline

Board footer

Powered by FluxBB