Skip to content

Instantly share code, notes, and snippets.

@wojtekka
Last active February 8, 2022 10:11
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Raspberry Pi Zero USB network with DHCP server
#!/bin/sh
echo "dwc2" >> /etc/modules
echo "g_ether" >> /etc/modules
echo "dtoverlay=dwc2" >> /boot/config.txt
cat > /etc/systemd/network/usb0.network << EOF
[Match]
Name=usb0
[Network]
DHCPServer=yes
Address=192.168.7.1/24
[DHCPServer]
PoolOffset=2
PoolSize=16
EOF
systemctl enable systemd-networkd.service
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment