2

After many tries, I decided to simplify my problem. I am running W10 on my laptop and Raspbian on my PI2, on which is only connected a USB Wifi dongle. The laptop lan IP is static and set to 192.168.2.1. There is only a direct cable between the laptop and the PI.

To simplify I have: 1. Unpluged the wifi dongle 2. Set the /etc/network/interfaces file like this:

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet static
address 192.168.2.2
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1
  1. Launched on windows "ping 192.168.2.2 -c"
  2. Powered on my PI

Here is the result of the ping test:

Envoi d'une requête 'Ping'  192.168.2.2 avec 32 octets de données :
Délai d'attente de la demande dépassé.
Délai d'attente de la demande dépassé.
Réponse de 192.168.2.1 : Impossible de joindre l'hôte de destination.
Délai d'attente de la demande dépassé.
Délai d'attente de la demande dépassé.
Réponse de 192.168.2.2 : octets=32 temps=4 ms TTL=64
Réponse de 192.168.2.2 : octets=32 temps=2 ms TTL=64
Réponse de 192.168.2.2 : octets=32 temps=2 ms TTL=64
Réponse de 192.168.2.2 : octets=32 temps=2 ms TTL=64
Délai d'attente de la demande dépassé.
Délai d'attente de la demande dépassé.
Délai d'attente de la demande dépassé.
Délai d'attente de la demande dépassé.

As you can see, once the PI boots, it sets its IP to the right value, BUT after few seconds, it loses it. If after few seconds I launch a DHCP server on the computer, the PI gets back its IP from the DHCP.

I have tried to comment the "allow-hotplug eth0" line, but same result.

Any idea how to solve this issue? I don't really understand what is happening (back to dhcp?)/why it is happening.

1

I had the same problem recently, I tracked it down to TWO dhcpcd clients running on the latest jessie image: dhcpcd5 and isc-dhcp-client. dhcpcd5 does not use /etc/network/interfaces, so if you set a static address there, it will still give you a dhcp address. This address is not visible from 'ifconfig' but can be seen as a secondary address with 'ip addr show'.

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.