jimmmy
Posts: 3
Joined: Thu Jan 21, 2016 1:22 pm

2 IPs on WLAN0 interface

Thu Jan 21, 2016 2:05 pm

Hi,

Could anyone please have a look why I am receiving two IPs on WLAN0 interface? I have assigned only static IP and somehow device is getting second one from DHCP.

/etc/network/interfaces:

Code: Select all

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.42.48
netmask 255.255.254.0
gateway 192.168.42.5
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp

ip addr show wlan0:

Code: Select all

 link/ether 04:8d:38:50:57:a7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.42.48/23 brd 192.168.43.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet 192.168.42.54/23 brd 192.168.43.255 scope global secondary wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::7776:2eba:f7c8:b770/64 scope link
       valid_lft forever preferred_lft forever

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

Re: 2 IPs on WLAN0 interface

Thu Jan 21, 2016 8:04 pm

Rip all of that stuff you added to your interfaces file out put it back to the default version. You now set static addresses in /etc/dhcpcd.conf not in /etc/network/interfaces.
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.

jimmmy
Posts: 3
Joined: Thu Jan 21, 2016 1:22 pm

Re: 2 IPs on WLAN0 interface

Fri Jan 22, 2016 8:36 am

Thanks for your reply.
But before I assigned static IP address to wlan0 it was getting IP address from DHCP and somehow it was also receiving 2 IPs.

Code: Select all

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp

SonOfAMotherlessGoat
Posts: 690
Joined: Tue Jun 16, 2015 6:01 am

Re: 2 IPs on WLAN0 interface

Fri Jan 22, 2016 8:38 am

If you're running Jessie you need to do as Dougie said. Search the forums for 'two IP addresses'. There has been a lot of discussion over this and Dougie is giving you the solution.
Account Inactive

Return to “Troubleshooting”