You are not logged in.

#1 2009-09-20 03:21:52

archvic
Member
Registered: 2009-09-20
Posts: 11

[SOLVED] Problems with dhcpcd

Hi everybody.. since I installed arch I've been having some problems with my internet conection. Sometimes it works but sometimes it doesn't. I've trying editing some files but nothing. I've seen that using dhclient instead of dhcpcd is a possible solution. In fact, when I do this

#dhclient eth0

my internet connection works and I can do ping -c 3 www.google.com and have an answer.
The question is, how can I do dhclient eth0 automatically at startup. In the Wiki I saw that I can use dhclient eth0 if dhcpcd fails, but where? which file do I have to edit?
Thanks in advance

Last edited by archvic (2009-09-22 04:33:38)

Offline

#2 2009-09-20 03:33:36

Square
Member
Registered: 2008-06-11
Posts: 435

Re: [SOLVED] Problems with dhcpcd

archvic wrote:

Hi everybody.. since I installed arch I've been having some problems with my internet conection. Sometimes it works but sometimes it doesn't. I've trying editing some files but nothing. I've seen that using dhclient instead of dhcpcd is a possible solution. In fact, when I do this

#dhclient eth0

my internet connection works and I can do ping -c 3 www.google.com and have an answer.
The question is, how can I do dhclient eth0 automatically at startup. In the Wiki I saw that I can use dhclient eth0 if dhcpcd fails, but where? which file do I have to edit?
Thanks in advance

I recommend:
http://wiki.archlinux.org/index.php/Netcfg

With DHCLIENT=yes in your network profile, of course.


 

Offline

#3 2009-09-20 04:43:34

archvic
Member
Registered: 2009-09-20
Posts: 11

Re: [SOLVED] Problems with dhcpcd

Thank you Square.. I already made a profiel and added DHCLIENT=yes
On startup my profle network is loaded correctly and apparently it works, but give some more reboots to see what happens, because as I said before sometimes the internet connection is set up correctly and sometimes it is not..
Let me try a little more before putting the tag [solved]

Offline

#4 2009-09-20 16:58:43

archvic
Member
Registered: 2009-09-20
Posts: 11

Re: [SOLVED] Problems with dhcpcd

Hi again
Ok, as I though, dhclient seems to run at startup, but arch cannot find eth0. Here are some codes to see the problem. First when I try to load my network profile manually (archnet is the name of my profile network based on the example /etc/network.d/examples/ethernet-dhcp):

[v@a ~]$ netcfg archnet
:: archnet up                                (BUSY)
- Interface eth0 does not exist
                                                   (FAIL)

Then I try to do a dhclient:

[v@a ~]$ sudo dhclient eth0
Internet Systems Consortium DHCP Client V3.1.2p1
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

can't create /var/state/dhcp/dhclient.leases: No such file or directory
SIOCSIFADDR: No such device
eth0: unknown interface: No such device
eth0: unknown interface: No such device
Bind socket to interface: No such device

When the network is working, ifconfig shows somthing about eth0 and lo, but when the network is not working it doesn't show eth0 only lo:

[v@a ~]$ ifconfig
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:64 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4297 (4.1 Kb)  TX bytes:4297 (4.1 Kb)

Finally, as the network was never started, I try to start it manually, and this appears:

[v@a ~]$ sudo /etc/rc.d/network start
:: Starting Network                                (BUSY)
eth0: unknown interface: No such device
dhcpcd: eth0: interface not found or invalid
dhcpcd: timed out
                                                           (FAIL)

I think I should post my /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"
# 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="es_SV.utf8"
HARDWARECLOCK="localtime"
USEDIRECTISA="no"
TIMEZONE="America/El_Salvador"
KEYMAP="es"
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=(mii ppp_generic slhc sundance)

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

# 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.1.2 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="dhcp"
INTERFACES=(eth0)

# 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.1.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=(archnet)

# -----------------------------------------------------------------------
# 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 hal net-profiles networkmanager crond cups alsa fam slim netfs)

Offline

#5 2009-09-21 02:21:43

archvic
Member
Registered: 2009-09-20
Posts: 11

Re: [SOLVED] Problems with dhcpcd

Any help? thanx in advance

Offline

#6 2009-09-21 02:32:12

masterkoppa
Member
Registered: 2009-04-14
Posts: 92

Re: [SOLVED] Problems with dhcpcd

Im no expert but this happened in an old pc I had a while ago. Try looking for the existance of the interface in

dmesg

On another note try

ifconfig eth0 up

maybe the interface just needs to be started up...

Offline

#7 2009-09-21 02:32:57

Proofrific
Member
Registered: 2008-01-05
Posts: 215

Re: [SOLVED] Problems with dhcpcd

When I don't have my wireless module loaded, I don't have wlan0.  So, maybe the correct module for your network card isn't loaded?

Offline

#8 2009-09-21 04:16:50

archvic
Member
Registered: 2009-09-20
Posts: 11

Re: [SOLVED] Problems with dhcpcd

Well Proofrific, I have added to my rc.conf the modules that hwdetect --show-net says (mii ppp_generic slhc sundance). Anyway my network card is Ethernet controller: Sundance Technology Inc / IC Plus Corp IC Plus IP100A Integrated 10/100 Ethernet MAC + PHY (rev 31)
masterkoppa, I'm going to try to start up the interface, but if that is the problem how do I get the interface to be loaded automatically at startup?

Offline

#9 2009-09-21 06:54:24

kgas
Member
From: Qatar
Registered: 2008-11-08
Posts: 718

Re: [SOLVED] Problems with dhcpcd

Hello archvic, try to use only one network deamon in the DEAMONS array. !networkmanager and try. netcfg improved a lot yet IMO wicd is simple and works fine. From your post it seems that your network cards are not detected and only loop back is there. what is the out put of ifconfig -a?

Offline

#10 2009-09-21 21:34:31

masterkoppa
Member
Registered: 2009-04-14
Posts: 92

Re: [SOLVED] Problems with dhcpcd

archvic wrote:

Well Proofrific, I have added to my rc.conf the modules that hwdetect --show-net says (mii ppp_generic slhc sundance). Anyway my network card is Ethernet controller: Sundance Technology Inc / IC Plus Corp IC Plus IP100A Integrated 10/100 Ethernet MAC + PHY (rev 31)
masterkoppa, I'm going to try to start up the interface, but if that is the problem how do I get the interface to be loaded automatically at startup?

The easiest way to do this is using wicd, as pointed out by kgas. I personally find it alot better and it has a GUI(GTK) and a CLI Interface. For more infor on wicd see: http://wiki.archlinux.org/index.php/Wicd

Offline

#11 2009-09-22 04:22:24

archvic
Member
Registered: 2009-09-20
Posts: 11

Re: [SOLVED] Problems with dhcpcd

kgas ifconfig -a shows both eth0 and the loopback now. But sometimes when eth0 was not loaded ifconfig and ifconfig -a showed the same, only the loopback, anyway the problem seems to be solved.

Thank you all guys.. I have rebooted a lot of times and the network is always working.. I'm sorry if I was annoying. I feel a great deal of satisfaction when things work fine on Arch, my network worked with no problems on ubuntu, opensuse and windows, but I feel better with Arch.

Hope this post helps anyone with similar problems.. Summarizing:
First I made a profile on /etc/network.d/  based on the examples (/etc/network.d/examples/) and added DHCLIENT=yes   to it (of course I had to install netcfg before). Then added net-profiles to my DAEMONS array on /etc/rc.conf.

Then I installed wicd and added "wicd" to my DAEMONS array. I commented any other network daemon (netfs, network, networkmanager) with a "!". Also, I commented with ! any interface on my INTEFACES array in rc.conf and rebooted. In addition I recommend putting as first daemon "syslog-ng" then "dbus" and "wicd" as the first three daemons.
With this, my network profile is always started up on boot, and the network seems to work fine.

Thank you again.

Edit: The first step of creating a net profile is not so necesary and may bring the same problems. So I just put a ! to the net-profiles daemon too. Wicd itself is taking care of everything.

Last edited by archvic (2009-09-24 04:38:30)

Offline

Board footer

Powered by FluxBB