Page 1 of 1

Mac: Direct Network Connection, IP of RPi, Internet connecti

Posted: Sat Jul 19, 2014 2:32 pm
by Triple777x
Hi!
I'm new to this forum and I'm also new to the Raspberry Pi.
I was able to setup a direct network connection to my MacBook and accessing the RPi via ssh when I beforehand configured a static IP address on the RPi (with a display and keyboard attached to the RPi).
What I need is the following:
I want to access the RPi from my Mac using only a network cable without any presets. So what I need is:
- find the IP of the RPi without any preconfiguration (I don't now how to do this - no tutorial/forum helped me so far:( )
- accessing the Pi via ssh (no problem so far if I know the IP)
- VNC with tightvncserver (already installed) - I simply use then in the Finder->Go->Connect to Server (How do I know which port I should use? mostly I start over ssh and then start the vnc server: "vncserver :1" - why do I need then port 5901?? Can someone explain me how this works?)
- sharing the WLAN connection of my Mac to the Pi or configuring a WLAN stick on the Pi when I'm accessing the RPi via ssh on a static IP
Is there a conflict when I configure a static IP on the Pi to access it via my MacBook and at the same time using an WLAN stick to get an internet connection?

I'd be very happy if anyone could share his experience on these topics with me:)
Thanks a lot in advance!

Re: Mac: Direct Network Connection, IP of RPi, Internet conn

Posted: Sat Jul 19, 2014 8:16 pm
by drgeoff
A look at http://www.raspberrypi.org/forums/viewt ... 91&t=81977 and links within might be helpful.

Re: Mac: Direct Network Connection, IP of RPi, Internet conn

Posted: Sat Jul 19, 2014 8:50 pm
by Triple777x
That didn't help me much - the first thing I'd like to set up is a SSH connection to the RPi which is connected with an ethernet cable directly to my MacBook. If I won't share any internet connection or anything - how can I find out which IP the RPi has?

Is it possible to set a static IP for SSH and also DHCP for a WLAN internet connection?

Re: Mac: Direct Network Connection, IP of RPi, Internet conn

Posted: Sat Jul 19, 2014 9:28 pm
by drgeoff
Triple777x wrote:That didn't help me much - the first thing I'd like to set up is a SSH connection to the RPi which is connected with an ethernet cable directly to my MacBook. If I won't share any internet connection or anything - how can I find out which IP the RPi has?
I know b/a about Macs but if you want the RPi to get an address without presetting you must use DHCP. The DHCP server on the Mac should have some way of showing you what clients it has handed addresses out to and what addresses those are. Try sinnfrei's method in the last post at http://hintsforums.macworld.com/showthread.php?t=106360.

Re: Mac: Direct Network Connection, IP of RPi, Internet conn

Posted: Sun Jul 20, 2014 4:31 pm
by kusti8
You could try using a console cable, which doesn't need a network or anything. Check out this guide:
https://learn.adafruit.com/adafruits-ra ... sole-cable

Re: Mac: Direct Network Connection, IP of RPi, Internet conn

Posted: Sun Jul 20, 2014 9:33 pm
by TrevorAppleton
I am not sure if this helps you or not, but here is the method I use to find the IP address of my Raspberry Pi remotely.

http://trevorappleton.blogspot.co.uk/20 ... dress.html

I also have a blog post which explains about connecting to your Raspberry Pi via VNC, including using a mac, and why you need to type 5901.

http://trevorappleton.blogspot.co.uk/20 ... sktop.html

Let me know if this helps or if you have any further questions.

Re: Mac: Direct Network Connection, IP of RPi, Internet conn

Posted: Mon Jul 21, 2014 9:04 pm
by cyrano
Why a static ip?

My simple works-every-time Mac setup:

- Enable Internet sharing in system prefs
- Share wifi to ethernet (supposing your Mac connects to the internet over wifi)
- connect RPI (with DHCP client enabled) to ethernet port
- find ip with broadcast ping or fling (it's always the same, except if you have several devices connected to the ethernet via switch)
- type ssh x.x.x.x in Terminal

The range used for sharing is 192.168.2.x. Unless this is the same range as given out by your wifi router, there are no problems. Usually, the Pi is on 192.168.2.2.

Re: Mac: Direct Network Connection, IP of RPi, Internet conn

Posted: Wed Feb 25, 2015 2:32 pm
by seyoung
@cyrano: I don't know how you can broadcast ping or fling your pi which is attached to your laptop through the ethernet.

However, you can still find the ip address of pi by following command:

Code: Select all

netstat -rn -finet
This shows your network status.
Screen Shot 2015-02-25 at 4.29.27 PM.png
The ip address of your Pi will be something like 192.168.2.x
Screen Shot 2015-02-25 at 4.29.27 PM.png (20.38 KiB) Viewed 8364 times
You can configure your pi by its MAC address.

Once you've figured out the ip address, For more info, check:https://www.youtube.com/watch?v=MXi-Tk1Wbpc

Re: Mac: Direct Network Connection, IP of RPi, Internet conn

Posted: Wed Feb 25, 2015 2:38 pm
by fruitoftheloom
seyoung wrote:@cyrano: I don't know how you can broadcast ping or fling your pi which is attached to your laptop through the ethernet.

However, you can still find the ip address of pi by following command:

Code: Select all

netstat -rn -finet
This shows your network status.
Screen Shot 2015-02-25 at 4.29.27 PM.png
You can configure your pi by its MAC address.

Once you've figured out the ip address, For more info, check:https://www.youtube.com/watch?v=MXi-Tk1Wbpc
You do realise the post you are replying to is 8 months old ;)

Re: Mac: Direct Network Connection, IP of RPi, Internet conn

Posted: Thu Feb 26, 2015 6:56 am
by seyoung
fruitoftheloom wrote: You do realise the post you are replying to is 8 months old ;)
Oh am I not supposed to answer a question that is older than certain amount of time?
I answered because I had the same issue and it took me 6 hours to solve it.
So I just wanted to help others with the same issue :)

Re: Mac: Direct Network Connection, IP of RPi, Internet conn

Posted: Wed Oct 28, 2015 11:38 pm
by tonysnail
and had he not replied, I'd still be strugging trying to find my headless Pi's IP address..

I for one am greatful.