You are not logged in.

#1 2009-01-27 05:46:46

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

[SOLVED] Automatically dhcpcd eth0 at start up?

Hi,

I just installed Arch on my new desktop and it doesn't seem to get an IP address (or keep its previously acquired IP) upon start up. I have to issue "dhcpcd eth0" each time after start up to get LAN ethernet working. sad

How can I bypass this automatically?

Thanks.

Last edited by MTsoul (2009-02-04 08:00:58)

Offline

#2 2009-01-27 06:06:57

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Without posting any info about your setup,what you have done and you configuration files. there is very little chance of anybody helping you....


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#3 2009-01-27 06:08:53

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

I followed the Beginners Guide in the wiki. I don't know what else there is to post.

Offline

#4 2009-01-27 06:10:31

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Setup netcfg2 you can't go wrong wink


neutral

Offline

#5 2009-01-27 06:12:09

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#6 2009-01-27 06:15:25

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

rc.conf ? And if you are using netcfg then the profiles... And if you are getting any errors during boot then those.......


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#7 2009-01-27 09:11:24

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Here is my rc.conf. Any help would be greatly appreciated.

LOCALE="en_US.utf8"
HARDWARECLOCK="localtime"
USEDIRECTISA="no"
TIMEZONE="Canada/Pacific"
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=(forcedeth slhc snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd snd-hda-intel soundcore)

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

# 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
#
#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
eth="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.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 alsa)

(Btw is there a better way of handling copy/paste buffers in Awesome? I had to open rc.conf in Firefox and copy/paste within this window.)

Offline

#8 2009-01-27 09:16:49

ndlarsen
Member
From: Denmark
Registered: 2005-11-02
Posts: 157

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

From your rc.conf:

eth="dhcp" <-- TYPO SHOULD BE eth0
INTERFACES=(eth0)

Last edited by ndlarsen (2009-01-27 09:17:10)


I made it long
as I lacked the time to make it short...

Offline

#9 2009-01-27 16:29:49

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Ah thanks for that. It's stll not working though sad I don't see any changes..

Offline

#10 2009-01-27 16:55:31

Hrod beraht
Member
Registered: 2008-09-30
Posts: 186

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Have you tried enabling the gateway, i.e. removing the (!), which disables it?

gateway="default gw 192.168.0.1"
ROUTES=(!gateway)

Bob

Offline

#11 2009-01-27 16:59:22

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Hrod beraht wrote:

Have you tried enabling the gateway, i.e. removing the (!), which disables it?

gateway="default gw 192.168.0.1"
ROUTES=(!gateway)

Bob

The gateway would be populated by the dhcp request.  There should be no reason why your machine isn't getting an IP, but try running network without backgrounding it.  Change @network to just network in your daemons array.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#12 2009-01-27 20:28:28

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Get netfs out of the background (remove the @) and reboot.

Wot says?


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#13 2009-01-28 02:49:53

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Removed the @ from both network and netfs. Both of they say "Okay" during boot. Nothing's changed.

If I do /etc/rc.d/network down/up, nothing happens. It's like the eth0 is not registered to something unless it's explicitly invoked through dhcpcd. Does this have anything to do with anything?

Offline

#14 2009-01-28 10:00:55

toad
Member
From: if only I knew
Registered: 2008-12-22
Posts: 1,775
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Yep, certainly does. I couldn't log in because of hal starting in the background. Worked on one machine, didn't on the other. If I were you I'd play around a little more (or less smile) with your rc.conf.


never trust a toad...
::Grateful ArchDonor::
::Grateful Wikipedia Donor::

Offline

#15 2009-01-30 19:09:30

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

MTsoul wrote:

Hi,

I just installed Arch on my new desktop and it doesn't seem to get an IP address (or keep its previously acquired IP) upon start up. I have to issue "dhcpcd eth0" each time after start up to get LAN ethernet working. =(

How can I bypass this automatically?

