0

I have connected 6 raspberry pi's to an ethernet switch with 8 ports. I have connected my laptop to the switch as well. I am using VNC Viewer (and sometimes SSH) to connect to these raspberry pis using the laptop. All the pis and the laptop have been assigned static IPs. My question is, "Is there a way to provide Internet access to all the pis at once using Ethernet? I tried setting a wifi connection by editing /etc/wpa_supplicant/wpa_supplicant.conf and /etc/network/interfaces files. Although this seemed to work, the speed was very low (I am not sure why. It is a very fast connection otherwise). Also, I needed to add my personal login credentials to the wpa_supplicant file in order for this method to work and access the wifi and therefore, I prefer if there was a better way to do this.

Thank you.

Update - I have an ethernet port that can be used to connect to the Internet. I tried to connect this to the remaining port of the switch, but I could not access the Internet.

UPDATE with info from a comments:
My setup is at a university and I use university wifi to access the Internet with my laptop. I have an ethernet port available to connect to the Internet as well.
I actually tried connecting the ethernet port to the remaining port in the switch. But I was not successful. Is there something I need configure in order for it to work?

5
  • how do you access the internet with your laptop? through a router? if so, do that – Jaromanda X Jan 14 at 8:21
  • @Jaromanda - What do you mean by "do that"? My setup is at a university and I use university wifi to access the Internet with my laptop. I have an ethernet port available to connect to the Internet as well. – Ish Kav Jan 14 at 8:28
  • Oh, well, that explains the "personal login credentials" bit ... you could use your laptop as a gateway to the internet - of course, you'd have to give further details about the laptop - i.e if the laptop is connected to "the internet" via wifi, I suppose, then you could connect the laptops ethernet to the switch, and with the right configuration on the laptop, it can be the gateway for the pi's - without having to touch any wireless config or the dreaded /etc/network/interfaces file that is so maligned - all the setup would be done on the "laptop" – Jaromanda X Jan 14 at 9:44
  • Well, I came across this solution, but I was not sure whether it would work via a switch (I saw that the Internet Connection Sharing option can be used when a raspberry pi is directly connected to the laptop via ethernet). Are you implying the same thing here by "right configuration"? If not could you point me to some other resource where I can get the relevant information. Thank you very much for your input. – Ish Kav Jan 14 at 12:21
  • I said "right configuration" because until your more recent comment there was no way to know what operating system was on your laptop - yes, with Windows you could use ICS – Jaromanda X Jan 14 at 21:55
2

You wrote, "My question is, 'Is there a way to provide Internet access to all the pis at once using Ethernet?'"

Then you said in your comment, "I have an ethernet port available to connect to the Internet as well."

I think what @JaromandaX meant in his comment is to connect the remaining port on your switch to that "available ethernet port". It's an obvious comment, and the fact that you don't get it suggests that you've written your question such that it cannot be understood. If you have trouble with the language - or the technical terms - perhaps you could draw a picture & add it to your question.

Another possibility is that you've tried to connect your switch to the "available ethernet port", and still - no traffic flows. You certainly didn't say that, but again - your question is unclear. But if that is the case, the answer to that question may be to use the DHCP service on your University's network instead of fixed IP addresses.

Edit your question - make it answer-able, or delete it, please.

2
  • Well, Thank you for your suggestion and sorry about not being completely clear. I actually tried connecting the ethernet port to the remaining port in the switch. But I was not successful. Is there something I need configure in order for it to work? – Ish Kav Jan 14 at 12:31
  • @IshKav: My suggestion is to find someone who can mentor you in the fundamentals of networking - perhaps a network admin at your university. Or, perhaps you can find a good book. I fear you may be clueless in this area, and it's hard to learn by trial-and-error the way you're going about it. I'm not trying to be rude - only to be honest, and try to point you in the right direction. – Seamus Jan 14 at 18:27
2

First you should ensure that you can connect to the internet. Use one RasPi with a fresh flashed Raspberry Pi OS Lite without any modifications. Connect it direct with an ethernet cable to "the internet" (It's still not clear what it is: a router/switch in your room, a RJ45 plug in the wall, or what?). Connection to internet should work then out of the box. Never use static IP addresses. It doesn't make things simpler. On the contrary, it makes things more complicated.

If it doesn't work then it is very likely that your university has authentication/authorization restrictions. Ask the university network management how to use your credentials to connect your single RasPi to the internet. If you managed to connect it, just replace it with your 8 port switch and configure all other RasPis the same way.

1

Your problem is almost certainly "All the pis(sic) and the laptop have been assigned static IPs" There is rarely a reason to do this, and most who try get it wrong.

The Pi (like almost all computers) is designed to connect to a router with DHCP and requires no other configuration.

If you have done ANYTHING to /etc/network/interfaces you have done the wrong thing.

2
  • Amen............ – Seamus Jan 14 at 9:18
  • Well, I only edited the /etc/network/interfaces in an attempt to connect it to wifi. To assign static IPs I modified the /etc/dhcpcd.conf file. Why I require static IPs is that I need to connect to the pis by using my laptop, the problem is I need to connect the pis to the Internet simultaneously as well. That is what I am trying to understand here. – Ish Kav Jan 14 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.