okissele
Posts: 6
Joined: Tue Mar 12, 2013 11:34 pm

No IP address via DHCP

Wed Mar 13, 2013 9:21 am

Hello Everyone,

I have got two PI’s two weeks ago and yesterday tried to get Ethernet working.
Fresh raspbian OS is used.
I am using a cable modem that is DHCP capable (my laptop gets dynamic IP without problems). Ethernet cable is also fine – tried with the laptop.
Connecting it to PI and booting, I see the “link” light and “100” light ON.
The IP address is not available.

I checked /etc/network/interfaces:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

Tried to change to:

auto eth0
iface eth0 inet dhcp

Did not help also.

On the booting log I see:
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
5-6 such messages, then:
No DHCPOFFERS received

I tried to reduce power consumed by PI (took away the USB mouse and keyboard), did not change anything. I am using 5V 1A power supply. I tried the second PI board - the same problem.

Any idea what the problem might be?

turbine2
Posts: 47
Joined: Thu Dec 06, 2012 11:21 am

Re: No IP address via DHCP

Wed Mar 13, 2013 12:13 pm

Looks like whatever offers your devices their DHCP address is not running. I am guessing that the DHCP address will be supplied by your ISP (the people who provided your cable modem) and it may be that they have a list of MACs that they will assign a DHCP address to, and that the MAC of your PI is not on the list. ISPs that assign DHCP addresses to the home devices tend to limit the number of devices a customer can have.
If that's the case, you'll need to talk to your cable provider to find out how to get your PI allowed on as well, or get your own cable router and get that to do the DHCP and NAT required.
Not sure if you're UK based but I know how this more of less how it works for Virgin Media; it's a little more complex but that's the general overview.
David

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26660
Joined: Sat Jul 30, 2011 7:41 pm

Re: No IP address via DHCP

Wed Mar 13, 2013 12:21 pm

Sounds like for some reason the device isn't handing out an IP address when requested - Have you got MAC address filtering turned on on the modem/router?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

paulknewton
Posts: 45
Joined: Tue Mar 12, 2013 9:17 pm
Location: Luxembourg

Re: No IP address via DHCP

Wed Mar 13, 2013 12:34 pm

Just a correction to one of the previous posts. The DHCP server is running on your internal network (typically your router). When new devices attach to your local network (i.e. a device in your home), they request an IP address and are granted this by the DHCP server.

Your DHCP server can use information about the MAC address to influence the IP address it hands out (e.g. giving the same address to the same MAC address each time). But DHCP does not involve your ISP.

