LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-13-2015, 04:43 AM   #1
mantamar
LQ Newbie
 
Registered: Jan 2015
Posts: 2

Rep: Reputation: Disabled
Direct connection via ethernet


Hi I am not a complete Linux newbie, but I have a challenge that is new to me.

I am wanting to be able to connect to a linux box (Raspberry Pi running Debian) via ssh directly from a single computer. I want to be able to plug in a ethernet cable from a laptop to the Raspberry Pi so that I can configure it via ssh or a webpage.

I have had a few pieces of hardware, routers, printers etc that allow this sort of connection for configuration, I just would like to know how it is done.

My question is how do I set up the /etc/interfaces file to allow the Raspberry Pi to be found by the laptop.

Once configured I would want the Raspberry Pi to obtain its IP address via DHCP when connected to a network.

Any suggestions, ideas would be appreciated.
 
Old 01-13-2015, 04:49 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
I would suggest you to plug both your laptop and pi into the router, switch on DHCP and DNS on the router. Probably you need to modify /etc/interfaces to use dhcp.
 
Old 01-13-2015, 06:13 AM   #3
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 189

Rep: Reputation: 62
To connect your laptop to RP directly using an Ethernet cable do this:

On your laptop:

Code:
sudo ip ad add 10.0.0.10/24 dev eth0
On your RP:

Code:
sudo ip ad add 10.0.0.20/24 dev eth0
Test connection to RP from your laptop:

Code:
ping 10.0.0.20
These instructions are from here.

If you want your RP to receive IP address automatically you have to connect it a device that has a DHCP server running.
 
Old 01-13-2015, 08:10 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,087
Blog Entries: 10

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
The Pi should come up in Debian and DHCP for an address unless you've modified the network settings from their defaults. However you'll need to add a keyboard and monitor so that you can determine what the IP address is so you can ssh to it from another system.
 
Old 01-14-2015, 12:00 PM   #5
mantamar
LQ Newbie
 
Registered: Jan 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
What I am actually trying to do is build a headless box based on a raspberry pi.

To allow the user to make configuration changes they will access a HTML GUI that is accessed from a web browser on another computer.

I have partially solved the problem by using mDNS / avahi . This allows the user to access the box using a local URL e.g. raspberrypi.local . However this is still reliant on the box being plugged into a network with a DHCP server running.

What I am wanting to do is allow the user to just plug in an ethernet cable between the box and their laptop to access the GUI configuration page.
 
Old 01-14-2015, 08:26 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
If you don't want to set static IP and can't easily use dhcp then you can just tell your local computer to add in static arp. Use mac address of the pi to a current unused subnet ip. Then you access the pi from that ip. Be sure they know how to delete the static arp entry.

Could go more wild and fool with naming.

It is easy enough to make a batch or script that will add and subtract arp entry.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make a direct connection between two computers via ethernet? trist007 Linux - Newbie 7 09-02-2008 04:48 PM
Direct Ethernet Connection, Is It Possible? Newbie Needs Help! Antonio44 Linux - Networking 5 06-18-2007 12:08 PM
Direct Ethernet Connection spelltoronto Linux - Newbie 5 03-23-2006 08:36 PM
Do ethernet cards protect against direct current? bobwall Linux - Networking 1 01-16-2005 11:31 AM
Direct connect Linux to Win via ethernet Jmeindl Linux - Networking 6 01-23-2004 10:13 AM


All times are GMT -5. The time now is 10:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration