Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] dhcpcd eth0 needed in every boot?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
RayQ
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2005
Posts: 93

PostPosted: Fri Jul 22, 2005 5:07 am    Post subject: [SOLVED] dhcpcd eth0 needed in every boot? Reply with quote

Hi, I've noticed I don't have internet access from the start of boot. I have to su, and then do
Code:

dhcpcd eth0

For it to work, every time, after starting X or whatever.
Is there any way this could be done automatically on boot?
Thanks


Last edited by RayQ on Fri Jul 22, 2005 5:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Fri Jul 22, 2005 5:34 am    Post subject: Reply with quote

usually it should, if your /etc/conf.d/net is configured correctly and the driver for your NIC is autoloaded at startup (if it is built modular).

What does your /etc/conf.d/net look like?
Do you get any error messages at bootup?
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Fri Jul 22, 2005 1:28 pm    Post subject: Reply with quote

Is net.eth0 in your default runlevel?
Check by doing this:
Code:
rc-status default
Back to top
View user's profile Send private message
RayQ
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2005
Posts: 93

PostPosted: Fri Jul 22, 2005 3:14 pm    Post subject: Reply with quote

Code:

 xdm                                                                 [ started ]
 ntp-client                                                            [   off ]
 sshd                                                                [ started ]
 acpid                                                               [ started ]
 local                                                               [ started ]
 mysql                                                               [ started ]
 vixie-cron                                                          [ started ]
 syslog-ng                                                           [ started ]
 domainname                                                          [ started ]
 coldplug                                                            [ started ]
 net.eth0                                                            [ started ]
 netmount                                                            [ started ]
 xinetd                                                              [ started ]
 hotplug                                                             [ started ]




Code:

# /etc/conf.d/net:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface
#
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
#iface_eth0="dhcp"
#dhcpcd_eth0="..."

# For adding aliases to a interface
#
#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.
#
# To add a custom netmask/broadcast address to created aliases,
# uncomment and change accordingly.  Leave commented to assign
# defaults for that interface.
#
#broadcast_eth0="192.168.0.255 192.168.0.255"
#netmask_eth0="255.255.255.0 255.255.255.0"


# For setting the default gateway
#
#gateway="eth0/192.168.0.1"


I think it's the /etc/conf.d/net file...shouldn't it be iface_eth0="dhcp"?
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Fri Jul 22, 2005 4:07 pm    Post subject: Reply with quote

You didn't configure your conf.d/net as nephros suggested. Make these changes

current:
Code:
iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
#iface_eth0="dhcp"
#dhcpcd_eth0="..."


changes:
Code:
#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"
#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"
# For passing options to dhcpcd use dhcpcd_eth?
#
iface_eth0="dhcp"
dhcpcd_eth0="-t 3"


You can read more about this int he gentoo handbook in section '8.b. Networking Information'. I think things may have changed a bit with the new baselayout, but the above way will still work.

Note: -t 3 sets only a three second timeout for dhcp.
Back to top
View user's profile Send private message
nephros
Advocate
Advocate


Joined: 07 Feb 2003
Posts: 2139
Location: Graz, Austria (Europe - no kangaroos.)

PostPosted: Fri Jul 22, 2005 4:16 pm    Post subject: Reply with quote

RayQ wrote:
I think it's the /etc/conf.d/net file...shouldn't it be iface_eth0="dhcp"?

First off this looks like an older version of this config file.
Make sure you have the latest version of baselyout, and have a look at /etc/conf.d/net.example first. (I am running ~x86 though, it could be that the new config version hasn't made it into stable yet. In that case, forget it. :) )

Anyway, with your current settup eth0 is given a fixed IP of 192.168.0.2 and dhcp is never used.
You could try the following:
Code:

iface_eth0="dhcp"
alias_eth0="192.168.0.2"

This will create two virtual networking devices, eth0 with the dhcp address, and eth0:1 with 192.168.0.2.
If you don't have a LAN connected to eth0 though you can leave out the alias.

HTH.
_________________
Please put [SOLVED] in your topic if you are a moron.
Back to top
View user's profile Send private message
RayQ
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jul 2005
Posts: 93

PostPosted: Fri Jul 22, 2005 5:33 pm    Post subject: Reply with quote

Thanks :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum