LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   DHCP doesn't work on slackware13.0 (https://www.linuxquestions.org/questions/slackware-14/dhcp-doesnt-work-on-slackware13-0-a-751293/)

debuserua 08-31-2009 08:05 AM

Quote:

Originally Posted by lamosa (Post 3663808)
I updated the dhcpcd to version 5.0.7 and also tried to use dhclient command. In both cases did not work.

Sorry for my English. I'm Brazilian.

Thanks
Lamosa

You restart your system? Maybe, but I'm not sure, must be restarted DHCP-client - dhcpcd. When system start, execute script - /etc/rc.d/rc.inet1 where is located string such /sbin/dhcpcd.
For more detailed visit this link, were I find this information:http://www.slackbook.org/html/book.h...GURATION-TCPIP

dwr1 08-31-2009 08:35 AM

I tried with the netconfig utility, and hand editing the rc.wireless.conf script (i usually run the iwconfig command manually) and no other files in /etc/rc.d/. And I ran iwconfig and 'dhcpcd eth0' manually. Both worked on my system.

To all those with problems, I assume you can see eth0, or wlan0, or whatever with ifconfig?

debuserua 08-31-2009 08:55 AM

Quote:

Originally Posted by dwr1 (Post 3663919)
I tried with the netconfig utility, and hand editing the rc.wireless.conf script (i usually run the iwconfig command manually) and no other files in /etc/rc.d/. And I ran iwconfig and 'dhcpcd eth0' manually. Both worked on my system.

To all those with problems, I assume you can see eth0, or wlan0, or whatever with ifconfig?

Before netconfig I can see eth0 by ifconfig -a, which means that you can see your eth0 without assign IP; when I put ifconfig eth0 was not. After netconfig eth0 appeared.

dwr1 08-31-2009 10:36 AM

In that case, if you're doing everything manually, I'd run dhcpcd with the -d option. Or, if you're doing everything with the scripts, i'd change DHCP_DEBUG[0] from "" to "yes" in /etc/rc.d/rc.inetd1 as previously suggested. Then post/google the debug output you get.

zyli2006 08-31-2009 01:11 PM

Quote:

Originally Posted by rworkman (Post 3663426)
There's a known bug in dhcpcd-3.x that very few people ran across during hte -current cycle, but it was too late to consider an upgrade to dhcpcd-5.0.x. You might consider trying to build and install it instead, but probably it's easier to just try dhclient instead.

Thanks torworkman. Seems that dhclient works for me, here is what I did:
1. run netconfig, choose DHCP
2. run /etc/rc.d/rc.inet1 stop and then
run /etc/rc.d/rc.inet1 start, the response is

Code:

Polling for DHCP server on interface eth0:
err, eth0: timed out
warn, eth0: using IPV4LL address 169.254.57.222
dhcpcd.sh: interface eth0 has been configured with new IP=169.254.57.222

The ip 169.***.... is not correct, seems just a randomly assigned ip. And I couldn't connect to internet using this ip.

3. run dhclient, the response is
Code:

Listening on LPF/eth0/00:2e:4f:f7:ef:e4
Sending on  LPF/eth0/00:2e:4f:f7:ef:e4
Sending on  Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 128.161.176.1
bound to 128.161.178.143 -- renewal in 39857 seconds.

where 128.161.178.143 is the correct ip I got when the network was normal, and I can access internet now.

How to config the system to use dhclient automatically? Now when I reboot the system, I still need to run dhclient as root manually.

Hardtack 08-31-2009 02:04 PM

I had the same problem with dhcp not working in version 13.0. I tried replacing the dhcp and dhcpd packages from 13.0 with those from 12.2 and it now works.

rg3 08-31-2009 03:27 PM

Quote:

How to config the system to use dhclient automatically? Now when I reboot the system, I still need to run dhclient as root manually.
First, remove any configuration for eth0 that appears in /etc/rc.d/rc.inet1.conf. Then, add the following in a line at the end of /etc/rc.d/rc.local:

/sbin/dhclient eth0

I think that should do it, but I'm not 100% sure.

NetNightmare 09-01-2009 04:03 AM

Quote:


The ip 169.***.... is not correct, seems just a randomly assigned ip. And I couldn't connect to internet using this ip.


Those are APIPA address , they are used for zeroconf on microsoft machine, pratically when a DHCP client is not able to aquire an IP , it automatically assign an APIPA one : http://compnetworking.about.com/cs/p...ldef_apipa.htm

you can disable that behavior on dhcpcd using the -L option or --noipv4ll

lamosa 09-01-2009 11:37 AM

Hi all. Network DHCP is working now! Just installed slackware again. I don't know what happened before.

Thanks all.
Lamosa

