awachens
Posts: 34
Joined: Sat Jun 10, 2017 6:56 am

[SOLVED] Why raspberry have 2 ip ?

Sun Jan 21, 2018 7:54 am

I have 2 raspberry connected to my router and responding .,..

Look:

Code: Select all

C:\Users\Disidents>ping -a 192.168.1.130

Haciendo ping a RASPBERRYPI [192.168.1.130] con 32 bytes de datos:

Code: Select all

C:\Users\Disidents>ping -a 192.168.1.111

Haciendo ping a raspberrypi.home [192.168.1.111] con 32 bytes de datos:
Last edited by awachens on Sat Feb 03, 2018 6:50 am, edited 1 time in total.

User avatar
DougieLawson
Posts: 32374
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Why raspberry have 2 ip ?

Sun Jan 21, 2018 7:58 am

Take your changes out of /etc/network/interfaces make changes in /etc/dhcpcd.conf to set a fixed IP.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

awachens
Posts: 34
Joined: Sat Jun 10, 2017 6:56 am

Re: Why raspberry have 2 ip ?

Sun Jan 21, 2018 8:59 am

Hello, i only have this:

Code: Select all

pi@raspberrypi:~ $ ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:720 (720.0 B)  TX bytes:720 (720.0 B)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:f6:6b:75
          inet addr:192.168.1.130  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: 2a01:c50e:3546:8800:e92d:a82d:a23a:7536/64 Scope:Global
          inet6 addr: fe80::ba27:ebff:fef6:6b75/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:786 errors:0 dropped:0 overruns:0 frame:0
          TX packets:575 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:83071 (81.1 KiB)  TX bytes:70625 (68.9 KiB)
I should delete my /etc/network/interfaces ???

This is my interfaces:

Code: Select all

auto lo
iface lo inet loopback

iface eth0 inet manual

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.130
netmask 255.255.255.0
gateway 192.168.1.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
My raspberry is responding to 2 differents ip at same time... Why ?

User avatar
rpdom
Posts: 12412
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Why raspberry have 2 ip ?

Sun Jan 21, 2018 9:07 am

This is the bit that is causing your problem

Code: Select all

iface wlan0 inet static
address 192.168.1.130
netmask 255.255.255.0
gateway 192.168.1.1
You seem to have deleted the lines that say

Code: Select all

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
Static IP addresses for the Pi have been defined in /etc/dhcpcd.conf for a long time now. Any instructions that say otherwise are very out of date.

pcmanbob
Posts: 3697
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Why raspberry have 2 ip ?

Sun Jan 21, 2018 3:59 pm

if you are using the latest version of raspbian then,

etc/network/interfaces should only contain.

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

then follow these instructions to set up a static IP

https://www.raspberrypi.org/learning/ne ... p-address/
Please only ask questions in the forum I will not answer questions sent to me directly via PM
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

awachens
Posts: 34
Joined: Sat Jun 10, 2017 6:56 am

Re: Why raspberry have 2 ip ?

Thu Jan 25, 2018 6:28 am

Hi good morning, i follow the steps. But i have a question... Now how should use wpa_supplicant ?
At network/interfaces ? Where i define the network SSID ?

Regards !

EDIT: Oh! I should configure network/interfaces too !!! no ?

mfa298
Posts: 1128
Joined: Tue Apr 22, 2014 11:18 am

Re: Why raspberry have 2 ip ?

Thu Jan 25, 2018 10:41 am

awachens wrote:
Thu Jan 25, 2018 6:28 am
Hi good morning, i follow the steps. But i have a question... Now how should use wpa_supplicant ?
At network/interfaces ? Where i define the network SSID ?

Regards !

EDIT: Oh! I should configure network/interfaces too !!! no ?
For a wireless connection you put the relevant SSID/Password details into wpa_supplicant, you shouldn't need anything in /e/n/interfaces (at least that was the case for Jessie and I don't think that's changed in Stetch)

Going back to an earlier comment - Don't use ifconfig to look up the addresses on an interface, it won't always show them all you should use ip addr (which can be shortened to "ip a")

You can also list a specific interface like so

Code: Select all

