saleiti
Posts: 8
Joined: Fri Jul 13, 2018 8:23 am

Problem with connecting raspberry to Linux

Fri Jul 13, 2018 8:31 am

Hello,

I need to connect Raspberry Pi 4 to Linux computer. I need a connection to a computer which has an internet connection, because here is no wifi.
It should be a ssh connection via ethernet cable.
I have tried everything,
Does anyone have any suggestions what to do?

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 8:57 am

saleiti wrote:
Fri Jul 13, 2018 8:31 am
I need to connect Raspberry Pi 4 to Linux computer. I need a connection to a computer which has an internet connection, because here is no wifi.
It should be a ssh connection via ethernet cable.
So you want to access the Internet from the RPi, and aim to use an existing computer with an Internet connection as a bridge?

If you have no Wi-Fi, I presume the existing computer has an Ethernet connection to the broadband router? In which case the computer's Ethernet port is already used.

I don't understand why you don't simply connect the RPi directly to the router (by Ethernet). Job done, no need for another computer in the link.
saleiti wrote:
Fri Jul 13, 2018 8:31 am
I have tried everything,
Does anyone have any suggestions what to do?
Nobody will be very happy to make suggestions you have already tried, if you have indeed tried everything. Best you describe what you have already tried (which won't be "everything"), and then we'll tell you what else you can try.
Last edited by Z80 Refugee on Fri Jul 13, 2018 9:00 am, edited 1 time in total.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

saleiti
Posts: 8
Joined: Fri Jul 13, 2018 8:23 am

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 8:59 am

Because this is a university computer and I don't have a router in this room.

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:04 am

saleiti wrote:
Fri Jul 13, 2018 8:59 am
Because this is a university computer and I don't have a router in this room.
Okay, so where do you propose to get a second Ethernet port from? If you had a second Ethernet port, you would need to configure the computer to bridge the network on Port 1 to be available on Port 2.

Without a second port, all I can think of is that you unplug the Ethernet from the computer and plug it into the RPi.

If you are being asked to do this, either your educators already have a plan so tell them you need a connection, or it is their intention that you work it out for yourself. If you are not being asked to do this and are working on your own project, check you have authorisation to access the university network in this way (it might be locked down and pointless you trying to access it) and if so ask for help from the IT support people.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

saleiti
Posts: 8
Joined: Fri Jul 13, 2018 8:23 am

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:09 am

Why do I need a second ethernet cable? And where do I connect it?

User avatar
Z80 Refugee
Posts: 358
Joined: Sun Feb 09, 2014 1:53 pm

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:17 am

Clearly I don't understand your description of what you are trying to do. I'm working in the dark, because you haven't told me in what way what I wrote in post 2 is wrong.
Military and Automotive Electronics Design Engineer (retired)

For the best service: make your thread title properly descriptive, and put all relevant details in the first post (including links - don't make us search)!

DirkS
Posts: 10010
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:22 am

saleiti wrote:
Fri Jul 13, 2018 8:31 am
I need to connect Raspberry Pi 4 ...
Did I miss something? :roll:

wildfire
Posts: 561
Joined: Sat Sep 03, 2016 10:39 am
Location: Dundee, Scotland

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:26 am

1) There is no such device as a Raspberry Pi 4.

2) How do you plan to access the internet without using a second network port on the Linux PC?

To be honest you are not explaining your problem well, provide a little more information.
E8 85 A2 64 C9 64 81 94 64 81 95 64 89 84 89 96 A3
Still NF Shirls

wildfire
Posts: 561
Joined: Sat Sep 03, 2016 10:39 am
Location: Dundee, Scotland

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:28 am

DirkS wrote:
Fri Jul 13, 2018 9:22 am
saleiti wrote:
Fri Jul 13, 2018 8:31 am
I need to connect Raspberry Pi 4 ...
Did I miss something? :roll:
Typing as you posted :D
E8 85 A2 64 C9 64 81 94 64 81 95 64 89 84 89 96 A3
Still NF Shirls

