Skip to content

Network Setup

Hayden Cook edited this page Jan 9, 2026 · 11 revisions

Network Setup

This page details how to setup the network on your Mac or Windows machine to allow you to connect to the Raspberry Pi and share an internet connection with it.

Windows

This guide assumes you are using Windows 11.

  1. Connect to the Pi's ethernet port.
  2. Open the Network manager.
    1. Press Win + R
    2. Type ncpa.cpl and press enter.
  3. Find the ethernet interface for the Pi. 2. If you can't find the interface, unplug the ethernet cable from your laptop and plug it back in to see which one disappears and comes back.
  4. Double click on the interface currently connected to the internet (e.g. Wi-Fi).
  5. Go to Properties->Sharing, and click the box next to "Allow other network users to connect through this computer's Internet connection"
  6. Select the Ethernet interface the Pi is using and hit "OK".
    1. If a box comes up hit about setting the IP address ignore it and press "Yes".
  7. Close out of the interface's status window.
  8. Double click on the interface the Pi is using and click on "Properties"
  9. Double click on "Internet Protocol Version 4 (TCP/IPv4)" to bring up it's properties.
  10. Make sure "Use the following IP address" is selected and configure the following:
    1. Set "IP address" to 192.168.2.1
    2. Set "Subnet mask" to 255.255.255.0
    3. Leave "Default gateway" unset
  11. Click Ok to exit out of the interface windows.
  12. Unplug the ethernet cable from your laptop and plug it back in.

Mac

  1. Connect to the Pi's ethernet port via a USB-to-ethernet converter or USB-C dock.
  2. Go to System Settings->Network and click on the ethernet interface (e.g USB 10/100 LAN).
  3. Go to Details->TCP/IP and configure the following:
    1. Set "Configure IPv4" to Manually
    2. Set "IP address" to 192.168.2.1
    3. Set "Subnet mask" to 255.255.255.0
    4. Leave "Router" unset.
  4. Go to System Settings->General->Sharing.
  5. Turn on Internet Sharing.
  6. A window should pop up confirming that you want to turn on internet sharing. Hit "Configure".
  7. A list of network interfaces should pop up. Find the one from step 2 and toggle it on.
  8. At the top of the box, toggle on the Internet Sharing.
  9. Finish by clicking OK.
  10. Unplug the ethernet cable from your laptop and plug it back in.

Linux

This guide assumes your distro is using Network Manager.

  1. Connect to the Pi's ethernet port.
  2. Open a terminal.
  3. Get the name of the connection (e.g. "Wired connection 1") using nmcli connection show
    1. If you have multiple ethernet connections it might not be clear which connection is for the Pi. In this case it helps to run nmcli connection show again with the Pi unplugged and see which connection no longer appears green.
  4. Modify the connection w/ the following commands:
export PI_CONN="<connection-name>"

sudo nmcli connection modify "${PI_CONN}" \
  ipv4.method shared \
  ipv4.addresses 192.168.2.1/24
sudo nmcli connection down "${PI_CONN}"
sudo nmcli connection up "${PI_CONN}"
  1. Unplug the ethernet cable from your laptop and plug it back in.

Testing

To test that these steps were successful, open up a terminal and enter the following command:

ssh pi@192.168.2.2 "ping google.com"

It may ask for if you are sure you want to continue connecting. Type "yes" and hit enter.

Next, it should ask for a password. The default password for the pi is cpsvip42. After entering the password the terminal should print a ping response every second. If the command hangs or prints an error message, see the troubleshooting tips below.

Troubleshooting

If the command never asks for a password but instead hangs and eventually prints the error ssh: connect to host 192.168.2.2 port 22: Network is unreachable that probably means you did something wrong in setting up the interface (steps 8-10 for Windows and step 3 for Mac).

If you put in the password, but it still hangs and eventually prints the error ping: google.com: Temporary failure in name resolution that probably means you did something wrong when setting up network sharing (step 4-6 for Windows and steps 4-8 for Mac).

If the test still doesn't work, try the following:

  • Make sure the ethernet connection is properly connected to both your laptop and the Pi. This can be checked by seeing if both lights are lit or blinking on the ethernet port on the Pi.
  • Make sure to unplug and replug the ethernet port into your laptop whenever you change your internet or interface settings.
  • Restarting your computer, as cliche as it is, is always good step in troubleshooting.

Clone this wiki locally