You are not logged in.
Pages: 1
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
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
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
I always thought that you only needed to define your gateway if you're using static ip not dhcp.
Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz
Offline
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
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
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
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
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
Pages: 1