Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Getting dhcp to work.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
devlaam
n00b
n00b


Joined: 22 Oct 2009
Posts: 49
Location: Alkmaar, Netherlands

PostPosted: Thu Feb 21, 2013 11:38 am    Post subject: Getting dhcp to work. Reply with quote

Just for the record, i mention the following. If you install the genkernel 3.5.7 (configuration out of the box) and make use of busy-box dhcp client (that is, you do not emerge dhcpcd) you may get the following error:
Code:
 * Bringing up interface eth0
 *   You are using a bash array for config_eth0.
 *   This feature will be removed in the future.
 *   Please see net.example for the correct format for config_eth0.
 *   dhcp ...
 *     Running udhcpc ...udhcpc: socket(AF_PACKET,2,8): Address family not supported by protocol
 *     start-stop-daemon: failed to start `/bin/busybox'
 * ERROR: net.eth0 failed to start

There are a couple of things here. First the bash array 'warning'. This one is simple to cure, just remove the '(' and ')' in your /etc/conf.d/net, so instead of
Code:
config_eth0=( "dhcp" )

have
Code:
config_eth0="dhcp"

in the file.

So far the easy part. The problem with the udhcpc client i was not able to solve, but i used the workaround, also found in http://lists.busybox.net/pipermail/busybox-cvs/2011-August/032753.html. If you are more clever, please feel free to post a solution to this problem. :-)

This workaround however, introduces a few other problems. I discuss these here because the usage of dhcpcd is the default gentoo way. Well, the new configuration tries to get an ipv6 address first! Depending on your provider, this may be successful, but for me the result was that some other server on the subnet provided me an ipv6 id. This joker thought he is funny, but of course it is not. In any case, i think ipv6 is not ready in general for the large public, so better switch it off. This can be done by adding
Code:
noipv6rs

to your /etc/dhcpcd.conf. For more information see: http://www.daemon-systems.org/man/dhcpcd.conf.5.html

And, although this indeed blocks ipv6 effectivly, i did not yet receive an IP number yet, for i got the following error message:
Code:
 * Bringing up interface eth0
 *   dhcp ...
 *     Running dhcpcd ...dhcpcd[16286]: version 5.6.4 starting
   dhcpcd[16286]: eth0: checking for 169.254.187.99
   dhcpcd[16286]: send_arp: Bad file descriptor
   dhcpcd[16286]: send_arp: Bad file descriptor
   dhcpcd[16286]: send_arp: Bad file descriptor
   dhcpcd[16286]: eth0: using IPv4LL address 169.254.187.99
   dhcpcd[16286]: forked to background, child pid 16297
 *     received address 169.254.187.99/16

So, still bad luck :-( After some searching on internet, i found the following post. http://forums-web2.gentoo.org/viewtopic-t-807377-start-0.html so i checked and indeed, my CONFIG_PACKET was not set
Code:
> zgrep PACKET /proc/config.gz
# CONFIG_PACKET  is not set

this appears to be the new default. After setting this (Networking -> Networking options -> Packet socket) and recompiling the kernel, dhcpcd works as expected. Please note it may fail the first 30 seconds for it tries the old number first. But quickly after that you should get a new, usable IP number.

So, hopefully this post saves you some time.
Back to top
View user's profile Send private message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 617

PostPosted: Tue Feb 26, 2013 4:25 am    Post subject: Reply with quote

I just built a new machine and am in the process of trying to install Gentoo. I think I'm experiencing the same problem, the trouble is I don't think I have the capability to re-compile a kernel when using the liveDVD or the minimal (I've tried both).

Any other suggestions to get ipv4 working?

I have a working DHCP router (and another Gentoo box). I can easily add noipv6rs to the dhcpd.conf but is there a module that I could load that could solve this? I'm really stuck here! Getting internet up is essential to installing this bad-boy! :-S

dq
Back to top
View user's profile Send private message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 617

PostPosted: Tue Feb 26, 2013 4:30 am    Post subject: Reply with quote

I think this problem may be bigger than dhcpcd though since I cannot talk to my router at all! The hardware is detected with no problem but it keeps assigning 169.254.x.x to my eth0. If I manually set an ip, it still can't talk to the router.

dq
Back to top
View user's profile Send private message
blain3
n00b
n00b


Joined: 02 Dec 2012
Posts: 30
Location: Southern Pensylvania

PostPosted: Tue Feb 26, 2013 6:29 pm    Post subject: Reply with quote

I use dhcpcd as my rc default, and it works like a charm, even with wireless i just have to type in the essid since most if not all of my wireless networks are open. Personally it doesnt bother me as i can connect via command line, and do anyhow, without issue or dependency on a GUI. I have yet to see this error you guys are talking about. The only time i ran into trouble was using more then one default internet rc. If i see any problems ill post the errors tho
_________________
#uname -s -m -i -p -v -o -n
Linux
x86_64
GenuineIntel
Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz
#1 SMP PREEMPT Mon Nov 19 11:17:39 UTC 2012
GNU/Linux
xobtihs
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2247

PostPosted: Tue Feb 26, 2013 9:31 pm    Post subject: Re: Getting dhcp to work. Reply with quote

devlaam wrote:
Code:
noipv6rs

devlaam ... you could likewise solve this with the following:

/etc/conf.d/net
Code:
enable_ipv6_eth0="false"

As for other issues with udhcpc, it as a very short timeout (4 seconds) for dhcp requests which is often the cause of it aquiring a self-assigned address (169.254.187.x) to solve this you can increase the timeout:

/etc/conf.d/net
Code:
modules_eth0="!plug udhcpc"
dhcpcd_eth0="-T 10"

don quixada ... your issue may also be due to (dhcpcd) timeouts ... you can try the following:

/etc/conf.d/net
Code:
modules_eth0="!plug dhcpcd"
dhcpcd_eth0="-t 10"
enable_ipv6_eth0="false"

HTH & best ... khay
Back to top
View user's profile Send private message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 617

PostPosted: Tue Feb 26, 2013 10:24 pm    Post subject: Reply with quote

Thanks, I tried that but it didn't work. I think it may be my motherboard. I posted about it here:

http://forums.gentoo.org/viewtopic-t-952398-highlight-.html

Thanks.

dq
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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