2Gnu 09-11-2009 02:48 PM

In case it helps someone, let me add my experiences from today:

A machine I upgraded to 13.0 last weekend and have been using since decided to hang on "Polling for DHCP server on interface eth0" this morning. It would not time out, nor would it acquire an IP address. The kernel had not panicked, but the system would not boot past this step. Intel mobo with on-board Intel gigabit NIC.

I rebooted several times, with no change in symptoms. The system is dual-boot and worked in Windows. Booted with the Slack DVD, chrooted into the system and saw this in /var/log/messages:

Code:

Sep 11 09:33:17 wingnut logger: /etc/rc.d/rc.inet1:  /sbin/ifconfig lo 127.0.0.1
Sep 11 09:33:17 wingnut logger: /etc/rc.d/rc.inet1:  /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
Sep 11 09:33:17 wingnut logger: /etc/rc.d/rc.inet1:  /sbin/dhcpcd -t 10  eth0
Sep 11 09:33:17 wingnut dhcpcd[2939]: eth0: dhcpcd 3.2.3 starting
Sep 11 09:33:17 wingnut dhcpcd[2939]: eth0: hardware address = 00:1c:c0:01:8d:9e
Sep 11 09:33:18 wingnut dhcpcd[2939]: eth0: DUID = 00:01:00:01:12:35:6c:3a:00:1c:c0:01:8d:9e
Sep 11 09:33:18 wingnut dhcpcd[2939]: eth0: broadcasting for a lease
Sep 11 09:33:19 wingnut kernel: e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
Sep 11 09:33:19 wingnut kernel: 0000:00:19.0: eth0: 10/100 speed: disabling TSO
Sep 11 09:33:21 wingnut dhcpcd[2939]: eth0: offered 192.168.1.111 from 192.168.1.1 `foothill'
Sep 11 09:33:21 wingnut dhcpcd[2939]: eth0: received NAK: (null)
Sep 11 09:33:22 wingnut dhcpcd[2939]: eth0: broadcasting for a lease
Sep 11 09:33:22 wingnut dhcpcd[2939]: eth0: offered 192.168.1.111 from 192.168.1.1 `foothill'
Sep 11 09:33:22 wingnut dhcpcd[2939]: eth0: received NAK: (null)

The last three lines repeated ad infinitum.

DHCP timeout was set for 10s in both the inet1 script and inet1.conf file. No lingering .new files floating around. Tried adding a gateway IP address in inet1.conf. Nada.

Finding this thread, I got the most recent stable dhcpcd code, compiled and installed it. System booted first try. (LQ saves my a$$ once again.)

By way of comparison, here's the message log now:
Code:

Sep 11 10:01:33 wingnut logger: /etc/rc.d/rc.inet1:  /sbin/ifconfig lo 127.0.0.1
Sep 11 10:01:33 wingnut logger: /etc/rc.d/rc.inet1:  /sbin/route add -net 127.0.
0.0 netmask 255.0.0.0 lo
Sep 11 10:01:33 wingnut logger: /etc/rc.d/rc.inet1:  /sbin/dhcpcd -t 10  eth0
Sep 11 10:01:33 wingnut dhcpcd: version 5.1.0 starting
Sep 11 10:01:34 wingnut dhcpcd: eth0: broadcasting for a lease
Sep 11 10:01:35 wingnut kernel: e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex
, Flow Control: RX/TX
Sep 11 10:01:35 wingnut kernel: 0000:00:19.0: eth0: 10/100 speed: disabling TSO
Sep 11 10:01:37 wingnut dhcpcd: eth0: offered 192.168.1.100 from 192.168.1.1 `fo
othill'
Sep 11 10:01:37 wingnut dhcpcd: eth0: acknowledged 192.168.1.100 from 192.168.1.
1 `foothill'
Sep 11 10:01:37 wingnut dhcpcd: eth0: checking for 192.168.1.100
Sep 11 10:01:42 wingnut dhcpcd: eth0: leased 192.168.1.100 for 259200 seconds
Sep 11 10:01:42 wingnut dhcpcd: forking to background

Since I did not take the time to put dhcpcd into debug, I can't say this was very scientific but it seems like the new version fixed my issue.

globaltree 09-11-2009 09:14 PM

Well... make sure it's not a firewall issue:

if your machine is running in a local network behind a firewall, the firewall could interfere with dhclient or dhcpcd or dhcpd if the necessary ports were blocked...

just wanted to rule out the obvious

2Gnu 09-11-2009 11:38 PM

My firewall is also the DHCP server. The only rules are WAN to LAN. No rules for LAN to LAN and no changes were made to the firewall recently.


All times are GMT -5. The time now is 09:23 AM.