wpa_supplicant doesn't get new IP when re-associate?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
First of all, sorry for my English. I am struggling to setup my wlan so it can re-associate to another hotspot and renew its IP automatically. I have found a similar question but nobody responded.
I am using Debian stretch. The first association works fine but when the WiFi re-associates with another hotspot (for whatever reason (e.g. first hotspot gets shutdown)) the IP stays the same. If I manually run dhclient wlan0
the IP will refresh. But I want it to be automatic.
Here is my /etc/network/interfaces
:
allow-hotplug eth0
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
/etc/wpa_supplicant/wpa_supplicant.conf
contains:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="FrstHotspot"
psk="some password"
network=
ssid="SecondHotspot"
psk="some password"
debian wifi dhcp wpa-supplicant wlan
add a comment |Â
up vote
0
down vote
favorite
First of all, sorry for my English. I am struggling to setup my wlan so it can re-associate to another hotspot and renew its IP automatically. I have found a similar question but nobody responded.
I am using Debian stretch. The first association works fine but when the WiFi re-associates with another hotspot (for whatever reason (e.g. first hotspot gets shutdown)) the IP stays the same. If I manually run dhclient wlan0
the IP will refresh. But I want it to be automatic.
Here is my /etc/network/interfaces
:
allow-hotplug eth0
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
/etc/wpa_supplicant/wpa_supplicant.conf
contains:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="FrstHotspot"
psk="some password"
network=
ssid="SecondHotspot"
psk="some password"
debian wifi dhcp wpa-supplicant wlan
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
First of all, sorry for my English. I am struggling to setup my wlan so it can re-associate to another hotspot and renew its IP automatically. I have found a similar question but nobody responded.
I am using Debian stretch. The first association works fine but when the WiFi re-associates with another hotspot (for whatever reason (e.g. first hotspot gets shutdown)) the IP stays the same. If I manually run dhclient wlan0
the IP will refresh. But I want it to be automatic.
Here is my /etc/network/interfaces
:
allow-hotplug eth0
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
/etc/wpa_supplicant/wpa_supplicant.conf
contains:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="FrstHotspot"
psk="some password"
network=
ssid="SecondHotspot"
psk="some password"
debian wifi dhcp wpa-supplicant wlan
First of all, sorry for my English. I am struggling to setup my wlan so it can re-associate to another hotspot and renew its IP automatically. I have found a similar question but nobody responded.
I am using Debian stretch. The first association works fine but when the WiFi re-associates with another hotspot (for whatever reason (e.g. first hotspot gets shutdown)) the IP stays the same. If I manually run dhclient wlan0
the IP will refresh. But I want it to be automatic.
Here is my /etc/network/interfaces
:
allow-hotplug eth0
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
/etc/wpa_supplicant/wpa_supplicant.conf
contains:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="FrstHotspot"
psk="some password"
network=
ssid="SecondHotspot"
psk="some password"
debian wifi dhcp wpa-supplicant wlan
edited Jul 19 at 13:55
Anderson
987
987
asked Jul 19 at 9:01
Floufen
62
62
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
Partial answer: wpa_supplicant
by itself only manages authentication on WLAN interfaces. dhclient
is run by another layer, either the traditional ifup
/ifdown
or others like network manager. wpa_supplicant
can send a signal to the other layer, but the other layer must be configured for that.
So the first step is to find out what kind of network management you have installed (Debian supports several). Then you need to configure it.
The wpa_supplicant
documentation also to have a document on roaming access, this may also contain hints how to correctly setup ifup/ifdown for automatic reconnect. Look in /usr/share/doc/
.
Thank you for your answer @dirkt. How to figure out wich network manager I am using? At first, my debian comes with connman but I disable it to setup the wpa_supplicant only.
â Floufen
Jul 19 at 12:44
add a comment |Â
up vote
0
down vote
As for your /etc/network/interfaces
, I think it has to be something similar to this to work with your current configuration:
allow-hotplug wlan0
iface wlan0 inet manual
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
You are defining the interface has dhcp, which then enters in conflict with the wpa_supplicant
that invokes DHCP. In that way, wpa_supplicant
loses the ability to signal when the ssid/network was changed, and so the IP address does not change when changing networks/ssids.
You can also define priorities in the wpa_supplicant.conf
on the ssid to use as in:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="FrstHotspot"
psk="some password"
priority = 10
network=
ssid="SecondHotspot"
psk="some password"
priority = 20
The higher the priority, that will be the ssid
that will be tried first.
Some content of https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md states:
If you have two networks in range, you can add the priority option to
choose between them. The network in range, with the highest priority,
will be the one that is connected.
Thank you for you answer. I have already set a higher priority for one hotspot ("FrstHotspot"). The fact is when my device is connected to "FrstHotspot" and then this hotspot shutdown, it will reassociate to "SecondHotspot" but keep the same IP. For now, I have to manually dodhclient wlan0
( for example to access the device by ssh). I am searching a solution to automatically do adhclient
when the device reassociate to another hotspot
â Floufen
Jul 19 at 13:17
I edit the answer with corrections to your interfaces file, which I had forgot.
â Rui F Ribeiro
Jul 19 at 13:18
Adding driver information doesn't change the behavior. But removingallow-hotplug wlan0
will keep the interface down at startup. Perhaps I am not explaining well what I want. The question in this thread is exactly what I am experiencing.
â Floufen
Jul 19 at 13:32
In the interfaces file, it has to be manual. The DHCP must be handled by wpa_config
â Rui F Ribeiro
Jul 19 at 13:50
If I set it to manual I got :wlan0: association with <mac_address> timed out
â Floufen
Jul 19 at 14:34
 |Â