saleiti
Posts: 8
Joined: Fri Jul 13, 2018 8:23 am

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:28 am

I tried to connect it by writing to terminal: ssh [email protected]
And I have checked if the SSH is enabled on the raspberry.

Heater
Posts: 13868
Joined: Tue Jul 17, 2012 3:02 pm

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:31 am

1) Buy yourself an ethernet card for your PC, or a USB ethernet adapter. Configure your Linux PC as router. Explaining that is a bit much for a forum post so google for "configure linux as a router" and read something like this: http://blog.noviantech.com/2010/12/22/d ... 5-minutes/

2) Buy yourself a network switch or even router. Connect that to you university network and connect you PC and Pi to it. Just like one might do at home with a router and an ISP connection.

Of course if your PC is connected to the university network over WiFi and it has a free ethernet port then you won't need to by an ethernet adapter for 1) above.
Memory in C++ is a leaky abstraction .

saleiti
Posts: 8
Joined: Fri Jul 13, 2018 8:23 am

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:53 am

I mean if I have connected raspberry to the computer via ethernet cable and then I'm writing to Linux terminal: ssh [email protected](IP of the rasp), then I should be able to access my raspberry through my computer, no?

But If I write this to terminal it gives me: port 22: no route to host.

tpyo kingg
Posts: 637
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 10:06 am

saleiti wrote:
Fri Jul 13, 2018 9:53 am
I mean if I have connected raspberry to the computer via ethernet cable and then I'm writing to Linux terminal: ssh [email protected](IP of the rasp), then I should be able to access my raspberry through my computer, no?

But If I write this to terminal it gives me: port 22: no route to host.
It depends on how you are doing the networking. If you have a router and both machines are connecting through it, then you should just be able to SSH to the IP address of the RPi. If you are plugging the Ethernet ports directly together, then you'll need to have an interface configured for a static IP address with DHCP running and configured to dole out addresses on that interface. Which do you have, a direct cable with nothing between the machine or both plugged into a shared router?

saleiti
Posts: 8
Joined: Fri Jul 13, 2018 8:23 am

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 10:24 am

No only the computer is plugged into the router.

(you'll need to have an interface configured for a static IP address with DHCP running and configured to dole out addresses on that interface) How do I do that?

tpyo kingg
Posts: 637
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 11:02 am

saleiti wrote:
Fri Jul 13, 2018 10:24 am
No only the computer is plugged into the router.
So, just to be clear the topology looks like this?

Code: Select all

rpi ----- laptop ----- router ----- Internet
And the connection between the rpi and the laptop is Ethernet but the connection between the laptop and the router is wi-fi?

saleiti
Posts: 8
Joined: Fri Jul 13, 2018 8:23 am

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 11:04 am

This is correct, but the connection between the computer and router is also ethernet, here is no wifi.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5193
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 11:18 am

saleiti wrote:
Fri Jul 13, 2018 11:04 am
This is correct, but the connection between the computer and router is also ethernet, here is no wifi.
How many Ethernet ports are there on the laptop computer?
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, A+ and a B2) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

droleary
Posts: 174
Joined: Fri Feb 09, 2018 3:45 am
Location: Minneapolis, MN USA
Contact: Website Skype

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 1:37 pm

People need to stop feeding the trolls around here.

DirkS
Posts: 10010
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 2:18 pm

droleary wrote:
Fri Jul 13, 2018 1:37 pm
People need to stop feeding the trolls around here.
Who's the troll? OP?
Looks to me it's more of a language problem...

ejolson
Posts: 3800
Joined: Tue Mar 18, 2014 11:47 am

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 4:59 pm

saleiti wrote:
Fri Jul 13, 2018 11:04 am
This is correct, but the connection between the computer and router is also ethernet, here is no wifi.
The task of connecting a Pi directly to a PC using a single Ethernet cable was recently discussed in this thread

viewtopic.php?f=63&t=216517

