View previous topic :: View next topic |
Author |
Message |
Icer Guru
Joined: 26 Aug 2003 Posts: 395 Location: @home
|
Posted: Sun Mar 26, 2006 5:55 pm Post subject: dchpcd boot script?[solved] |
|
|
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 |
|
|
Headrush Watchman
Joined: 06 Nov 2003 Posts: 5597 Location: Bizarro World
|
Posted: Sun Mar 26, 2006 6:21 pm Post subject: |
|
|
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 |
|
|
Icer Guru
Joined: 26 Aug 2003 Posts: 395 Location: @home
|
Posted: Sun Mar 26, 2006 6:39 pm Post subject: |
|
|
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 |
|
|
Icer Guru
Joined: 26 Aug 2003 Posts: 395 Location: @home
|
Posted: Tue Mar 28, 2006 2:50 pm Post subject: |
|
|
Bump!
I still got no idea how to properly fix this. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
Icer Guru
Joined: 26 Aug 2003 Posts: 395 Location: @home
|
Posted: Tue Mar 28, 2006 4:55 pm Post subject: |
|
|
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 |
|
|
|