User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

IPs swapped between wlan0 and wlan1

Thu Jan 05, 2017 9:59 pm

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
Vasco Ferraz

epoch1970
Posts: 5131
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: IPs swapped between wlan0 and wlan1

Fri Jan 06, 2017 11:15 am

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..."
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: IPs swapped between wlan0 and wlan1

Fri Jan 06, 2017 8:44 pm

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

Re: IPs swapped between wlan0 and wlan1

Fri Jan 06, 2017 10:23 pm

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.
Vasco Ferraz

MrEngman
Posts: 4032
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: IPs swapped between wlan0 and wlan1

Fri Jan 06, 2017 10:38 pm

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
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

User avatar
VascoFerraz
Posts: 83
Joined: Thu Aug 30, 2012 11:54 am

Re: IPs swapped between wlan0 and wlan1

Sat Jan 07, 2017 11:08 am

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.
Vasco Ferraz

Return to “Troubleshooting”