Last active
February 8, 2022 10:11
-
-
Save wojtekka/6c532afa9437c9b6696e789caa6ecf4a to your computer and use it in GitHub Desktop.
Raspberry Pi Zero USB network with DHCP server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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