Score:0

Raspberry Pi 1 WiFi adapter receives 2 dhcp addresses

eg flag

I have a raspberry pi 1 with a USB WiFi adapter. The wlan0 interface has 2 IP Addresses and i dont know why:

pi@smart-meter:~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b8:27:eb:0e:68:e2 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 24:05:0f:b1:50:75 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.155/24 brd 192.168.2.255 scope global dynamic noprefixroute wlan0
       valid_lft 86212sec preferred_lft 75412sec
    inet 192.168.2.158/24 brd 192.168.2.255 scope global secondary dynamic wlan0
       valid_lft 86214sec preferred_lft 86214sec

How can i tell the Raspbian only to use one address?

pi@smart-meter:~ $ cat /var/lib/dhcp/dhclient.wlan0.leases 
default-duid "\000\001\000\001)\226\277\334\300%\351\030\373I";
lease {
  interface "wlan0";
  fixed-address 192.168.2.158;
  option subnet-mask 255.255.255.0;
  option routers 192.168.2.1;
  option dhcp-lease-time 86400;
  option dhcp-message-type 5;
  option domain-name-servers 192.168.2.250;
  option dhcp-server-identifier 192.168.2.1;
  option dhcp-renewal-time 43200;
  option ntp-servers 192.168.2.1;
  option broadcast-address 192.168.2.255;
  option dhcp-rebinding-time 75600;
  option domain-name "fritz.box";
  renew 3 2022/05/11 14:08:00;
  rebind 3 2022/05/11 14:08:00;
  expire 3 2022/05/11 14:08:00;
}
lease {
  interface "wlan0";
  fixed-address 192.168.2.158;
  option subnet-mask 255.255.255.0;
  option routers 192.168.2.1;
  option dhcp-lease-time 86400;
  option dhcp-message-type 5;
  option domain-name-servers 192.168.2.250;
  option dhcp-server-identifier 192.168.2.1;
  option dhcp-renewal-time 43200;
  option ntp-servers 192.168.2.1;
  option broadcast-address 192.168.2.255;
  option dhcp-rebinding-time 75600;
  option domain-name "fritz.box";
  renew 3 2022/05/11 23:36:13;
  rebind 4 2022/05/12 11:09:17;
  expire 4 2022/05/12 14:09:17;
}

In the dhcpcd.conf i have nothing changed. /etc/network/interfaces:

pi@smart-meter:~ $ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
#source /etc/network/interfaces.d/*

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid "xxxx"
wpa-psk xxxx

EDIT:

Starting Nmap 7.60 ( https://nmap.org ) at 2022-05-11 20:04 CEST
Pre-scan script results:
| broadcast-dhcp-discover: 
|   Response 1 of 1: 
|     IP Offered: 192.168.2.105
|     DHCP Message Type: DHCPOFFER
|     Server Identifier: 192.168.2.1
|     IP Address Lease Time: 1d00h00m00s
|     Renewal Time Value: 12h00m00s
|     Rebinding Time Value: 21h00m00s
|     Subnet Mask: 255.255.255.0
|     Router: 192.168.2.1
|     Domain Name Server: 192.168.2.250
|     Domain Name: fritz.box
|     Broadcast Address: 192.168.2.255
|_    NTP Servers: 192.168.2.1
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 1.41 seconds
djdomi avatar
za flag
`sudo nmap --script broadcast-dhcp-discover 255.255.255.255 -p67` to test if more as one dhcp is running
Marc avatar
eg flag
@djdomi That would be surprising to me, doesnt seem like it. :/
djdomi avatar
za flag
well, we still have in here the issue that raspberry is a end user device which is not on topic for serverfault.com but might be on topic on superuser.com. does the double ip makes an issue? why don't you set it statically?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.