2

I have the following problem. I cannot get an IP address using DHCP. I have a 10/100Mb adapter on a set-top box connected to a 1000Mb LAN.

When I boot up the set-top box it gets an IP from the DHCP server. But when I disable the ethernet interface using

ifconfig eth0 down

leave it for about 10 minutes and re-enable it with

ifconfig eth0 up

it doesn't get an IP. The OS of the set-top box is a Linux-MIPSEL with kernel 2.6.22.19 and the udhcpc application is used for getting IP from DHCP.

udhcpc application is starting correctly as I can see. I also used tcpdump in order to see the package transactions. The command I used is the following:

tcpdump -lenx -i eth0 -l -vvv port bootps or port bootpc

The log from the tcpdump showed that it is sent a Discover package but I don't receive any response from the DHCP server. The log files from the server shows that the server sending an Offer but I don't receive this package.

As I am not a network expert, can you suggest what it might be the problem? Could it be that I have a 10/100Mb adapter to a 1000Mb LAN? Or might be something else?

PS: I also used a 10/100Mb switch to connect to the LAN but I get the same problem.

Update 1: After using as dhcp client the udhcpc, I thought of trying something else. So I installed ConnMan which is a network manager and has it's own dhcp client. Unfortunately I had a similar result, instead of not getting IP at all, I was getting the APIPA address which is similar of not getting an IP. I am start thinking that maybe the endianness has something to do...

Update 2: Sorry for the delay, I have tested the set-top box to some home routers like a Cisco-Linksys E1500 and works with no problem. I also have more information regarding the LAN. There is a switch between the DHCP server and the set-box, a Netgear GS724TS with Hardware ver 00.00.01, Boot ver 1.0.0.07 and Software ver V3.1.0.1. As I can see in the Monitor section of the web interface of the switch there is not so much information even if I select the debug in the log filter.

8
  • What kind of switches do you have, like the exact brands/model/firmware?
    – Chris S
    Mar 6, 2012 at 18:13
  • Hi Chris, I don't have that information, all the sys admins have gone. I will ask them tomorrow... Mar 6, 2012 at 18:38
  • I have worked as a sysadmin in the past, but currently I am embedded engineer. I thought that serverfault.com would be more appropriate for the question I asked. So, stackoverflow.com is more appropriate for this kind of question? Mar 6, 2012 at 19:03
  • It's only really important in general because you probably wont have access to the systems that need "fixin". I'm fairly sure the switch is blocking DHCP at some point, probably as a misguided security protocol. But it's pretty hard to diagnose when you're playing telephone. Otherwise, yes, this is the correct site for such questions. Normally we request that "end users" (which essentially covers you in this case) contact their sysadmins with such issues; and those sysadmins are welcome to post here if they have questions.
    – Chris S
    Mar 6, 2012 at 19:06
  • Hi again Chris, there is a Netgear GS724TS switch with firmware V3.1.0.1. I have access to the web interface of the switch and the logs in the monitoring section don't give much information even if I choose the debug in the log filter. Apr 18, 2012 at 18:07

3 Answers 3

3

My initial thought is that your 'up' script on the interface isn't calling the dhcp client, but the dhcp client is called somewhere in one of the runlevels in the boot process.

After doing ifconfig eth0 up have you tried running dhclient? I'm not familiar with Linux-MIPSEL but this would be my line of investigation. If that works, find your eth0-up scipt or similar and check that out.

I very much doubt it's anything to do with a 100Mb NIC on a 1Gb switch. The switch and NIC will negotiate for 100Mb and that will be that, your problem is in a different layer.

3
  • Just check the network switch has auto-negotiate turned on, rather than being hard coded at 1Gb.
    – Decado
    Mar 6, 2012 at 13:20
  • yeah granted, that would be fail! Mar 6, 2012 at 13:28
  • Thanks @SimonJGreen for the answer, when I enable the ethernet the dhcp client is enabled, if not already enabled. A script is running in the background that monitors if the cable is plugged or unplugged (or the interface enabled or disabled). When enabled it runs the dhcp client. I should check maybe more on what is happening with the dhcp client... Mar 6, 2012 at 13:47
2

ifconfig eth0 up doesn't do anything but bring the ethernet device up i.e. make it active. You need to either assign a static ip address (with ifconfig eth0 192.168.0.2, for example) or run a dhcp client to get an IP address (in your case, udhcpc).

3
  • Thanks @webtoe for the answer. There is a script that it runs in the background that monitors if cable is plugged/unplugged or the interface enabled/disabled. So when enabled it activates the dhcp client. Maybe I should check more the dhcp client because it calls some other scripts... Mar 6, 2012 at 13:50
  • I believe this could be ifplugd then? I've noticed that running on my DreamPlug (I switched it off as the config was messing with other things and I didn't need it).
    – webtoe
    Mar 6, 2012 at 13:55
  • No, actually I use a custom one, here is the link of how it looks like pastebin.com/aZwuCxPy. Which calls another script :) Mar 6, 2012 at 14:17
0

Have you checked the cable? I once used a crossover cable instead of a straight one and got similar problems.

1
  • Thanks @Nils for the answer. I checked it and it is straight. I also changed it with another one, just in case, but I get the same results... Mar 6, 2012 at 15:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .