0

I have two RPis that I'd eventually like to use for different things. I want to be able to use them both headlessly but I don't ever plan on having them plugged into my laptop at the same time when I do this.

I've only ever worked with them headlessly so far and they're connected to my laptop running OS X via an Ethernet cord. When setting up my RPis initially I messed up with the the static IP setting for the Ethernet and could not figure out the IP address of the RPi to login. I ended up editing the cmdline.txt file to include ip=x.x.x.x which finally allowed me to login to my first RPi.

My question: Could I do the same thing with the second Pi - assign it the exact same IP - so I don't have to keep changing the IP address for that connection on my Mac since I'm configuring my DHCP with a manual address?

Again, I'm not planning having them plugged into the laptop at the same time (cannot even if I wanted because of only one Ethernet slot) which I thought might make it okay. But if there are hidden problems I - as a total amateur here - am missing I'd appreciate being told so I don't mess up anything else.

techraf
  • 4,353
  • 10
  • 32
  • 43
chainhomelow
  • 111
  • 2

2 Answers2

0

If you are setting IP address that way you are making things hard for yourself, but YES you could do it.

IP addresses are NOT expensive, see how to set it up properly in:- How do I set up networking/WiFi/Static IP

Why do you have to change anything on the Mac? If setup properly you can plug in any IP address in the range. The link above suggests better ways of connecting.

PS I still don't understand WHY people want to assign static addresses - it seems to be some kind of Pi disease.

Milliways
  • 62,573
  • 32
  • 113
  • 225
0

If you are using SSH to access these Raspberry Pi's, and both Raspberry Pi's are using different installs of Raspbian, then you will see something like this (this is the output on Mac, unsure about other systems):

ssh pi@169.254.67.153
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:RANDOMKEY.
Please contact your system administrator.
Add correct host key in /Users/michaelbuerger/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/michaelbuerger/.ssh/known_hosts:1
ECDSA host key for 169.254.67.153 has changed and you have requested strict checking.
Host key verification failed.
make: *** [ssh] Error 255

This means every time you would like to SSH to the Pi, you would need to regenerate the key.

--Edit--

I have just learned that you are using OSX so here is some extra information:

To regenerate this key use ssh-keygen -R 169.254.67.153 (change IP, this works in my case)

Now, if you want to avoid regenerating this key, you can just copy the install of Raspbian over to the other Pi's SD card and you will be all set. This is the easy solution in my opinion.
If you want to change it on the current install. Check this out: Changing SSH host keys on Raspbian

techraf
  • 4,353
  • 10
  • 32
  • 43