Thanks.

hi

edit the /etc/rc.local file
ie:

sudo nano /etc/rc.local

then write (append) these lines:

dhcpcd -k eth0
dhcpcd -nd eth0                  ## (i use oftenly the -nd flag)

edit: has this helped you ?

Last edited by quarkup (2009-01-31 10:41:51)


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#16 2009-02-04 08:00:42

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Yeah I put dhcpcd eth0 at the end of my /etc/rc.d/network... seems like a hack but hey it works now. Thanks!

Offline

#17 2009-02-04 19:25:51

xstaticxgpx
Member
Registered: 2008-10-22
Posts: 48

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

I had this issue as well, so I just wrote a quick rc.d script for dhcpcd - I usually start it in the background (@) because dhcpcd takes awhile to get my ip.

/etc/rc.d/dhcp:

#!/bin/bash

INTERFACE="`awk '/^INTERFACE/' /etc/rc.conf | sed -e 's/^INTERFACES=(//' -e 's/)$//'`" # Get INTERFACES value from rc.conf, removing parentheses 
CONF=/etc/conf.d/dhcpcd
LOG=/var/lib/dhcpcd/dhcpcd.log # Check dhcpcd output if script fails

. /etc/rc.d/functions
. /etc/rc.conf

[ -f $CONF ] && . $CONF

PID="`pidof -o %PPID /sbin/dhcpcd`"

case "$1" in
    start)
    stat_busy "Starting dhcpcd..."
    /sbin/dhcpcd $DHCPCD_ARGS $INTERFACE &>$LOG
    if [ $? -gt 0 ]; then
        stat_fail
    else
        add_daemon dhcp
        stat_done
    fi
    ;;
    stop)
    stat_busy "Stopping dhcpcd..."
    /sbin/dhcpcd -kx $INTERFACE &>/dev/null
    if [ $? -gt 0 ]; then
        stat_fail
    else
        rm_daemon dhcp
        stat_done
    fi
    ;;
    kill)
    stat_busy "Killing dhcpcd..."
    kill -9 $PID &>/dev/null
    if [ $? -gt 0 ]; then
        stat_fail
    else
        /bin/rm -f /var/run/dhcpcd-$INTERFACE.pid
        rm_daemon dhcp
        stat_done
    fi
    ;;
    restart)
    $0 stop
    sleep 1
    $0 start
    ;;
    *)
    echo "Usage: $0 {start|stop|kill|restart}"
esac
exit 0

Last edited by xstaticxgpx (2009-02-04 21:41:32)

Offline

#18 2009-02-06 23:50:39

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

slashline wrote:
quarkup wrote:

edit the /etc/rc.local file
i.e.:

vi /etc/rc.local

then insert these lines:

dhcpcd -k eth0
dhcpcd -nd eth0

That's exactly what I did and it worked. Thank you!

big_smile


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#19 2009-09-30 17:37:14

pixaroglets
Member
Registered: 2009-09-21
Posts: 1

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

Another solution I found around is,
If you start X at boot with Method 3 from the Arch wiki (http://wiki.archlinux.org/index.php/Start_X_at_boot),
then you can add to .bash_login:

sudo /etc/rc.d/network start
startx

It's much faster (at least on my computer) than the rc.local solution.
Hope it helps. smile

Last edited by pixaroglets (2009-09-30 17:52:26)

Offline

#20 2010-07-14 18:31:46

Shakz
Member
Registered: 2010-06-07
Posts: 17

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

quarkup wrote:
MTsoul wrote:

Hi,

I just installed Arch on my new desktop and it doesn't seem to get an IP address (or keep its previously acquired IP) upon start up. I have to issue "dhcpcd eth0" each time after start up to get LAN ethernet working. sad

How can I bypass this automatically?

Thanks.

hi

edit the /etc/rc.local file
ie:

sudo nano /etc/rc.local

then write (append) these lines:

dhcpcd -k eth0
dhcpcd -nd eth0                  ## (i use oftenly the -nd flag)

edit: has this helped you ?

Thanks for this. I know this is an old thread and its about a wired connection, but I was having a heck of a time getting my wireless to come up without my having to type in dhcpcd eth0.

I have a newer dell laptop I am loading Arch on and the default wiki wireless page worked great for my desktop (all PCs are wireless in my house. Router is next to the tv). On my laptop though I had to download the wireless drivers and install them before doing the install...damn you broadcom!

Anywho it just worked so thanks for posting. I was getting tired of jacking with rc.conf to get it to come up automagically.

Offline

#21 2011-11-23 18:30:24

sryan1372
Member
Registered: 2011-11-23
Posts: 1

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

quarkup wrote:
MTsoul wrote:

Hi,

I just installed Arch on my new desktop and it doesn't seem to get an IP address (or keep its previously acquired IP) upon start up. I have to issue "dhcpcd eth0" each time after start up to get LAN ethernet working. sad

How can I bypass this automatically?

Thanks.

hi

edit the /etc/rc.local file
ie:

sudo nano /etc/rc.local

then write (append) these lines:

dhcpcd -k eth0
dhcpcd -nd eth0                  ## (i use oftenly the -nd flag)

edit: has this helped you ?

Necromancer, I know...

if you want to use this method, but don't want your system to hang until the network is up, use this instead:

dhcpcd -k eth0
dhcpcd -bn eth0                  ## the b option loads dhcpcd into bg immediately

Since it's running in the background, boot doesn't wait on it, and you get to your login prompt faster. Also, you lose the debug output, so you might want to try this only after you've gotten quarkup's original version working.

Offline

#22 2012-02-04 00:55:09

ntony
Member
Registered: 2010-11-17
Posts: 32

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

sryan1372 wrote:
quarkup wrote:
MTsoul wrote:

Hi,

I just installed Arch on my new desktop and it doesn't seem to get an IP address (or keep its previously acquired IP) upon start up. I have to issue "dhcpcd eth0" each time after start up to get LAN ethernet working. sad

How can I bypass this automatically?

Thanks.

hi

edit the /etc/rc.local file
ie:

sudo nano /etc/rc.local

then write (append) these lines:

dhcpcd -k eth0
dhcpcd -nd eth0                  ## (i use oftenly the -nd flag)

edit: has this helped you ?

Necromancer, I know...

if you want to use this method, but don't want your system to hang until the network is up, use this instead:

dhcpcd -k eth0
dhcpcd -bn eth0                  ## the b option loads dhcpcd into bg immediately

Since it's running in the background, boot doesn't wait on it, and you get to your login prompt faster. Also, you lose the debug output, so you might want to try this only after you've gotten quarkup's original version working.



Sorry about resurrecting this old thread.
The Arch Wiki guides us to disable dhcpcd in daemon array. But what we are going is to load and background it at boot. So why is the wiki telling us to do so?
The above trick solved my problem tho!

Last edited by ntony (2012-02-04 01:10:27)

Offline

#23 2012-02-04 01:06:06

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

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

That wiki article is about wicd, not about networking in general.

Offline

#24 2012-02-04 01:12:02

ntony
Member
Registered: 2010-11-17
Posts: 32

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

karol wrote:

That wiki article is about wicd, not about networking in general.

So applying this trick would cause any problem? Like some people who use static IP for eth0?

Offline

#25 2012-02-04 01:22:37

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

Re: [SOLVED] Automatically dhcpcd eth0 at start up?

I don't know if it will cause any problems, I'm only saying that the article you refer to as 'the Arch wiki' is about a certain way of managing your network.
If you're running wicd, you should refer to the article. If you think there's an error in the wiki, you can start a discussion on the discussion page.
If you're not using wicd, what's the point of referring to that article?

Offline

Board footer

Powered by FluxBB