Steven715
Posts: 27
Joined: Mon Dec 24, 2012 9:01 pm
Location: Bedfordshire

DHCP Server giveing wrong ip address

Sun Jan 13, 2013 12:21 pm

Hello there everyone, I am having a little bit of trouble with my DHCP server.
I am also running a TFTP Server this side of things seems to be working well.
What is happening is My dhcp server is giving the correct address and the TFTP Server is sending files as it should however one of the applications that I am trying to run from it is Gparted on boot up Gparted detects an Ethernet card and then proceeds to get an ip address this is where things go wrong the ip address I am using for my system is 175.52.104.... however the ip that is given is 192.168.1..... The pc I am using is vmware I have tryed a real pc and this does the same thing but sometimes it gets the correct ip address and Gparted boots perfectley.
Any Ideas will be Great
Thank you for your time.
Steve

Hear is a snipit of my syslog
Jan 13 12:03:41 raspberrypi dhcpd: DHCPDISCOVER from 3c:62:00:05:be:6b via eth0
Jan 13 12:03:42 raspberrypi dhcpd: DHCPOFFER on 175.52.104.2 to 3c:62:00:05:be:6b (TIVO-C8AC620005BE692) via eth0
Jan 13 12:03:43 raspberrypi udhcpd[1997]: Sending OFFER of 192.168.0.245
Jan 13 12:03:46 raspberrypi dhcpd: DHCPREQUEST for 175.52.104.104 (175.52.104.101) from 3c:62:00:05:be:6b via eth0: unknown lease 175.52.104.104.
Jan 13 12:03:46 raspberrypi dhcpd: DHCPREQUEST for 175.52.104.104 (175.52.104.101) from 3c:62:00:05:be:6b via eth0: unknown lease 175.52.104.104.
Jan 13 12:03:56 raspberrypi dhcpd: DHCPDISCOVER from 00:0c:29:77:eb:84 via eth0
Jan 13 12:03:57 raspberrypi dhcpd: DHCPOFFER on 175.52.104.1 to 00:0c:29:77:eb:84 via eth0
Jan 13 12:03:58 raspberrypi udhcpd[1997]: Sending OFFER of 192.168.0.155
Jan 13 12:03:59 raspberrypi dhcpd: DHCPREQUEST for 175.52.104.1 (175.52.104.124) from 00:0c:29:77:eb:84 via eth0
Jan 13 12:03:59 raspberrypi dhcpd: DHCPACK on 175.52.104.1 to 00:0c:29:77:eb:84 via eth0
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: error 0 TFTP Aborted received from 175.52.104.1
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: failed sending /var/lib/tftpboot/pxelinux.0 to 175.52.104.1
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/pxelinux.0 to 175.52.104.1
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: file /var/lib/tftpboot/pxelinux.cfg/564dd2e8-e2c5-aed3-5482-b6341177eb84 not found
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: file /var/lib/tftpboot/pxelinux.cfg/01-00-0c-29-77-eb-84 not found
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: file /var/lib/tftpboot/pxelinux.cfg/AF346801 not found
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: file /var/lib/tftpboot/pxelinux.cfg/AF34680 not found
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: file /var/lib/tftpboot/pxelinux.cfg/AF3468 not found
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: file /var/lib/tftpboot/pxelinux.cfg/AF346 not found
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: file /var/lib/tftpboot/pxelinux.cfg/AF34 not found
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: file /var/lib/tftpboot/pxelinux.cfg/AF3 not found
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: file /var/lib/tftpboot/pxelinux.cfg/AF not found
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: file /var/lib/tftpboot/pxelinux.cfg/A not found
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/pxelinux.cfg/default to 175.52.104.1
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/vesamenu.c32 to 175.52.104.1
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/pxelinux.cfg/default to 175.52.104.1
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/pxelinux.cfg/cfg/Layout.cfg to 175.52.104.1
Jan 13 12:03:59 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/pxelinux.cfg/pics/main.jpg to 175.52.104.1
Jan 13 12:04:00 raspberrypi dnsmasq-tftp[1714]: failed sending /var/lib/tftpboot/kernels/gparted/initrd.img to 175.52.104.1
Jan 13 12:04:03 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/vesamenu.c32 to 175.52.104.1
Jan 13 12:04:03 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/pxelinux.cfg/cfg/Recovery.cfg to 175.52.104.1
Jan 13 12:04:03 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/pxelinux.cfg/cfg/Layout.cfg to 175.52.104.1
Jan 13 12:04:03 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/pxelinux.cfg/pics/utils4.jpg to 175.52.104.1
Jan 13 12:04:10 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/kernels/gparted/vmlinuz to 175.52.104.1
Jan 13 12:04:27 raspberrypi dnsmasq-tftp[1714]: sent /var/lib/tftpboot/kernels/gparted/initrd.img to 175.52.104.1
Jan 13 12:04:39 raspberrypi dhcpd: DHCPDISCOVER from 00:0c:29:77:eb:84 via eth0
Jan 13 12:04:39 raspberrypi dhcpd: DHCPOFFER on 175.52.104.1 to 00:0c:29:77:eb:84 via eth0
Jan 13 12:04:39 raspberrypi udhcpd[1997]: Sending OFFER of 192.168.0.155
Jan 13 12:04:39 raspberrypi dhcpd: DHCPREQUEST for 175.52.104.118 (175.52.104.101) from 00:0c:29:77:eb:84 via eth0: unknown lease 175.52.104.118.
Jan 13 12:04:40 raspberrypi udhcpd[1997]: Sending ACK to 192.168.0.155
Jan 13 12:04:40 raspberrypi dhcpd: DHCPREQUEST for 192.168.0.155 (175.52.104.124) from 00:0c:29:77:eb:84 via eth0: wrong network.
Jan 13 12:04:40 raspberrypi dhcpd: DHCPNAK on 192.168.0.155 to 00:0c:29:77:eb:84 via eth0
Jan 13 12:05:29 raspberrypi dbus[1699]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper)
Jan 13 12:05:30 raspberrypi dbus[1699]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Jan 13 12:05:30 raspberrypi polkitd[2107]: started daemon version 0.105 using authority implementation `local' version `0.105'
Jan 13 12:05:30 raspberrypi dbus[1699]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Jan 13 12:05:30 raspberrypi dbus[1699]: [system] Successfully activated service 'org.freedesktop.ConsoleKit'
And hear is a copy of my DHCP Server configuration

