2

I have been trying to design a project on my R-pi for months. I have been able to work of my R-pi from my home WiFi. However when I enter my Library's public network it cannot connect to the servers. This is why I want to connect my R-pi to my laptop over an Ethernet connection so it can use the Library's WiFi connection. I'm not sure if this is even possible as I am new to R-pi some any comments will be greatful.

UPDATE with info from comment:
My Laptop and R-pi have been connected over my WiFi connection allowing me to transfer PLC programs designed on my laptop to my R-pi. However when I move away from my home WiFi I have to change the WiFi on my R-pi all the time. So I am just wondering can I connect my R-pi to my laptop over an Ethernet cable.. No the laptop isn't able to see the server as it is on the R-pi and the laptop has no communication to it. Hence I want the Laptop to be able to communicate with the R-pi when the Laptop is connected to a public WiFi source.

3
  • 1
    Hello, welcome. What is the actual question please - it's unclear? What servers are you trying to connect to? Where are they located? Can your laptop see the servers when it's in the library?
    – Mark Smith
    Jan 28, 2020 at 15:42
  • 1
    Hi Mark, my Laptop and R-pi have been connected over my WiFi connection allowing me to transfer PLC programs designed on my laptop to my R-pi. However when I move away from my home WiFi I have to change the WiFi on my R-pi all the time. So I am just wondering can I connect my R-pi to my laptop over an Ethernet cable.. No the laptop isn't able to see the server as it is on the R-pi and the laptop has no communication to it. Hence I want the Laptop to be able to communicate with the R-pi when the Laptop is connected to a public WiFi source
    – Pengu123
    Jan 28, 2020 at 15:54
  • 1
    your question is not about a Raspberry Pi at all ... your question is about your PC and how to configure it as a LAN gateway
    – jsotola
    Jan 28, 2020 at 21:42

2 Answers 2

2

You would have to set static IP configurations for the ethernet connections on both your laptop and your Raspberry Pi 4. Here is an example configuration:

  1. Set your laptop's ethernet connection IP as 192.168.7.1 and subnet mask to 255.255.255.0
  2. Set the Raspberry Pi's ethernet connection IP as 192.168.7.2, subnet mask to 255.255.255.0 and default gateway to 192.168.7.1(your laptop's ethernet connection IP)

P.S: You can change the x of the 192.168.x.y addresses as long as it doesn't conflict with your other connections' IP addresses.

2

You do not have to change the WiFi on the RasPi all the time. You can one time just add an additional network {} block to /etc/wpa_supplicant/wpa_supplicant.conf with the settings of the Library's public network (country, ssid, psk). Then wpa_supplicant will connect to it automatically as soon as the RasPi is carried to the library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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