Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dchpcd boot script?[solved]
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
Icer
Guru
Guru


Joined: 26 Aug 2003
Posts: 395
Location: @home

PostPosted: Sun Mar 26, 2006 5:55 pm    Post subject: dchpcd boot script?[solved] Reply with quote

Hello,

My internet connection is using pppoe/adsl. It works just fine.

However if I want to use the LAN and give acces to other pc's there is no ip for eth0. I can manually get ip like this: dhcpcd -G -N -R. The options are there to prevent ntp,dns and gateway getting overwritten by dhcpcd.

So how can I get the dchp IP address automatically at boot time? I've tried some options on /etc/conf.d/net but nothing seems to work.

Thanks.


Last edited by Icer on Tue Mar 28, 2006 4:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Sun Mar 26, 2006 6:21 pm    Post subject: Reply with quote

Code:
rc-update add net.eth0 default

as root. You still need to setup /etc/conf.d/net with the options to dhcpcd.
Back to top
View user's profile Send private message
Icer
Guru
Guru


Joined: 26 Aug 2003
Posts: 395
Location: @home

PostPosted: Sun Mar 26, 2006 6:39 pm    Post subject: Reply with quote

Headrush wrote:
Code:
rc-update add net.eth0 default

as root. You still need to setup /etc/conf.d/net with the options to dhcpcd.


Yes net.eth0 is allready at default runlevel. No problem with that. ADSL starts up ok with the current setup. Dhcpcd does not start.

Here's my /etc/conf.d/net:

Code:
# DHCP
# dhcpcd:   emerge net-misc/dhcpcd
# If you have more than one DHCP client installed, you need to specify which
# one to use - otherwise we default to dhcpcd if available
#modules=( "udhcpc" ) # to select udhcpc over dhcpcd
modules=( "dhcpcd" )
#
# Notes:
# - dhcpcd, udhcpc and pump send the current hostname
#   to the DHCP server by default
# - dhcpcd does not daemonize when the lease time is infinite
# - udhcp-0.9.3-r3 and earlier does not support getting NTP servers
# - dhclient does not support getting NTP servers
# - pump does not support getting NIS servers
# - DHCP tends to erase any existing device information - so add
#   static addresses after dhcp if you need them

# Regardless of which DHCP client you prefer, you configure them the
# same way using one of following depending on which interface modules
# you're using.
config_eth0=( "dhcpcd" )

# For passing custom options to dhcpcd use something like the following.  This
# example reduces the timeout for retrieving an address from 60 seconds (the
# default) to 10 seconds.
###dhcpcd_eth0="-t 10 -N -R -G" <-- doesnt work

# GENERIC DHCP OPTIONS
# Set generic DHCP options like so
###dhcp_eth0="release nodns nontp nonis nogateway nosendhost"

# This tells the dhcp client to release it's lease when it stops, not to
# overwrite dns, ntp and nis settings, not to set a default route and not to
# send the current hostname to the dhcp server and when it starts.
# You can use any combination of the above options - the default is not to
# use any of them.

#-----------------------------------------------------------------------------
# ADSL
# For ADSL support, emerge net-dialup/rp-pppoe
# You should make the following settings and also put your
# username/password information in /etc/ppp/pap-secrets

# Configure the interface to use ADSL
config_eth0=(
                "adsl"
        )

# You probably won't need to edit /etc/ppp/pppoe.conf if you set this
#adsl_user_eth0="my-adsl-username"


I've tried to put dhcpcd inside the config_eth0 line but it didnt work.
Back to top
View user's profile Send private message
Icer
Guru
Guru


Joined: 26 Aug 2003
Posts: 395
Location: @home

PostPosted: Tue Mar 28, 2006 2:50 pm    Post subject: Reply with quote

Bump!

I still got no idea how to properly fix this.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Mar 28, 2006 2:58 pm    Post subject: Reply with quote

config_eth0 can only be specified once, the last one taking precedence if more than once. Hence you always got adsl. If you want both then do this

config_eth0=( "adsl" "dhcp" )
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Icer
Guru
Guru


Joined: 26 Aug 2003
Posts: 395
Location: @home

PostPosted: Tue Mar 28, 2006 4:55 pm    Post subject: Reply with quote

Thanks.

The problem is solved now.

Here's my current config:
Code:
modules_eth0=( "dhcpcd" )
# DHCP
# If you have more than one DHCP client installed, you need to specify which
# one to use - otherwise we default to dhcpcd if available
#modules=( "udhcpc" ) # to select udhcpc over dhcpcd
modules=( "dhcpcd" )
#
# Notes:
# - dhcpcd, udhcpc and pump send the current hostname
#   to the DHCP server by default
# - dhcpcd does not daemonize when the lease time is infinite
# - udhcp-0.9.3-r3 and earlier does not support getting NTP servers
# - dhclient does not support getting NTP servers
# - pump does not support getting NIS servers
# - DHCP tends to erase any existing device information - so add
#   static addresses after dhcp if you need them

# Regardless of which DHCP client you prefer, you configure them the
# same way using one of following depending on which interface modules
# you're using.

dhcpcd_eth0="-t 20"

# For passing custom options to dhcpcd use something like the following.  This
# example reduces the timeout for retrieving an address from 60 seconds (the
# default) to 10 seconds.

# GENERIC DHCP OPTIONS
# Set generic DHCP options like so
dhcp_eth0="release nodns nontp nonis nogateway nosendhost"

# This tells the dhcp client to release it's lease when it stops, not to
# overwrite dns, ntp and nis settings, not to set a default route and not to
# send the current hostname to the dhcp server and when it starts.
# You can use any combination of the above options - the default is not to
# use any of them.

#-----------------------------------------------------------------------------
# ADSL
# For ADSL support, emerge net-dialup/rp-pppoe
# You should make the following settings and also put your
# username/password information in /etc/ppp/pap-secrets

# Configure the interface to use ADSL
config_eth0=( "adsl" "dhcp" )

# You probably won't need to edit /etc/ppp/pppoe.conf if you set this
#adsl_user_eth0="my-adsl-username"
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