show 2 more comments
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Partial answer: wpa_supplicant
by itself only manages authentication on WLAN interfaces. dhclient
is run by another layer, either the traditional ifup
/ifdown
or others like network manager. wpa_supplicant
can send a signal to the other layer, but the other layer must be configured for that.
So the first step is to find out what kind of network management you have installed (Debian supports several). Then you need to configure it.
The wpa_supplicant
documentation also to have a document on roaming access, this may also contain hints how to correctly setup ifup/ifdown for automatic reconnect. Look in /usr/share/doc/
.
Thank you for your answer @dirkt. How to figure out wich network manager I am using? At first, my debian comes with connman but I disable it to setup the wpa_supplicant only.
â Floufen
Jul 19 at 12:44
add a comment |Â
up vote
0
down vote
Partial answer: wpa_supplicant
by itself only manages authentication on WLAN interfaces. dhclient
is run by another layer, either the traditional ifup
/ifdown
or others like network manager. wpa_supplicant
can send a signal to the other layer, but the other layer must be configured for that.
So the first step is to find out what kind of network management you have installed (Debian supports several). Then you need to configure it.
The wpa_supplicant
documentation also to have a document on roaming access, this may also contain hints how to correctly setup ifup/ifdown for automatic reconnect. Look in /usr/share/doc/
.
Thank you for your answer @dirkt. How to figure out wich network manager I am using? At first, my debian comes with connman but I disable it to setup the wpa_supplicant only.
â Floufen
Jul 19 at 12:44
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Partial answer: wpa_supplicant
by itself only manages authentication on WLAN interfaces. dhclient
is run by another layer, either the traditional ifup
/ifdown
or others like network manager. wpa_supplicant
can send a signal to the other layer, but the other layer must be configured for that.
So the first step is to find out what kind of network management you have installed (Debian supports several). Then you need to configure it.
The wpa_supplicant
documentation also to have a document on roaming access, this may also contain hints how to correctly setup ifup/ifdown for automatic reconnect. Look in /usr/share/doc/
.
Partial answer: wpa_supplicant
by itself only manages authentication on WLAN interfaces. dhclient
is run by another layer, either the traditional ifup
/ifdown
or others like network manager. wpa_supplicant
can send a signal to the other layer, but the other layer must be configured for that.
So the first step is to find out what kind of network management you have installed (Debian supports several). Then you need to configure it.
The wpa_supplicant
documentation also to have a document on roaming access, this may also contain hints how to correctly setup ifup/ifdown for automatic reconnect. Look in /usr/share/doc/
.
answered Jul 19 at 12:32
dirkt
13.8k2930
13.8k2930
Thank you for your answer @dirkt. How to figure out wich network manager I am using? At first, my debian comes with connman but I disable it to setup the wpa_supplicant only.
â Floufen
Jul 19 at 12:44
add a comment |Â
Thank you for your answer @dirkt. How to figure out wich network manager I am using? At first, my debian comes with connman but I disable it to setup the wpa_supplicant only.
â Floufen
Jul 19 at 12:44
Thank you for your answer @dirkt. How to figure out wich network manager I am using? At first, my debian comes with connman but I disable it to setup the wpa_supplicant only.
â Floufen
Jul 19 at 12:44
Thank you for your answer @dirkt. How to figure out wich network manager I am using? At first, my debian comes with connman but I disable it to setup the wpa_supplicant only.
â Floufen
Jul 19 at 12:44
add a comment |Â
up vote
0
down vote
As for your /etc/network/interfaces
, I think it has to be something similar to this to work with your current configuration:
allow-hotplug wlan0
iface wlan0 inet manual
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
You are defining the interface has dhcp, which then enters in conflict with the wpa_supplicant
that invokes DHCP. In that way, wpa_supplicant
loses the ability to signal when the ssid/network was changed, and so the IP address does not change when changing networks/ssids.
You can also define priorities in the wpa_supplicant.conf
on the ssid to use as in:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="FrstHotspot"
psk="some password"
priority = 10
network=
ssid="SecondHotspot"
psk="some password"
priority = 20
The higher the priority, that will be the ssid
that will be tried first.
Some content of https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md states:
If you have two networks in range, you can add the priority option to
choose between them. The network in range, with the highest priority,
will be the one that is connected.
Thank you for you answer. I have already set a higher priority for one hotspot ("FrstHotspot"). The fact is when my device is connected to "FrstHotspot" and then this hotspot shutdown, it will reassociate to "SecondHotspot" but keep the same IP. For now, I have to manually dodhclient wlan0
( for example to access the device by ssh). I am searching a solution to automatically do adhclient
when the device reassociate to another hotspot
â Floufen
Jul 19 at 13:17
I edit the answer with corrections to your interfaces file, which I had forgot.
â Rui F Ribeiro
Jul 19 at 13:18
Adding driver information doesn't change the behavior. But removingallow-hotplug wlan0
will keep the interface down at startup. Perhaps I am not explaining well what I want. The question in this thread is exactly what I am experiencing.
â Floufen
Jul 19 at 13:32
In the interfaces file, it has to be manual. The DHCP must be handled by wpa_config
â Rui F Ribeiro
Jul 19 at 13:50
If I set it to manual I got :wlan0: association with <mac_address> timed out
â Floufen
Jul 19 at 14:34
 |Â
show 2 more comments
up vote
0
down vote
As for your /etc/network/interfaces
, I think it has to be something similar to this to work with your current configuration:
allow-hotplug wlan0
iface wlan0 inet manual
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
You are defining the interface has dhcp, which then enters in conflict with the wpa_supplicant
that invokes DHCP. In that way, wpa_supplicant
loses the ability to signal when the ssid/network was changed, and so the IP address does not change when changing networks/ssids.
You can also define priorities in the wpa_supplicant.conf
on the ssid to use as in:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="FrstHotspot"
psk="some password"
priority = 10
network=
ssid="SecondHotspot"
psk="some password"
priority = 20
The higher the priority, that will be the ssid
that will be tried first.
Some content of https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md states:
If you have two networks in range, you can add the priority option to
choose between them. The network in range, with the highest priority,
will be the one that is connected.
Thank you for you answer. I have already set a higher priority for one hotspot ("FrstHotspot"). The fact is when my device is connected to "FrstHotspot" and then this hotspot shutdown, it will reassociate to "SecondHotspot" but keep the same IP. For now, I have to manually dodhclient wlan0
( for example to access the device by ssh). I am searching a solution to automatically do adhclient
when the device reassociate to another hotspot
â Floufen
Jul 19 at 13:17
I edit the answer with corrections to your interfaces file, which I had forgot.
â Rui F Ribeiro
Jul 19 at 13:18
Adding driver information doesn't change the behavior. But removingallow-hotplug wlan0
will keep the interface down at startup. Perhaps I am not explaining well what I want. The question in this thread is exactly what I am experiencing.
â Floufen
Jul 19 at 13:32
In the interfaces file, it has to be manual. The DHCP must be handled by wpa_config
â Rui F Ribeiro
Jul 19 at 13:50
If I set it to manual I got :wlan0: association with <mac_address> timed out
â Floufen
Jul 19 at 14:34
 |Â
show 2 more comments
up vote
0
down vote
up vote
0
down vote
As for your /etc/network/interfaces
, I think it has to be something similar to this to work with your current configuration:
allow-hotplug wlan0
iface wlan0 inet manual
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
You are defining the interface has dhcp, which then enters in conflict with the wpa_supplicant
that invokes DHCP. In that way, wpa_supplicant
loses the ability to signal when the ssid/network was changed, and so the IP address does not change when changing networks/ssids.
You can also define priorities in the wpa_supplicant.conf
on the ssid to use as in:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="FrstHotspot"
psk="some password"
priority = 10
network=
ssid="SecondHotspot"
psk="some password"
priority = 20
The higher the priority, that will be the ssid
that will be tried first.
Some content of https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md states:
If you have two networks in range, you can add the priority option to
choose between them. The network in range, with the highest priority,
will be the one that is connected.
As for your /etc/network/interfaces
, I think it has to be something similar to this to work with your current configuration:
allow-hotplug wlan0
iface wlan0 inet manual
wpa-driver wext
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
You are defining the interface has dhcp, which then enters in conflict with the wpa_supplicant
that invokes DHCP. In that way, wpa_supplicant
loses the ability to signal when the ssid/network was changed, and so the IP address does not change when changing networks/ssids.
You can also define priorities in the wpa_supplicant.conf
on the ssid to use as in:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network=
ssid="FrstHotspot"
psk="some password"
priority = 10
network=
ssid="SecondHotspot"
psk="some password"
priority = 20
The higher the priority, that will be the ssid
that will be tried first.
Some content of https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md states:
If you have two networks in range, you can add the priority option to
choose between them. The network in range, with the highest priority,
will be the one that is connected.
edited Jul 19 at 17:15
answered Jul 19 at 13:04
Rui F Ribeiro
33.7k1168113
33.7k1168113
Thank you for you answer. I have already set a higher priority for one hotspot ("FrstHotspot"). The fact is when my device is connected to "FrstHotspot" and then this hotspot shutdown, it will reassociate to "SecondHotspot" but keep the same IP. For now, I have to manually dodhclient wlan0
( for example to access the device by ssh). I am searching a solution to automatically do adhclient
when the device reassociate to another hotspot
â Floufen
Jul 19 at 13:17
I edit the answer with corrections to your interfaces file, which I had forgot.
â Rui F Ribeiro
Jul 19 at 13:18
Adding driver information doesn't change the behavior. But removingallow-hotplug wlan0
will keep the interface down at startup. Perhaps I am not explaining well what I want. The question in this thread is exactly what I am experiencing.
â Floufen
Jul 19 at 13:32
In the interfaces file, it has to be manual. The DHCP must be handled by wpa_config
â Rui F Ribeiro
Jul 19 at 13:50
If I set it to manual I got :wlan0: association with <mac_address> timed out
â Floufen
Jul 19 at 14:34
 |Â
show 2 more comments
Thank you for you answer. I have already set a higher priority for one hotspot ("FrstHotspot"). The fact is when my device is connected to "FrstHotspot" and then this hotspot shutdown, it will reassociate to "SecondHotspot" but keep the same IP. For now, I have to manually dodhclient wlan0
( for example to access the device by ssh). I am searching a solution to automatically do adhclient
when the device reassociate to another hotspot
â Floufen
Jul 19 at 13:17
I edit the answer with corrections to your interfaces file, which I had forgot.
â Rui F Ribeiro
Jul 19 at 13:18
Adding driver information doesn't change the behavior. But removingallow-hotplug wlan0
will keep the interface down at startup. Perhaps I am not explaining well what I want. The question in this thread is exactly what I am experiencing.
â Floufen
Jul 19 at 13:32
In the interfaces file, it has to be manual. The DHCP must be handled by wpa_config
â Rui F Ribeiro
Jul 19 at 13:50
If I set it to manual I got :wlan0: association with <mac_address> timed out
â Floufen
Jul 19 at 14:34
Thank you for you answer. I have already set a higher priority for one hotspot ("FrstHotspot"). The fact is when my device is connected to "FrstHotspot" and then this hotspot shutdown, it will reassociate to "SecondHotspot" but keep the same IP. For now, I have to manually do
dhclient wlan0
( for example to access the device by ssh). I am searching a solution to automatically do a dhclient
when the device reassociate to another hotspotâ Floufen
Jul 19 at 13:17
Thank you for you answer. I have already set a higher priority for one hotspot ("FrstHotspot"). The fact is when my device is connected to "FrstHotspot" and then this hotspot shutdown, it will reassociate to "SecondHotspot" but keep the same IP. For now, I have to manually do
dhclient wlan0
( for example to access the device by ssh). I am searching a solution to automatically do a dhclient
when the device reassociate to another hotspotâ Floufen
Jul 19 at 13:17
I edit the answer with corrections to your interfaces file, which I had forgot.
â Rui F Ribeiro
Jul 19 at 13:18
I edit the answer with corrections to your interfaces file, which I had forgot.
â Rui F Ribeiro
Jul 19 at 13:18
Adding driver information doesn't change the behavior. But removing
allow-hotplug wlan0
will keep the interface down at startup. Perhaps I am not explaining well what I want. The question in this thread is exactly what I am experiencing.â Floufen
Jul 19 at 13:32
Adding driver information doesn't change the behavior. But removing
allow-hotplug wlan0
will keep the interface down at startup. Perhaps I am not explaining well what I want. The question in this thread is exactly what I am experiencing.â Floufen
Jul 19 at 13:32
In the interfaces file, it has to be manual. The DHCP must be handled by wpa_config
â Rui F Ribeiro
Jul 19 at 13:50
In the interfaces file, it has to be manual. The DHCP must be handled by wpa_config
â Rui F Ribeiro
Jul 19 at 13:50
If I set it to manual I got :
wlan0: association with <mac_address> timed out
â Floufen
Jul 19 at 14:34
If I set it to manual I got :
wlan0: association with <mac_address> timed out
â Floufen
Jul 19 at 14:34
 |Â
show 2 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f457159%2fwpa-supplicant-doesnt-get-new-ip-when-re-associate%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password