---
# System prepended metadata

title: How to link Raspberry Pi to laptop via ethernet?
tags: [Raspberry Pi]

---

Here are three easy ways to link a [Raspberry Pi](https://www.ampheo.com/c/raspberry-pi/raspberry-pi-boards) directly to a laptop over Ethernet. Pick the one that matches your OS and whether you want the laptop to give the Pi internet.

![Raspberry-Pi-Setup-with-Ethernet-Connection-1024x585](https://hackmd.io/_uploads/H1XXcwWigl.png)

**Option 1 — Share your laptop’s internet to the Pi (DHCP auto-setup)**

This is the simplest: your laptop acts like a mini-router, gives the Pi an IP, and (optionally) internet.

Wiring: regular Ethernet cable (modern NICs auto-MDI-X; crossover not needed). Power the Pi separately (unless you have PoE).

**Windows 10/11**

1. Connect Pi ↔ Laptop with Ethernet.
2. Settings → Network & Internet → Advanced network settings → More network adapter options.
Right-click your Wi-Fi (or whatever has internet) → Properties → Sharing tab →
check Allow other network users… and select your Ethernet adapter.
3. Windows sets Ethernet to 192.168.137.1/24 and runs DHCP.
On the Pi, ip a should show something like 192.168.137.x on eth0.
4. SSH: ssh pi@192.168.137.x (default user pi, password raspberry on older images; newer images require you to set a user in imager or place an userconf).

**macOS (Ventura/Sonoma)**

1. System Settings → General → Sharing → Internet Sharing.
Share your connection from: Wi-Fi → To computers using: Ethernet → On.
2. macOS typically uses 192.168.2.1/24 and DHCP.
Find the Pi with arp -a or try ssh pi@raspberrypi.local (mDNS).

**Linux (NetworkManager)**

1. nm-connection-editor → select your Wired connection → IPv4 tab → Method: Shared to other computers → Save.
2. Your laptop will be 10.42.0.1/24; the Pi gets 10.42.0.x.
SSH: ssh pi@10.42.0.x.

Tip: To enable SSH headless, drop an empty file named ssh in the SD card’s boot partition before first boot.

**Option 2 — Direct, no internet (static IPs)**

If you just want a private link with no DHCP:

1. Pick a tiny subnet, e.g. 192.168.5.0/24.
2. On the Pi (Raspberry Pi OS, dhcpcd): edit /etc/dhcpcd.conf and add:

```
interface eth0
static ip_address=192.168.5.2/24
```


Reboot or sudo systemctl restart dhcpcd.

3. On the laptop: set the Ethernet adapter to 192.168.5.1/24 (no gateway).
4. SSH: ssh pi@192.168.5.2.

(Alternative) rely on link-local (AutoIP): both sides will self-assign 169.254.x.x; then ssh pi@raspberrypi.local often works via mDNS.

**Option 3 — USB “Ethernet gadget” (Pi Zero/Zero 2W; advanced on Pi 4/5)**

If you have a Pi Zero/[Zero 2 W](https://www.ampheo.com/product/raspberry-pi-zero-2-w-25441000), you can use a single USB cable:

1. On the SD card boot partition, add to config.txt: dtoverlay=dwc2
and to cmdline.txt append: modules-load=dwc2,g_ether.
2. Plug the Pi’s USB data port to your laptop. It appears as a USB Ethernet adapter.
3. Use Internet Sharing (Option 1) or set static IPs (Option 2).

**Finding the Pi’s IP (quick tricks)**

* raspberrypi.local (mDNS) → ping raspberrypi.local or ssh pi@raspberrypi.local.
* Look at your laptop’s ARP table: arp -a and spot the new 192.168.* / *10.42.0. ** host.
* On the Pi with a screen: hostname -I.

**Troubleshooting**

* No link light? Try another cable/port; ensure the Pi model actually has Ethernet (Zero needs USB-Ethernet or gadget mode).
* SSH refused/time out? Enable SSH (ssh file on boot) and confirm IPs are in the same subnet.
* Windows ICS didn’t give an IP? Disable/enable the Ethernet adapter; ipconfig should show 192.168.137.1 on the shared adapter.
* Firewall: Allow inbound SSH (port 22) on your laptop if you’re reverse-connecting.