Page 1 of 1

2 IPs on WLAN0 interface

Posted: Thu Jan 21, 2016 2:05 pm
by jimmmy
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

Re: 2 IPs on WLAN0 interface

Posted: Thu Jan 21, 2016 8:04 pm
by DougieLawson
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.

Re: 2 IPs on WLAN0 interface

Posted: Fri Jan 22, 2016 8:36 am
by jimmmy
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

Re: 2 IPs on WLAN0 interface

Posted: Fri Jan 22, 2016 8:38 am
by SonOfAMotherlessGoat
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.