You are not logged in.

#1 2008-10-07 14:46:44

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Arch Reboot = No Internet

When I start or reboot my Arch Linux box, I then have to perform a 'dhcpcd eth0' every time. How can I just have Arch do a DHCP request for an available IP every time during startup?


./

Offline

#2 2008-10-07 14:56:49

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Arch Reboot = No Internet

The standard network configuration through /etc/rc.conf and network daemon should do that: http://wiki.archlinux.org/index.php/Network#For_DHCP_IP

Offline

#3 2008-10-07 14:58:54

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: Arch Reboot = No Internet

Edit: The link above works, too...

First figure out what your gateway device's IP address is. This will most likely be the same IP as your router. Next, edit your rc.conf to read like the following, replacing "GATEWAYLOCATION" with the IP address:

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 GATEWAYLOCATION"
ROUTES=(gateway)

That should make it all work.

Last edited by dav7 (2008-10-07 14:59:44)


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#4 2008-10-07 15:38:02

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: Arch Reboot = No Internet

I always thought that you only needed to define your gateway if you're using static ip not dhcp. hmm


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#5 2008-10-07 16:07:50

pointone
Wiki Admin
From: Waterloo, ON
Registered: 2008-02-21
Posts: 379

Re: Arch Reboot = No Internet

Indeed--if using DHCP, you can safely (and probably should) use:

ROUTES=(!gateway)

M*cr*s*ft: Who needs quality when you have marketing?

Offline

#6 2008-10-08 13:35:12

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Re: Arch Reboot = No Internet

When I install Arch, I am asked to modify some files. 1st of them being /etc/rc.conf.

There I change my "hostname" from 'myhost' to whatever I want the laptop to be.

Then below there is a section for networking it appears.

I change 'eth0=x.x.x.x x.x.x.x' to simply read 'eth0=dhcp'

Now the section right below is 'gateway='default gw 192.168.0.1' & ROUTES=(!gateway)'

I have no idea if I need to remove anything from the gateway section. Obviously that static IP is not my gw address so I am assuming I remove it, right?


./

Offline

#7 2008-10-08 13:59:03

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,694
Website

Re: Arch Reboot = No Internet

For the record: The point of DHCP is to auto set up your connection; therefore you do not need to specify the gateway option, nor /etc/resolv.conf which will be updated by the DHCP server.

This is an example of a working DHCP set up:

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)

Hope this helps.

R.

edit:

If you have a connection on start up and not upon reboot, I would suspect that a driver is not being loaded.
What's the result of ifconfig ** after ** a reboot?

Last edited by ralvez (2008-10-08 14:01:48)

Offline

#8 2008-10-08 14:02:08

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Re: Arch Reboot = No Internet

ralvez wrote:

For the record: The point of DHCP is to auto set up your connection; therefore you do not need to specify the gateway option, nor /etc/resolv.conf which will be updated by the DHCP server.

This is an example of a working DHCP set up:

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)

Hope this helps.

R.

The file I found conflicting info on is /etc/rc.conf, not /etc/resolv.conf.

I booted my laptop installation of DHCP so I have no idea where that gw address came from but I assume I would just remove it.

Which file are you displaying in the code above?


./

Offline

#9 2008-10-08 14:13:58

SkonesMickLoud
Arch Linux f@h Team Member
From: The D of C
Registered: 2008-09-20
Posts: 178

Re: Arch Reboot = No Internet

Editing /etc/resolv.conf shouldn't even come in to play if you use DHCP, as the DHCP daemon will dynamically create and destroy the file.

It's best to comment out something in lieu of removing it.  That way you can just delete one # instead of rewriting a line.  Or back it up.  It shouldn't matter though, the "gateway" line that ralvez posted is exactly the same on the wiki, and it's the exact same line I've got on my system (not that I can speak for everyone).

That file is rc.conf.

Offline

Board footer

Powered by FluxBB