3

A sub-question: why is my client requesting a specific IP address without a dhclient running?

I have two access points. One is serving up two SSIDs, the other just one SSID. When I connect to the two-SSID AP, I get two IP addresses assigned. When I connect to the other access point, I only get one IP address. And if I then switch back, I'm back to getting two IP addresses. Why is this happening? (Note that all the discussion of this that I can find online is aimed at getting two IP addresses, not about unwanted addresses

I'm connected with a Raspberry Pi. I'm running multiple Pis over NFS with a blacklisted on-board Broadcomm Wifi and a USB Realtek wifi adapter (a test setup convenient for me). I've shut down all but one Pi but and I've rebooted the running Pi several times with the same result. I've also rebooted the APs.

Background Info

The association command I'm using is

nmcli device wifi connect abcdefg ifname wlan0 password hijklmnop

Here is the configuration after association (the dynamic address is assigned shortly before the secondary forever address as observed by running the command multiple times during the association process).

pi@rpinode:~ $ ip a
...
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether bc:ec:23:c3:1d:0b brd ff:ff:ff:ff:ff:ff
    inet 10.61.1.90/16 brd 10.61.255.255 scope global dynamic wlan0
       valid_lft 43038sec preferred_lft 43038sec
    inet 10.61.1.84/16 brd 10.61.255.255 scope global secondary wlan0
       valid_lft forever preferred_lft forever

Note that ifconfig only shows the dynamic address (perhaps not surprising -- but just pointing out that this isn't an alias).

Right out of the gate, the Pi is requesting a specific address although /etc/dhcp/dhclient.conf doesn't seem to be requesting such a thing. Here are the non-comment lines from that file:

# /etc/dhcp/dhclient.conf
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    dhcp6.name-servers, dhcp6.domain-search,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers;

And here is the dhcpdump output where you will see the Pi requesting the IP secondary IP address it received when connecting to the other SSID on the same IP. Note that I started this command before running the above nmcli command.

pi@rpinode:~ $ sudo dhcpdump -i wlan0

  TIME: 2019-05-07 14:17:03.276
    IP: 0.0.0.0 (bc:ec:23:c3:1d:b) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 431be597
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: bc:ec:23:c3:1d:0b:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         3 (DHCPREQUEST)
OPTION:  61 (  7) Client-identifier         01:bc:ec:23:c3:1d:0b
OPTION:  50 (  4) Request IP address        192.168.1.144
OPTION:  57 (  2) Maximum DHCP message size 1500
OPTION:  60 ( 44) Vendor class identifier   dhcpcd-6.7.1:Linux-4.9.35-v7+:armv7l:BCM2835
OPTION:  12 (  7) Host name                 rpinode
OPTION: 145 (  1) ???                       01               .
OPTION:  55 ( 14) Parameter Request List      1 (Subnet mask)
                        121 (Classless Static Route)
                         33 (Static route)
                          3 (Routers)
                          6 (DNS server)
                         12 (Host name)
                         15 (Domainname)
                         28 (Broadcast address)
                         42 (NTP servers)
                         51 (IP address leasetime)
                         54 (Server identifier)
                         58 (T1)
                         59 (T2)
                        119 (Domain Search)

---------------------------------------------------------------------------

  TIME: 2019-05-07 14:17:03.278
    IP: 10.61.0.1 (xx:xx:xx:xx:xx:xx) > 255.255.255.255 (bc:ec:23:c3:1d:b)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 431be597
  SECS: 0
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 10.61.0.1
GIADDR: 0.0.0.0
CHADDR: bc:ec:23:c3:1d:0b:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         6 (DHCPNAK)
OPTION:  54 (  4) Server identifier         10.61.0.1
OPTION:  56 ( 31) Message                   requested address not available
---------------------------------------------------------------------------

  TIME: 2019-05-07 14:17:03.606
    IP: 0.0.0.0 (bc:ec:23:c3:1d:b) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 9f05d956
  SECS: 1
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: bc:ec:23:c3:1d:0b:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  61 (  7) Client-identifier         01:bc:ec:23:c3:1d:0b
OPTION:  80 (  0) Naming Authority                           
OPTION: 116 (  1) DHCP Autoconfiguration    01               .
OPTION:  57 (  2) Maximum DHCP message size 1500
OPTION:  60 ( 44) Vendor class identifier   dhcpcd-6.7.1:Linux-4.9.35-v7+:armv7l:BCM2835
OPTION:  12 (  7) Host name                 rpinode
OPTION: 145 (  1) ???                       01               .
OPTION:  55 ( 14) Parameter Request List      1 (Subnet mask)
                        121 (Classless Static Route)
                         33 (Static route)
                          3 (Routers)
                          6 (DNS server)
                         12 (Host name)
                         15 (Domainname)
                         28 (Broadcast address)
                         42 (NTP servers)
                         51 (IP address leasetime)
                         54 (Server identifier)
                         58 (T1)
                         59 (T2)
                        119 (Domain Search)

---------------------------------------------------------------------------

  TIME: 2019-05-07 14:17:03.607
    IP: 0.0.0.0 (bc:ec:23:c3:1d:b) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 97268832
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: bc:ec:23:c3:1d:0b:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  12 (  7) Host name                 rpinode
OPTION:  55 ( 18) Parameter Request List      1 (Subnet mask)
                         28 (Broadcast address)
                          2 (Time offset)
                          3 (Routers)
                         15 (Domainname)
                          6 (DNS server)
                        119 (Domain Search)
                         12 (Host name)
                         44 (NetBIOS name server)
                         47 (NetBIOS scope)
                         26 (Interface MTU)
                        121 (Classless Static Route)
                         42 (NTP servers)
                        121 (Classless Static Route)
                        249 (MSFT - Classless route)
                         33 (Static route)
                        252 (MSFT - WinSock Proxy Auto Detect)
                         42 (NTP servers)

---------------------------------------------------------------------------

  TIME: 2019-05-07 14:17:04.486
    IP: 10.61.0.1 (xx:xx:xx:xx:xx:xx) > 10.61.1.84 (bc:ec:23:c3:1d:b)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 9f05d956
  SECS: 1
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 10.61.1.84
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: bc:ec:23:c3:1d:0b:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         2 (DHCPOFFER)
OPTION:  54 (  4) Server identifier         10.61.0.1
OPTION:  51 (  4) IP address leasetime      43200 (12h)
OPTION:   1 (  4) Subnet mask               255.255.0.0
OPTION:   3 (  4) Routers                   10.61.0.1
OPTION:   6 (  4) DNS server                10.61.0.1
OPTION:  15 ( 18) Domainname                myownurl.com
OPTION:  58 (  4) T1                        21600 (6h)
OPTION:  59 (  4) T2                        37800 (10h30m)
---------------------------------------------------------------------------

  TIME: 2019-05-07 14:17:04.486
    IP: 10.61.0.1 (xx:xx:xx:xx:xx:xx) > 10.61.1.90 (bc:ec:23:c3:1d:b)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 97268832
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 10.61.1.90
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: bc:ec:23:c3:1d:0b:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         2 (DHCPOFFER)
OPTION:  54 (  4) Server identifier         10.61.0.1
OPTION:  51 (  4) IP address leasetime      43200 (12h)
OPTION:   1 (  4) Subnet mask               255.255.0.0
OPTION:   3 (  4) Routers                   10.61.0.1
OPTION:  15 ( 18) Domainname                myownurl.com
OPTION:   6 (  4) DNS server                10.61.0.1
---------------------------------------------------------------------------

  TIME: 2019-05-07 14:17:04.487
    IP: 0.0.0.0 (bc:ec:23:c3:1d:b) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 97268832
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: bc:ec:23:c3:1d:0b:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         3 (DHCPREQUEST)
OPTION:  54 (  4) Server identifier         10.61.0.1
OPTION:  50 (  4) Request IP address        10.61.1.90
OPTION:  12 (  7) Host name                 rpinode
OPTION:  55 ( 18) Parameter Request List      1 (Subnet mask)
                         28 (Broadcast address)
                          2 (Time offset)
                          3 (Routers)
                         15 (Domainname)
                          6 (DNS server)
                        119 (Domain Search)
                         12 (Host name)
                         44 (NetBIOS name server)
                         47 (NetBIOS scope)
                         26 (Interface MTU)
                        121 (Classless Static Route)
                         42 (NTP servers)
                        121 (Classless Static Route)
                        249 (MSFT - Classless route)
                         33 (Static route)
                        252 (MSFT - WinSock Proxy Auto Detect)
                         42 (NTP servers)

---------------------------------------------------------------------------

  TIME: 2019-05-07 14:17:04.487
    IP: 0.0.0.0 (bc:ec:23:c3:1d:b) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 9f05d956
  SECS: 2
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: bc:ec:23:c3:1d:0b:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         3 (DHCPREQUEST)
OPTION:  61 (  7) Client-identifier         01:bc:ec:23:c3:1d:0b
OPTION:  50 (  4) Request IP address        10.61.1.84
OPTION:  54 (  4) Server identifier         10.61.0.1
OPTION:  57 (  2) Maximum DHCP message size 1500
OPTION:  60 ( 44) Vendor class identifier   dhcpcd-6.7.1:Linux-4.9.35-v7+:armv7l:BCM2835
OPTION:  12 (  7) Host name                 rpinode
OPTION: 145 (  1) ???                       01               .
OPTION:  55 ( 14) Parameter Request List      1 (Subnet mask)
                        121 (Classless Static Route)
                         33 (Static route)
                          3 (Routers)
                          6 (DNS server)
                         12 (Host name)
                         15 (Domainname)
                         28 (Broadcast address)
                         42 (NTP servers)
                         51 (IP address leasetime)
                         54 (Server identifier)
                         58 (T1)
                         59 (T2)
                        119 (Domain Search)

---------------------------------------------------------------------------

  TIME: 2019-05-07 14:17:04.488
    IP: 10.61.0.1 (xx:xx:xx:xx:xx:xx) > 10.61.1.90 (bc:ec:23:c3:1d:b)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 97268832
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 10.61.1.90
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: bc:ec:23:c3:1d:0b:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         5 (DHCPACK)
OPTION:  54 (  4) Server identifier         10.61.0.1
OPTION:  51 (  4) IP address leasetime      43200 (12h)
OPTION:   1 (  4) Subnet mask               255.255.0.0
OPTION:   3 (  4) Routers                   10.61.0.1
OPTION:  15 ( 18) Domainname                myownurl.com
OPTION:   6 (  4) DNS server                10.61.0.1
---------------------------------------------------------------------------

  TIME: 2019-05-07 14:17:04.489
    IP: 10.61.0.1 (xx:xx:xx:xx:xx:xx) > 10.61.1.84 (bc:ec:23:c3:1d:b)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 9f05d956
  SECS: 2
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 10.61.1.84
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: bc:ec:23:c3:1d:0b:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         5 (DHCPACK)
OPTION:  54 (  4) Server identifier         10.61.0.1
OPTION:  51 (  4) IP address leasetime      43200 (12h)
OPTION:   1 (  4) Subnet mask               255.255.0.0
OPTION:   3 (  4) Routers                   10.61.0.1
OPTION:   6 (  4) DNS server                10.61.0.1
OPTION:  15 ( 18) Domainname                myownurl.com
OPTION:  58 (  4) T1                        21600 (6h)
OPTION:  59 (  4) T2                        37800 (10h30m)
---------------------------------------------------------------------------

I'm getting IP address and file system for eth0 from a dnsmasq server. I think the following is incorrect but don't believe it plays into my issues.

# /etc/network/interfaces

auto lo
iface lo inet loopback
  • Has The interface a static ip address and is it running the DHCP client on top? – Rui F Ribeiro May 13 at 21:05
  • No. There is no static IP configured for wlan0. I do have eth0 configured statically. I'll add /etc/network/interfaces to my post. – MrMas May 13 at 21:11
  • I simplified /etc/network/interfaces since my dnsmasq server is providing my ip address. I've reflected my changes above. So I guess eth0 is not statically configured after all. – MrMas May 13 at 21:26
  • It feels like the secondary IP address is being cached somewhere but I cannot find it. – MrMas May 13 at 21:33
  • 1
    Things to try: (1) ps axu and see how many dhclient are running (maybe a network manager misconfiguration started several)? (2) Kill all dhclients, wait a bit to make sure network manager doesn't start them again (stop network manager if necessary), start dhcpdump, remove both IP addresses with ip addr del ..., start a single dhclient manually, see what happens. If you get two offers, you got two DHCP servers on the network ... – dirkt May 14 at 7:00

Your Answer

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

Browse other questions tagged or ask your own question.