It is true that your ISP will assign your router a single external IP address. This will typically be dynamically assigned and will expire over time and be renewed with another (you can find out this external address using sites such as http://www.whatsmyip.org/). But this is completely separate from the granting of IP addresses to devices on your internal home network.

If your Pi is not getting an IP address, this is a problem between the Pi and the router - not your ISP.

Hope this makes it a little clearer (although it doesn't solve your problem!)

regards,
paul.

okissele
Posts: 6
Joined: Tue Mar 12, 2013 11:34 pm

Re: No IP address via DHCP

Wed Mar 13, 2013 1:43 pm

Hello,
I am not at UK but in Germany.

I do not believe the cable modem is configured for one IP (device) at a time but I can find it out, ISP is UnityMedia.
I actually tried to disconnect my laptop and insert the same cable into PI and boot. The same result – no IP assigned. So I think it has nothing to do with one/two devices connected to the modem.

I did not check about MAC address filtering on/off on the modem, can try this evening. Would it be that the MAC of both! PI’s in “black” list is? Hard to imagine.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: No IP address via DHCP

Wed Mar 13, 2013 2:11 pm

Whilst I'm not familiar with that many different "cable modem" types, those that have been provided by my ISP usually have had only one ethernet port** and require an external router to provide a DHCP service for the (household's) Local Area Network (LAN) using one of the local IP address groups. If I understand things correctly the ISP's DHCP server (or equivalent) will supply a Wide Area Network (WAN) "internet" IP address and also may require the connected computer's (or router's) MAC address to be one "registered" with the ISP during the (cable modem's) "installation" process. If your "cable modem" has more than one ethernet port it may have a router "built in". Generally, unless you really want your Pi to be exposed "to the world", it should be connected to a LAN and either set up to get its (LAN-based) IP address via DHCP running on a router, or use a static IP address within the LAN's IP group.
Trev.
**and, sometimes, a USB port.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

okissele
Posts: 6
Joined: Tue Mar 12, 2013 11:34 pm

Re: No IP address via DHCP

Wed Mar 13, 2013 5:39 pm

Hello,
the cable modem has one Ethernet port and one USB port.
Nobody asked for a MAC address of my laptop so it can not be registered there.
It can be by chance in the “allowed” list but is hard to believe.
In order to get PI connected also, I used a powered Ethernet hub which is working, all ports.
The laptop gets IP connected to any of those but PI – not.

It can be useful to get a connection to the world and I do not understand up to now why it does not work.
For the moment, to start with and have possibility of data exchange, the local IP might be solution. I do not know how to do it without having a second network card in the PC/laptop. Such configuration I used before (with a digital scope). I have no second network card in my laptop.

Regards.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: No IP address via DHCP

Wed Mar 13, 2013 6:32 pm

okissele wrote: Hello,
the cable modem has one Ethernet port and one USB port.
Nobody asked for a MAC address of my laptop so it can not be registered there.
It can be by chance in the “allowed” list but is hard to believe.
In order to get PI connected also, I used a powered Ethernet hub which is working, all ports.
The laptop gets IP connected to any of those but PI – not.
....
Aha! :idea: is it possible that your "powered Ethernet hub" is a "switch" rather than a "router". A "switch" allows computers on a LAN to talk to each other via their pre-assigned IP addresses. It doesn't have much "intelligence" and no DHCP server. The ports are simply numbered eg 1 - 5 for a 5-port switch. A router usually has 1 of its ports labelled WAN or internet (which, eventually connects to the internet eg. via a cable modem), has "intelligence", you can log in to it with a web browser (the default LAN IP address can be something like 192.168.1.1 but that can be changed) and runs a DHCP server. If you do have a switch, and not a router, the only DHCP server running is that via your modem and that may only provide a single IP address which is captured by the fastest m/c connected ie. the laptop. Since DHCP assigned address are leased for a fixed time (usually a few hours for a router, but possibly "days" for ISP's server), if the laptop/modem isn't "releasing" it properly then a new one won't be given to the Pi. A possible test may be to power down the cable modem after disconnecting the laptop but before powering up the Pi. Re: MAC address - if they or you ran "setup" or "installation" software for the cable modem that could pick up the MAC address without you "being asked".
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

okissele
Posts: 6
Joined: Tue Mar 12, 2013 11:34 pm

Re: No IP address via DHCP

Thu Mar 14, 2013 9:11 am

Yes, it is the modem/switch.
What confused me, that I tried to boot PI connecting it directly to the cable modem and it did not get any IP too. I forgot that the IP given before to my laptop, is kept and new one what obviously not given.
Power cycle of the cable modem and connecting a PI directly to it or via switch, solved the problem. it got IP. Laptop connected after this, did not get an IP...
So in reality it is a problem of the cable modem/switch – only one IP via DHCP.
I have used this switch with several PC those had static IPs and is surprised it does not work with DHCP. :cry:

turbine2
Posts: 47
Joined: Thu Dec 06, 2012 11:21 am

Re: No IP address via DHCP

Thu Mar 14, 2013 4:32 pm

Just out of interest, what are the first 3 parts of the IP address? (something like 192.168.1.something)
David

turbine2
Posts: 47
Joined: Thu Dec 06, 2012 11:21 am

Re: No IP address via DHCP

Thu Mar 14, 2013 4:37 pm