pi@raspberry:~ $ ip addr show dev wlan0
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:b5:67:34 brd ff:ff:ff:ff:ff:ff
    inet 10.12.1.22/24 brd 192.168.33.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 2001:db8:303:12:b519:ee7:e2b7:8591/64 scope global noprefixroute dynamic
       valid_lft 2591841sec preferred_lft 604641sec
    inet6 fe80::40df:49ca:a021:737/64 scope link
       valid_lft forever preferred_lft forever

awachens
Posts: 34
Joined: Sat Jun 10, 2017 6:56 am

Re: Why raspberry have 2 ip ?

Thu Jan 25, 2018 7:51 pm

Hi good night, i have this configuration and i didn't see my raspberry... Why ?

Image

Image

Image

EDIT: I deleted my PSK but just for the picture...

pcmanbob
Posts: 3697
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Why raspberry have 2 ip ?

Fri Jan 26, 2018 12:22 pm

Your wpa_supplicant.conf should look like this.

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
	ssid="ssid goes here"
	psk="gpassword goes here"
	key_mgmt=WPA-PSK
}
scan_ssid=1 is only required for hidden ssid's
Please only ask questions in the forum I will not answer questions sent to me directly via PM
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

awachens
Posts: 34
Joined: Sat Jun 10, 2017 6:56 am

Re: Why raspberry have 2 ip ?

Sat Jan 27, 2018 6:19 am

Ok... I can change this, but it work's fine with /e/n/interfaces configure ... I change now and try... If this is not the fail... What can i look after ?

Regards !
EDIT: Doesn't work... What's wrong ?
I connect to TV (haven't mouse and keyboard, just for check if raspberry load)

Image

pcmanbob
Posts: 3697
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Why raspberry have 2 ip ?

Sat Jan 27, 2018 10:52 am

If you have a screen connected then why not just remove the login details form wpa_supplicant.conf and just connect using the networking icon then you will be able to see what is required in wpa_supplicant.conf if you look at it after connecting.
Please only ask questions in the forum I will not answer questions sent to me directly via PM
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

awachens
Posts: 34
Joined: Sat Jun 10, 2017 6:56 am

Re: Why raspberry have 2 ip ?

Sat Jan 27, 2018 10:57 am

(haven't mouse and keyboard, just for check if raspberry load[\quote]

pcmanbob
Posts: 3697
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Why raspberry have 2 ip ?

Sat Jan 27, 2018 11:02 am

Have you restored etc/network/interfaces to its default contents ?

I posted a copy earlier in this thread.
Please only ask questions in the forum I will not answer questions sent to me directly via PM
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

awachens
Posts: 34
Joined: Sat Jun 10, 2017 6:56 am

Re: Why raspberry have 2 ip ?

Sun Jan 28, 2018 4:48 pm

Hello, I left the interfaces file by default like you post before. And wpa_supplicant too.
Now i go to try it.

Thx a lot !

Edit: doesn’t work ... and have same configuration .... what can I do now ?

pcmanbob
Posts: 3697
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Why raspberry have 2 ip ?

Mon Jan 29, 2018 11:07 am

Are you sure you have the correct information in wpa_supplicant ?

if your router is set not to broadcast your ssid then I suggest you change it so that it does broadcast your ssid.


If after checking all the above you still cant connect and this is a fresh install then I suggest you start again and reflash your SD card this time only make changes to dhcpcd.conf.
Please only ask questions in the forum I will not answer questions sent to me directly via PM
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

awachens
Posts: 34
Joined: Sat Jun 10, 2017 6:56 am

Re: Why raspberry have 2 ip ?

Mon Jan 29, 2018 7:36 pm

Hi ! Yes, my router broadcast the SSID..

awachens
Posts: 34
Joined: Sat Jun 10, 2017 6:56 am

Re: Why raspberry have 2 ip ?

Sat Feb 03, 2018 6:50 am

Reinstall, debian stretch working now and correct ip


pi@raspberrypi:~ $ ip addr show dev wlan0
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:f6:6b:75 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.111/24 brd 192.168.1.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 2a01:c50e:3546:8800:9ee1:5015:1328:bfe6/64 scope global mngtmpaddr noprefixroute dynamic
valid_lft 899sec preferred_lft 299sec
inet6 fe80::926:e67d:942b:aff0/64 scope link
valid_lft forever preferred_lft forever

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 5 guests