0

I'm using wpa_supplicant as a client to connect to an AP. When i'm trying to change the wireless connection from STATIC to DHCP(dhclient is invoked using the below command with leases file[dhclient-wlan0.leases] option,

sudo /sbin/dhclient -V wlan0 -lf /var/lib/dhclient-wlan0.leases.

  1. In "ipconfig" command and on UI of network manager static ip is being displayed. But in kernel messages I could see the DHCP IP is acquired.
  2. Have also observed that if we invoke dhclient without the lease file option, the issue is not seen.

After deep debugging from the /sbin/dhclient scriipt, has observed that the old IP isnot getting released

To explain more, if I set 192.168.3.102 as a STATIC ip, and if i want a dynamic ip (for eg: 3.20.30.10) which is not a static one. But my ifconfig shows "192.168.3.102" not the dynamic ip.

Need some help with regard to the above behavior of dhclient as well as how to resolve this issue when we are invoking dhclient with lease-file option.

1 Answer 1

0

You should change your /etc/network/interfaces file from.

auto wlan0
iface wlan0 inet static
    address 192.168.3.102
    netmask 255.255.255.0
    gateway 192.168.0.1

To:

    auto wlan0
    iface wlan0 inet dhcp

Then you are going to need to bring your wlan0 down and back up. ifdown wlan0, ifup wlan0.

1
  • Thanks Dean for ur suggestion. That part is taken care in my wpa_supplicant code. but still the IP is not getting modified only when we are modifying the network from "Static" configuration to "Dynamic" configuration May 20, 2015 at 7:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .