2

I'm trying to use an raspberrypi (OS=raspbian 4.0.7) I had flying around so I researched a little bit and everything seems to work more or less fine. I am using hostapd in combination with an wifi dongle to offer an AccessPoint and dhcpd as DHCP Server.

Going through the logs i found something strange:

Jul  1 21:34:37 raspberrypi dhcpd: DHCPDISCOVER from 00:e0:4c:18:fd:0c (raspberrypi) via wlan0
Jul  1 21:34:38 raspberrypi dhcpd: DHCPOFFER on 10.0.0.12 to 00:e0:4c:18:fd:0c (raspberrypi) via wlan0
Jul  1 21:35:41 raspberrypi dhcpd: DHCPDISCOVER from 00:e0:4c:18:fd:0c (raspberrypi) via wlan0
Jul  1 21:35:42 raspberrypi dhcpd: DHCPOFFER on 10.0.0.12 to 00:e0:4c:18:fd:0c (raspberrypi) via wlan0
Jul  1 21:36:45 raspberrypi dhcpd: DHCPDISCOVER from 00:e0:4c:18:fd:0c (raspberrypi) via wlan0
Jul  1 21:36:46 raspberrypi dhcpd: DHCPOFFER on 10.0.0.12 to 00:e0:4c:18:fd:0c (raspberrypi) via wlan0

Why is this happening? And how can I stop it?

ifconfig:

eth0  Link encap:Ethernet  HWaddr b8:27:eb:cd:a0:b7
      inet addr:195.169.228.44  Bcast:195.169.229.255  Mask:255.255.254.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:7447 errors:0 dropped:21 overruns:0 frame:0
      TX packets:2033 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:1829496 (1.7 MiB)  TX bytes:347081 (338.9 KiB)

lo    Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:51 errors:0 dropped:0 overruns:0 frame:0
      TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:3876 (3.7 KiB)  TX bytes:3876 (3.7 KiB)

wlan0 Link encap:Ethernet  HWaddr 00:e0:4c:18:fd:0c
      inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:2703 errors:0 dropped:15 overruns:0 frame:0
      TX packets:2713 errors:0 dropped:7 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:467746 (456.7 KiB)  TX bytes:1434643 (1.3 MiB)

dhcpd config:

ddns-update-style none;

default-lease-time 600;
max-lease-time 7200;

authoritative;

subnet 10.0.0.0 netmask 255.255.255.0 {
    range 10.0.0.10 10.0.0.50;
    option broadcast-address 10.0.0.255;
    option routers  10.0.0.1;
    option domain-name "marienbosch-network";
    option domain-name-servers 8.8.8.8, 8.8.4.4;
}

EDIT:

/etc/network/interfaces:

auto lo
    iface lo inet loopback

auto eth0
    allow-hotplug eth0
    iface eth0 inet static
    address 195.169.228.44
    netmask 255.255.254.0
    gateway 195.169.229.254

auto wlan0
iface wlan0 inet static
    address 10.0.0.1
    netmask 255.255.255.0

up iptables-restore < /etc/iptables.ipv4.nat

iptable:

*filter
:INPUT ACCEPT [525:53548]
:FORWARD ACCEPT [6:302]
:OUTPUT ACCEPT [105:11782]
-A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i wlan0 -o eth0 -j ACCEPT
COMMIT

*nat
:PREROUTING ACCEPT [373:47175]
:INPUT ACCEPT [99:10520]
:OUTPUT ACCEPT [34:2555]
:POSTROUTING ACCEPT [7:645]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT

EDIT
in order to try fixing this issue, changed wlan0 from static to dhcp in /etc/network/interfaces
this resulted, after a restart, in the following situation:

Listening on LPF/wlan0/"mac address of wlan device"
Sending on LPF/wlan0/"mac address of wlan device"
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 20
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
No DHCP OFFERS received
...  

, reverted back to static, as displayed under /etc/network/interfaces

5
  • Did you got an answer for this ? Is it solved ? If yes can you help how did you solved it Jun 13, 2016 at 7:39
  • nope, not really, sry. Never really figured it out, a reinstall with a different Linux (Voidlinux) did it, but that's cheating.... In the end I think I had two dhcp server running, but don't ask me how that happened....
    – EyeGotAPie
    Jun 14, 2016 at 9:08
  • So I figured it out why it happend with me . I had same setup and problem like yours however in my case I was running d sudo dhclient from /etc/rc.local(to connect eth0 to get an ip address) and this was forcing wireless card(as sideffect) to ask for an ip to itself . I solved it using sudo dhclient eth0 which made sure that only eth0 would be using dhcp client and not wlan0 Jun 15, 2016 at 6:29
  • Truth be told I remember using dhclient the same way, so most likely that same thing happened to me, thanks for the answer :)
    – EyeGotAPie
    Jun 16, 2016 at 10:16
  • Yes dhclient when passed with no argument tries to configure every interface of system so better to restrict Jun 17, 2016 at 9:04

1 Answer 1

1

Yes it offers IP with help of dhcp daemon, or other Dynamic Host Configuration Protocol utilities that you can download. You can stop the echo simply by setting the configuration file of dhcpd to default.

Edit

The problem was (in my opinion) with '/etc/network/interfaces' as stated in the comments.

The inquirer had settings that sets wlan0 statically but it should have been done as;

'iface wlan0 inet dhcp'

9
  • Maybe I should have been more clear, but what weirds me out is that it offers the IP 10.0.0.12 to the wlan0 device with MAC:00:e0:4c:18:fd:0c. That Device runs the dhcp from IP 10.0.0.1 (as seen in ifconfig). Why would it offer an IP if it has one already? Furthermore, when I default the settings of dhcpd, I remove the the router functionality of the rpi. I mean, it works as a Router and I can connect with a number of devices that get Internet access...
    – EyeGotAPie
    Jul 2, 2015 at 11:12
  • Okay, so I've also set up an access point recently, and used udhcpd for that, maybe the guid you're following had mixed something up, mine was :elinux.org/RPI-Wireless-Hotspot (edit : sorry sirlagz did also have some problems) Jul 2, 2015 at 11:23
  • exactly, first an DHCPDISCOVERY comes from the wlan0 device and is met with an DHCPOFFER for a free IP in the Range (as seen in ifconfig) EDIT: I will read and try said guide when I am back home
    – EyeGotAPie
    Jul 2, 2015 at 11:25
  • 1
    Oh i got it, can you post /etc/network/interfaces, I think something's mixed up there Jul 2, 2015 at 11:26
  • added /etc/network/interfaces and iptables to original Post
    – EyeGotAPie
    Jul 2, 2015 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.