Code: Select all

ddns-update-style interim;
ignore client-updates;

default-lease-time 86400;
max-lease-time 604800;
authoritative;

#server-identifier 175.52.104.124;

subnet 175.52.104.0 netmask 255.255.255.0 {
       range 175.52.104.1 175.52.104.100;		# Range of IP addresses to be issued to DHCP clients
	default-lease-time 3600;
       max-lease-time 4800;
       filename "pxelinux.0";
       next-server 175.52.104.124;
       option subnet-mask 255.255.255.0;		# Default subnet mask to be used by DHCP clients
       option broadcast-address 175.52.104.255;	# Default broadcastaddress to be used by DHCP clients
       option routers 175.52.104.101;		# Default gateway to be used by DHCP clients
	option domain-name "StevensRPI.sww";
	option domain-name-servers 175.52.104.124;
 }

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: DHCP Server giveing wrong ip address

Sun Jan 13, 2013 12:44 pm

Steven715 wrote:Hello there everyone, I am having a little bit of trouble with my DHCP server.
Could it be that you have a router that is issuing the 192.168. address?

User avatar
cyrano
Posts: 714
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: DHCP Server giveing wrong ip address

Sun Jan 13, 2013 1:13 pm

Steven715 wrote:Hello there everyone, I am having a little bit of trouble with my DHCP server.
...the ip address I am using for my system is 175.52.104.... however the ip that is given is 192.168.1.....
175.52.104.n is a public ip. DHCP uses private ip's in the range 192.168.n.n or 10.n.n.n. Your DHCP server simply can not give that ip. And you shouldn't be using it on a local network, unless that network isn't connected to the internet.

For instance: 175.52.104.n seems to be allocated to some entity in Asia.

Steven715
Posts: 27
Joined: Mon Dec 24, 2012 9:01 pm
Location: Bedfordshire

Re: DHCP Server giveing wrong ip address

Mon Jan 14, 2013 5:50 pm

fbutler wrote:
Steven715 wrote:Hello there everyone, I am having a little bit of trouble with my DHCP server.
Could it be that you have a router that is issuing the 192.168. address?
I must admit I first thought this but my local router is also setup with the 175.52.104.n I took this out of the question by putting a pc and my pi on there own little network both connected through RJ45. But the results was the same. Thank you for the reply.

Steve

Steven715
Posts: 27
Joined: Mon Dec 24, 2012 9:01 pm
Location: Bedfordshire

Re: DHCP Server giveing wrong ip address

Mon Jan 14, 2013 5:56 pm

cyrano wrote:
Steven715 wrote:Hello there everyone, I am having a little bit of trouble with my DHCP server.
...the ip address I am using for my system is 175.52.104.... however the ip that is given is 192.168.1.....
175.52.104.n is a public ip. DHCP uses private ip's in the range 192.168.n.n or 10.n.n.n. Your DHCP server simply can not give that ip. And you shouldn't be using it on a local network, unless that network isn't connected to the internet.

For instance: 175.52.104.n seems to be allocated to some entity in Asia.
Ahh this sounds like it could be the problem :( ever since I started my network when I was a kid I just made up the 175.52.104.n address from my head I did not know that the192.168.n.n was use for home use that explains why all the routers come like that looks like I will be changing my IP address system after all these years.
I will give this a go and I will report back of my findings.

But I bet you are right after reading what you have put there.

Thank you for your reply.
Steve

zaxi
Posts: 1
Joined: Mon Jan 14, 2013 9:27 pm

Re: DHCP Server giveing wrong ip address

Mon Jan 14, 2013 9:44 pm

Check for another DHCP server. Could be your router that is providing you with the 192.168.xxx.xxx IP. DHCP server does not care what IP range you set up as long as it is valid IP range. But you should use private IP range as long as your router is set up with using NAT. Otherwise you could get issue with access to internet, mainly company called NorthStar who own the IP range 175.48.0.0 - 175.63.255.255.

/zaxi

Steven715
Posts: 27
Joined: Mon Dec 24, 2012 9:01 pm
Location: Bedfordshire

Re: DHCP Server giveing wrong ip address

Tue Jan 15, 2013 5:50 am

I know it's not the router as I turned it off when I was testing this I am off shift over the next few days so I will give the 192.168 range ago if this fixes things then all good and welli will
Have to reconfigure my whole network to the 192.168. Thank you and you all for your replies I will let you know how I get on. Regards steve

Steven715
Posts: 27
Joined: Mon Dec 24, 2012 9:01 pm
Location: Bedfordshire

Solved DHCP Server giveing wrong ip address

Fri Jan 18, 2013 9:02 pm

Hello there Just to update everyone on my now solved problem with this I found that udhcpd service was running and therefore giving the odd ip address and now everything is back up and running again even with my chosen ip address :D for those that may have been following this hear is the code that I had to put in.

Code: Select all

/etc/init.d/udhcpd stop

jordan314
Posts: 15
Joined: Fri Feb 08, 2013 10:06 pm

Re: Solved DHCP Server giveing wrong ip address

Sun Jul 06, 2014 9:55 pm

Steven715 wrote:Hello there Just to update everyone on my now solved problem with this I found that udhcpd service was running and therefore giving the odd ip address and now everything is back up and running again even with my chosen ip address :D for those that may have been following this hear is the code that I had to put in.

Code: Select all

/etc/init.d/udhcpd stop
Thank you Steven!!
I had followed this tutorial (http://www.novitiate.co.uk/?p=183 ) and was wondering why this one (http://www.daveconroy.com/turn-your-ras ... ment-13114 ) wasn't working. It was because udhcpd was running for me too. I had to remove it from my /etc/rc.local or run sudo update-rc.d udhcpd remove.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: DHCP Server giveing wrong ip address

Sun Jul 06, 2014 10:05 pm

192.168.0.0 isn't the only reserved IP addresses for private use. 10.0.0.0 is also available. There are others as well. See RFC1918 for a complete list of networks.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

klricks
Posts: 6359
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: DHCP Server giveing wrong ip address

Sun Jul 06, 2014 11:45 pm

Private IP ranges shown here:
http://en.wikipedia.org/wiki/Private_network
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

Return to “Networking and servers”