paulknewton wrote:It is true that your ISP will assign your router a single external IP address. This will typically be dynamically assigned and will expire over time and be renewed with another (you can find out this external address using sites such as http://www.whatsmyip.org/). But this is completely separate from the granting of IP addresses to devices on your internal home network.
That's true for a lot of ISPs, especially those that are DSL based, but cable based ones can (and do) act differently. Virgin Media will issue devices in a customer's home a DHCP address from their pool (there's a limit on the number a customer can have, 5 I think), although the Super Hub devices that they ship now are full gateways with a DHCP server and NAT.
Not sure on why there is a difference, it may be something lost in the annals of history where someone made that decision.
David

yaohong
Posts: 1
Joined: Wed May 01, 2013 9:20 am

Re: No IP address via DHCP

Wed May 01, 2013 9:33 am

HI,I have same problem.but ,in fact. I spell eth0 as etho,so it is my mistake.when I change it, all is ok.
maybe your problem is same . thanks.

ffo
Posts: 1
Joined: Mon Oct 19, 2015 6:04 pm

Re: No IP address via DHCP

Wed Nov 18, 2015 10:20 am

Hi ALL.
I have the same problem as okissele, w/ one difference: my PI used to work just fine, grabing its own IP address from
my LANs switch (which is connected to an ISP router) and since yestarday it stopped getting that address.

Nothing that I've worked so far, nothing: powering down all devices, ISP route, switch, changing ethernet network cables.

I tried several different setting onto cmdline.txt, using ip=169.254.0.2 or even ip=192.168.1.40, which is my LANs IP range.
All other devices: laptop, desktop, cell phones, etc grab its own IP address w/ no further problems at all. All in the range 192.168.1.2-192.168.1.50.

Don't know what else to do.
Any clues?

Regards,
FFO

pedroponte
Posts: 1
Joined: Thu Sep 15, 2016 1:46 pm

Re: No IP address via DHCP

Thu Sep 15, 2016 1:52 pm

turbine2 wrote:Looks like whatever offers your devices their DHCP address is not running. I am guessing that the DHCP address will be supplied by your ISP (the people who provided your cable modem) and it may be that they have a list of MACs that they will assign a DHCP address to, and that the MAC of your PI is not on the list. ISPs that assign DHCP addresses to the home devices tend to limit the number of devices a customer can have.
If that's the case, you'll need to talk to your cable provider to find out how to get your PI allowed on as well, or get your own cable router and get that to do the DHCP and NAT required.
Not sure if you're UK based but I know how this more of less how it works for Virgin Media; it's a little more complex but that's the general overview.
I have a pi configured as router with 2 usb ethernet ports.
Eth2 is acting as dhcp server and working properly. Eth1 should be connected to the internet and get a public ip from the isp modem.
It is connected to my virgin media super hub 2 which in turn is acting as a modem only.
Although the pi normally gets ip from another router in my house, it doesn't get one from the virgin media one, ie no public ip assigned to it.
Would you be able to confirm please based on your experience if this could be virgin media blocking it by device type or mac address?
Many thanks

strickja
Posts: 2
Joined: Tue Aug 07, 2018 6:34 pm

Re: No IP address via DHCP

Thu Aug 09, 2018 6:20 pm

I have a similar , perplexing problem ; have Uverse in house , both wired and wireless ; the wireless IPTV boxes have a wired ethernet port

When I hook any laptop or desktop to one of the IPTV boxes enet port, using linux mint, it grabs and gets DHCP or uses an in range address I static assign on the router

When I hook my Pi up to the same cable that works on my desktop or laptop, the pi only comes up with a local link address, even though full duplex, link, activity all act like its on the net, but its not

Fresh install of Raspbian, I can assign and in range but not in use IP , but it will not ping and can't get to internet

Tried multiple power sources, nothing connect to usb or HDMI etc, does not appear to be power problem, its like the pi is not making a request or the DHCP server on the built in router isn't recognizing it

Ifconfig shows eth0 up but not connected.

Any help appreciated

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: No IP address via DHCP

Fri Aug 10, 2018 7:17 am

Do you have MAC address filtering on your router?

How many addresses are assigned to the router's DHCP pool?

Start by giving the router a reboot.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

fdmsh
Posts: 1
Joined: Sat Jul 25, 2020 4:14 pm

Re: No IP address via DHCP

Sat Jul 25, 2020 4:20 pm

Hello there. Make sure no static is set in /etc/dhcpcd.conf and let it get ip through router dhcp. I had the same situation with pi-hole installed. Somehow it forced static ip during the installation process, even when i clicked no. I've erased those strings and rebooted pi. No problem now.

User avatar
neilgl
Posts: 2185
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: No IP address via DHCP

Sun Jul 26, 2020 8:23 pm

Necro of the week (2013).?

Return to “Beginners”