Note that you will need to purchase a USB networking dongle or card for the PC in case it doesn't have an extra Ethernet port.

User avatar
Roken
Posts: 309
Joined: Sun Dec 31, 2017 4:35 pm
Location: UK

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 8:04 pm

If you have a WiFi connection on the Pi, then you can already connect to the internet. If you can't connect to the Pi, you don't have a WiFi connection.

Which is it?
Headless PI. OMG, someone cut it's head off. Oh, hang on. it didn't have one to start with.

W. H. Heydt
Posts: 11064
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:05 pm

Reading all the responses, I think the simplest (and quite possibly cheapest) solution is to buy:
1. 5-port Ethernet switch
2. 2 additional Ethernet cables.

Connect the switch the existing Ethernet cable (the uplink), then use the two new cables to connect the laptop and the Pi to ports on the switch. That should get the Pi both an internet connection and an IP address. Since the laptop is a Linux system, it is reasonably likely that the OP can ssh into the Pi using "ssh [email protected]<hostname>.local", where--unless modified--the <hostname> is "raspberrypi" (the default for Raspbian).

He will still have two unused ports on the switch for any other devices or roommates to use. If he wants to optimize results, he can get Cat-5e or Cat-6 cables and a gigabit switch. If he wants to allow for future network expansion, he could get a 8-port (or larger) switch.

(And, yes, that "Pi 4" bit leapt out at me, too.)

stevend
Posts: 215
Joined: Fri Oct 11, 2013 12:28 pm

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 9:14 pm

There's a post which suggests the OP wishes to use SSH into the Pi.
If so, it is necessary to enable SSH on the Pi.
Two ways do do this:
1. Via the user interface - temporarily connect a screen, keyboard and mouse.
2. create a file called 'ssh' (it can be empty) in the boot directory of the Pi's SD card.

If this is what you want to do, there should be more documentation on this site.

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

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 10:41 pm

stevend wrote:
Fri Jul 13, 2018 9:14 pm
There's a post which suggests the OP wishes to use SSH into the Pi.
If so, it is necessary to enable SSH on the Pi.
Two ways do do this:
1. Via the user interface - temporarily connect a screen, keyboard and mouse.
2. create a file called 'ssh' (it can be empty) in the boot directory of the Pi's SD card.

If this is what you want to do, there should be more documentation on this site.

The OP is presumably on a Campus and therefore he has an Ethernet Jack in a wall plate and likely needs to access a log in page to be able to have internet access..


Therefore he will need 2 X RJ45 Ethernet Connections on his Linux PC and Brigde the Connections...

...Linux like Ubuntu have this built in afaiaa !!
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

User avatar
HawaiianPi
Posts: 4857
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Problem with connecting raspberry to Linux

Fri Jul 13, 2018 11:08 pm

droleary wrote:
Fri Jul 13, 2018 1:37 pm
People need to stop feeding the trolls around here.
DirkS wrote:
Fri Jul 13, 2018 2:18 pm
Who's the troll? OP?
Looks to me it's more of a language problem...
I also believe it is a language problem, but the very first post is a bit suspicious...
saleiti wrote:
Fri Jul 13, 2018 8:31 am
I need to connect Raspberry Pi 4 to Linux computer.
Unless he is majoring in time travel. :?

Anyway, suspicions aside, and assuming it is, in fact a language barrier...

@ saleiti,

We need to know your exact configuration. There is some confusion here about how you are going to connect your Pi to your Linux computer, which is supposedly connected to your university by Ethernet. Most computers only have a single Ethernet port, and if that is already occupied by your university connection, where are you going to plug in your Raspberry Pi?

You have said that you do, and do not have a router...
saleiti wrote:
Fri Jul 13, 2018 8:59 am
Because this is a university computer and I don't have a router in this room.
saleiti wrote:
Fri Jul 13, 2018 10:24 am
No only the computer is plugged into the router.
So which is it?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Return to “General discussion”