I connected a raspberry pi 0 to a raspberry pi 4b+ via USB and i would like to know how can i share the internet connection. The pi4 is connected to the internet via the ethernet port. P.S.: I did all the configuration needed for the pi0 (loaded dwc2, gether and the rest), also both pi run lattest version of raspbian


This is how I achieved it:

on the pi4

to /etc/dhcpcd.conf [before the first line that starts with interface or to the end of the file, if no such lines exists]

denyinterfaces eth0 usb0

to the end of the file, add

interface br0

create the following files in /etc/systemd/network - note, the names of the files are unimportant, the important thing is the extension (.netdev/.network) and the content









enable systemd-networkd

systemctl enable systemd-networkd

Thats it for the pi4

on the pi 0

add the following the end of /etc/dhcpcd.conf

interface usb0

Though, I've done the following (as fallback in case DHCP fails)

profile static_usb0
static ip_address=
static routers=
static domain_name_servers=

interface usb0
fallback static_usb0

Obviously, you'd need to use your own local ip address, router and dns address as required

  • i tryed this 2 times , one time i couldnt connect my pi4 to the internet, and the other one i got the pi 0 connected to the internet, but the pi 4 could connect again
    – F G B
    May 31 '21 at 15:57
  • Not sure what part you did wrong then - works great for me Jun 1 '21 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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