Page 1 of 1

IPs swapped between wlan0 and wlan1

Posted: Thu Jan 05, 2017 9:59 pm
by VascoFerraz
Hi,

I am being haunted by some strange issue which changes the IPs between wlan0 and wlan1.

In my router I associated wlan0 MAC address to 192.168.10.5 and wlan1 to 192.168.10.6.
Image

Also, I defined wlan0 as static (192.168.10.5) and wlan1 also as static (192.168.10.6).
Image

And now this is the result after calling ifconfig (ips are swapped).
Image

Image

Re: IPs swapped between wlan0 and wlan1

Posted: Fri Jan 06, 2017 11:15 am
by epoch1970
Everything is working normally as far as I see.
If you intended to use a static IP configuration instead of MAC based fixed IP DHCP leases (why, oh why?) you obviously missed reading the first lines of the interfaces file: "For static IP, consult..."

Re: IPs swapped between wlan0 and wlan1

Posted: Fri Jan 06, 2017 8:44 pm
by DougieLawson

Re: IPs swapped between wlan0 and wlan1

Posted: Fri Jan 06, 2017 10:23 pm
by VascoFerraz
Now I understand that I did not have a problem, however I can know assigned wlan0/1 to the IPs I want.

Thank you so much.

Re: IPs swapped between wlan0 and wlan1

Posted: Fri Jan 06, 2017 10:38 pm
by MrEngman
VascoFerraz wrote:
Now I understand that I did not have a problem, however I can know assigned wlan0/1 to the IPs I want.

Thank you so much.
Read line 3 of file /etc/network/interfaces. You really shouldn't edit that file for your static IP's but set up the static IP's in file /etc/dhcpcd.conf.


MrEngman

Re: IPs swapped between wlan0 and wlan1

Posted: Sat Jan 07, 2017 11:08 am
by VascoFerraz
MrEngman wrote: Read line 3 of file /etc/network/interfaces. You really shouldn't edit that file for your static IP's but set up the static IP's in file /etc/dhcpcd.conf.
In fact I did not read that note about static IPs. :oops:

However, as I was experiencing that "strange issue" regarding IPs I decided to change from DHCP to fixed IPs in the Rpi (but as I said, I didn't read that note).

As this "strange issue" was not a bug, I was not able to get the expected result with DHCP neither with fixed IPs.

Now I am using again DHCP into the Rpi and IPs assignment are working as expected :)

Thank you so much your your guidance.