1

I am running Ubuntu 22.04 and since the past few days I have really been struggling with getting internet connectivity to my Raspberry Pi, it doesn't support wireless networks, so I need to run a LAN cable to it.

I also don't have access to any routers/switches near me, thus I have to essentially configure my PC to assign an IP to the hardware on eth0 port.

I have tried it multiple times but it just doesn't seem to work. I have trouble figuring out how I should configure the IP for my eth0 port.

FWIW, yes I have already tried configuring a DHCP server so that I am able to assign IP from my PC.

Edit: I have been able to ssh into my Pi , but I am not able to access sites on the internet via my Pi still. Could it be some issue with the DNS or improper config of the default gateway?

8
  • 5
    The Pi is not the only part you need to configure though. You'll need to set up / enable Internet Connection Sharing (or equivalent) on the PC as well. Often once you have that enabled, you can really just use your PC like a typical home router (i.e., just enable a DHCP client on the Pi). What OS does your PC run though?
    – Tom Yan
    Commented Nov 17, 2023 at 4:19
  • 1
    See tomshardware.com/how-to/… or support.monnit.com/article/…, for example. Commented Nov 17, 2023 at 4:30
  • 2
    In order to rule out any problem with the Pi or the cable, you should hook it up to a hub/router in a "known good" network with a friend or at work at least once. Then, once you have verified that working and if it's still not working at home, go through this article that I found helpful. Commented Nov 17, 2023 at 8:01
  • 1
    And, unlike what you incorrectly stated, it supports any USB WiFi that the installed OS supports. If Linux it should support most of them either "out-of-the-box" or by installing drivers. How valuable is your time (and sanity)? If more than $10 total just buy the damn dongle. Commented Nov 17, 2023 at 13:22
  • 2
    Justing having IP address is not enough. Your computer needs to act as an router so it can forward Pi's traffic to Internet. Internet Sharing (Windows or macOS) is one way to do this. For Linux PC, you can configure it through iptables or use similar Internet Sharing options if you use Network Manager.
    – Bolong
    Commented Nov 18, 2023 at 2:11

1 Answer 1

0

In order to rule out any problem with the Pi or the cable, you should hook it up to a hub/router in a "known good" network with a friend or at work at least once. Then, once you have verified that working and if it's still not working at home, go through the following steps from this article that I found helpful:

  1. Connect computer to personal/cellular Wi-Fi hotspot.
  2. Open Network Connections – Type “network connections” into the Windows Search Bar and select View network connections. Alternatively, this window can be accessed through Settings > Network & Internet > Status > Change adapter options.
  3. Right click the Wi-Fi connection, then select Properties and click on the Sharing tab.
  4. Ensure both checkboxes are selected. Select the Ethernet port, in the drop-down menu, that is intended to be shared from the computer and click the OK button. NOTE: Some computers will have more than one Ethernet port and the proper one will need to be selected.
  5. The Wi-Fi internet connection should now be shared and the logo will update to indicate this.
  6. To stop sharing the connection, right click on the Wi-Fi connection being shared from the Network Connections window, select Properties, click on the Sharing tab, deselect the first checkbox, and click the OK button.

If errors arise in sharing the connection, an alternative method to bridge connections could potentially be used instead. This method is described below:

  1. Connect computer to personal/cellular Wi-Fi hotspot and open the Network Connections window as described in steps 1-2 from the previous section.
  2. Select both the Wi-Fi and Ethernet connection by holding the CTRL key and clicking on both items. NOTE: Some computers will have more than one Ethernet port and the proper one will need to be selected.
  3. With both connections selected, right click on the Wi-Fi connection and select Bridge Connections.
  4. A popup should appear indicating the connections are being bridged.
  5. NOTE: Sometimes there may be a popup indicating an unexpected error occurred while configuring the Network Bridge. Even if this popup is experienced, the bridge may still be created. If not, attempt to recreate the bridge following steps 1-4.
  6. The Wi-Fi connection should now be shared/bridged. A new Network Bridge icon will appear in the Network Connections window and will change status after the bridge setup is complete. The Wi-Fi and Ethernet connections will also change status to show they are bridged.
  7. To stop bridging/sharing the connection, right click on the Network Bridge connection from the Network Connections window, select Delete, then click Yes on the Confirm Connection Delete popup.
  8. A popup should appear indicating the Network Bridge is being deleted. The Network Bridge icon will also be removed from the Network Connections window.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .