Triple777x
Posts: 2
Joined: Sat Jul 19, 2014 2:12 pm

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

Sat Jul 19, 2014 2:32 pm

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!


Triple777x
Posts: 2
Joined: Sat Jul 19, 2014 2:12 pm

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

Sat Jul 19, 2014 8:50 pm

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?

drgeoff
Posts: 10321
Joined: Wed Jan 25, 2012 6:39 pm

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

Sat Jul 19, 2014 9:28 pm

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.

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

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

Sun Jul 20, 2014 4:31 pm

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
There are 10 types of people: those who understand binary and those who don't.

TrevorAppleton
Posts: 74
Joined: Wed May 30, 2012 7:26 pm
Contact: Website

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

Sun Jul 20, 2014 9:33 pm

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.
Check out my blog post for Raspberry Pi and Python tutorials.

http://trevorappleton.blogspot.co.uk/

User avatar
cyrano
Posts: 714
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

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

Mon Jul 21, 2014 9:04 pm

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.

seyoung
Posts: 5
Joined: Wed Feb 18, 2015 11:22 am

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

Wed Feb 25, 2015 2:32 pm

@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 8289 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

fruitoftheloom
Posts: 21998
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

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

Wed Feb 25, 2015 2:38 pm

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 ;)
Retired disgracefully.....
......to an uncomplicated life !

Rather than negativity think outside the box !

seyoung
Posts: 5
Joined: Wed Feb 18, 2015 11:22 am

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

Thu Feb 26, 2015 6:56 am

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 :)

tonysnail
Posts: 2
Joined: Wed Jan 30, 2013 12:12 am

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

Wed Oct 28, 2015 11:38 pm

and had he not replied, I'd still be strugging trying to find my headless Pi's IP address..

I for one am greatful.

Return to “Beginners”