Main Content

Access Internet When Raspberry Pi Is Directly Connected to Computer Using Ethernet

When Raspberry Pi® hardware is directly connected to a computer using an Ethernet cable, perform these steps to access the Internet from the hardware.

  1. Connect the Raspberry Pi hardware to a wireless network.

  2. Open a Secure Shell (SSH) command-line session with the hardware using the IP address as This is the static IP address assigned to the hardware during the Hardware Setup process for direct connection.

    r = raspberrypi('','pi','raspberry'); 

    Here, raspberry and pi are the default user name and password of the Raspberry Pi hardware.

  3. From the routing table, delete the default route, The hardware uses this route to access external hosts.

    sudo ip route del
  4. Check if the hardware is now connected to the Internet by executing the ping command on the Google® DNS IP address, A successful response indicates that the hardware is connected to the Internet.


See Also