You are not logged in.

#1 2009-02-09 19:04:15

playdafunkimuzic
Member
Registered: 2008-10-25
Posts: 220

Network fails upon load, run dhcpcd and it gets an ip and works

Here is 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="en_US.utf8"
HARDWARECLOCK="UTC"
USEDIRECTISA="no"
TIMEZONE="US/Eastern"
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 b43 !bcm43xx snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd snd-hda-intel soundcore !snd_pcsp !pcspkr)

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

# 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="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 @openntpd netfs hal crond gdm fam alsa)

I was able to manually place the dhcpcd commands in /etc/rc.local. Why is this necessary, though?

Offline

#2 2009-02-09 20:48:42

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

Re: Network fails upon load, run dhcpcd and it gets an ip and works

What happens if you do /etc/rc.d/network start after boot up (before running dhcp)? Does it fail to start?


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

Offline

#3 2009-02-10 00:24:46

playdafunkimuzic
Member
Registered: 2008-10-25
Posts: 220

Re: Network fails upon load, run dhcpcd and it gets an ip and works

yes, that fails.

Offline

#4 2009-02-10 00:35:15

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

Re: Network fails upon load, run dhcpcd and it gets an ip and works

Do you get any errors?
Also was your networking down, before trying that?


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

Offline

#5 2009-02-10 00:41:29

aglarond
Member
From: Texas, USA
Registered: 2008-11-20
Posts: 129

Re: Network fails upon load, run dhcpcd and it gets an ip and works

Are you getting ab IP, but just not connecting to the internet? If so, comment out the following 2 lines in rc.conf:

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

-mS

Offline

#6 2009-02-10 01:31:20

Statix
Member
From: Hangzhou, China
Registered: 2008-02-16
Posts: 240

Re: Network fails upon load, run dhcpcd and it gets an ip and works

My guess is that you have to remove the ! from the front of gateway in ROUTES=(!gateway)

That's what I used to have to do on my old desktop.

Also, be sure that 192.168.0.1 is actually your gateway. If you don't know you run dhcpcd then run route.

Last edited by Statix (2009-02-10 01:32:34)


Madly in love with Arch64, Openbox, DotA, and of course... penguins!
Happy to help if you're not a Help Vampire. Use your wonderful resources like ArchWiki, Google, and our wonderful search page.

Offline

#7 2009-02-10 01:47:09

playdafunkimuzic
Member
Registered: 2008-10-25
Posts: 220

Re: Network fails upon load, run dhcpcd and it gets an ip and works

Well, I'm at school now, so I get a random IP, is the only way to do this then, to add the dhcpcd to the /etc/rc.local

Offline

#8 2009-02-10 03:18:44

MarcoRosso
Member
Registered: 2009-02-08
Posts: 49

Re: Network fails upon load, run dhcpcd and it gets an ip and works

Yes I ran into this same issue. The only way that I was able to solve it was the bypass it using wicd. Since it is not a command line tool, it might not be a choice for some. How would you go about getting dhcpcd to work with the rc.local?

Last edited by MarcoRosso (2009-02-10 03:18:58)

Offline

#9 2009-02-10 03:21:04

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

Re: Network fails upon load, run dhcpcd and it gets an ip and works

You shouldn't have to add dhcpcd to /etc/rc.local for whatever reason it appears that the dhcpcd command is failing when being called from the rc.d script. I would highly suggest you figure out why this is happening.

Also you should not have to comment out anything as aglarod suggests. The ! in ROUTES=(!gateway) implies false/not. Which means that gateway would not be set. This is good, because when you run dhcp the gateway is suppose to be found automatically which appears to be happening.

You need to figure out why the network script is failing.

Some steps to get a better idea of what is going on:
killall dhcpcd
ifconfig eth0 down
/etc/rc.d/network start

look for any output given by any of the commands, test networking


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

Offline

#10 2009-02-10 03:25:48

MarcoRosso
Member
Registered: 2009-02-08
Posts: 49

Re: Network fails upon load, run dhcpcd and it gets an ip and works

The reason why it is happening is because it is timing out. Thats it for me. Since it says timeout after the status fail message. Unless i am wrong?

Offline

#11 2009-02-10 03:27:07

aglarond
Member
From: Texas, USA
Registered: 2008-11-20
Posts: 129

Re: Network fails upon load, run dhcpcd and it gets an ip and works

I had commented those lines out because the first time I loaded Arch my default gateway wasn't being set, even though I was using dhcp. I commented both of those lines and everything started working. It's possible I messed with something else, though.

-mS

Offline

#12 2009-02-10 14:24:12

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

Re: Network fails upon load, run dhcpcd and it gets an ip and works

MarcoRosso wrote:

The reason why it is happening is because it is timing out. Thats it for me. Since it says timeout after the status fail message. Unless i am wrong?

This is unlikely because the OP stated that adding dhcpcd eth0 in /etc/rc.local works. If it was timing out that solution would not work. Unless if the OP modified /etc/conf.d/dhcpcd and set a very low timeout limit, I doubt that is the problem here.

aglarond wrote:

I had commented those lines out because the first time I loaded Arch my default gateway wasn't being set, even though I was using dhcp. I commented both of those lines and everything started working. It's possible I messed with something else, though.

-mS

I find that hard to believe. When you comment those lines out no gateway would be being set. You probably did not have ! before routes=(GATEWAY), which would then set an incorrect gateway, if you don't use 192.168.0.1.

@OP
/etc/rc.d/network should be calling dhcpcd to activate the networking on eth0. You haven't modified /etc/conf.d/wireless by some odd chance have you?


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

Offline

#13 2009-02-11 00:35:07

playdafunkimuzic
Member
Registered: 2008-10-25
Posts: 220

Re: Network fails upon load, run dhcpcd and it gets an ip and works

here is my /etc/conf.d/wireless

  GNU nano 2.0.9          File: /etc/conf.d/wireless                            

#
# Settings for wireless cards
#
# For each wireless interface declared in INTERFACES (in rc.conf), declare
# a wlan_${IF} variable that contains the arguments to be passed to
# iwconfig(8).  Then list the original interface name in the
# WLAN_INTERFACES array.
#

#wlan_eth0="eth0 mode managed essid default"
#WLAN_INTERFACES=(eth0)

Offline

#14 2009-02-11 00:48:25

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

Re: Network fails upon load, run dhcpcd and it gets an ip and works

Alright, that rules out that you didn't modify /etc/conf.d/wireless

However can you run the following:
killall dhcpcd
ifconfig eth0 down
/etc/rc.d/network start

and post the output of those commands?


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

Offline

#15 2009-02-11 02:05:07

playdafunkimuzic
Member
Registered: 2008-10-25
Posts: 220

Re: Network fails upon load, run dhcpcd and it gets an ip and works

hm, all of a sudden it works. there's been major internet issues here at school..maybe it was just the ports not working correctly. everything seems fine now. thanks!

Offline

#16 2009-03-13 21:45:49

sjakub
Member
From: Canada/Poland
Registered: 2008-06-16
Posts: 84

Re: Network fails upon load, run dhcpcd and it gets an ip and works

I have very similar issue.
When I run /etc/rc.d/network start, or restart, it fails because dhcpcd times out.
However, if I run: dhcpcd -q eth0 it receives an address (and pretty fast).
And this is exactly the same command rc.d/network script runs.
Somehow dhcpcd -q eth0 run by me works, while the same command run by rc.d/network script - fails.
Any ideas?

Offline

Board footer

Powered by FluxBB