Onus Posted March 22, 2017 Share Posted March 22, 2017 Looking at Mubix's and sammyk's work with quick creds and posion tap, and of course playing with the bunny got my wheels turning and i decided i wanted to play around building my own pi zero into a custom ethernet gadget. I recently bought a few pi zero W's (with wifi) and am trying to get passed stage 1 of my project, i.e. getting the pi to be recognized as an ethernet adapter when plugged in to a pc or mac. i followed adafruits tutorial: https://learn.adafruit.com/turning-your-raspberry-pi-zero-into-a-usb-gadget/ethernet-gadget but it doesn't seem to work. Has anyone else tried this? can you point me to some tutorial gold! I know i am reinventing the wheel here, but for me i just want to learn buy trying to build my own from scratch.. FYI loving the bunny Quote Link to comment Share on other sites More sharing options...
jjd Posted March 24, 2017 Share Posted March 24, 2017 this one worked for me the down side is there is no dhcp server by default so although it does seem to work you need to wait a long time after plugging it in. To install a dhcp apt-get install isc-dhcp-server then set a static ip for the usb0 interface, and configure your /etc/dhcp/dhcpd.conf & /etc/default/isc-dhcp-server if you need more details on configs just let me know. Quote Link to comment Share on other sites More sharing options...
Onus Posted March 25, 2017 Author Share Posted March 25, 2017 It's the same as adafruits tutorial.. mind you my pizero is a pi zero W (built in wifi) don't know if that is interfering, but it's shouldn't.. could you share the changes to DHCPD.conf and isc- DHCP-server Quote Link to comment Share on other sites More sharing options...
jjd Posted March 25, 2017 Share Posted March 25, 2017 (edited) Sure, I have only ever done this with a zero w. of course the ip range is just what I selected randomly you can adjust them as need be just keep in mind if you set it to something on the same network as your wifi or the clients network you will have issues. first install dhcp apt-get install isc-dhcp-server set the dhcp option /etc/dhcp/dhcpd.conf ddns-update-style none; authoritative; log-facility local7; subnet 10.99.140.0 netmask 255.255.255.0 { range 10.99.140.10 10.99.140.100; option routers 10.99.140.1; option broadcast-address 10.99.140.255; default-lease-time 600; max-lease-time 7200; option domain-name "local"; } tell the dhcp server to apply to the usb0 interface /etc/default/isc-dhcp-server DHCPD_CONF=/etc/dhcp/dhcpd.conf DHCPD_PID=/var/run/dhcpd.pid INTERFACES="usb0" set the usb0 interface to have a static ip /etc/network/interfaces add auto usb0 # or allow-hotplug usb0 iface usb0 inet static address 10.99.140.1 netmask 255.255.255.0 network 10.99.140.0 broadcast 10.99.140.255 # gateway 10.99.140.1 then sudo service isc-dhcp-server restart if theres any issues with your config files it will give you two commands you can run for more info. after plugging the pi in again it may take a moment before the dhcp server comes up (pi boots much slower than bashbunny) and hands an ip to your client so give it a moment my system gets a self assigned ip then the pi gives it one but you may have to renew the ip if it does not get one quickly enough. this should have you up and running. it will not get internet over usb with these setting, for my use i wanted internet over wifi and pi access over usb... or cellphone access over wifi and computer access over usb.... let me know if this works for you! Edited March 25, 2017 by jjd Quote Link to comment Share on other sites More sharing options...
Onus Posted March 26, 2017 Author Share Posted March 26, 2017 Im going to play around with this tomorrow afternoon.. thank you so much.. we can investigate later about decreasing boot time. Im just trying to understand the bones.. can you speak a bit to what the thought process of picking ip range.. Quote Link to comment Share on other sites More sharing options...
b0N3z Posted March 26, 2017 Share Posted March 26, 2017 (edited) It doesn't matter if its W or not, all the pi zero tutorials will work with all 3 versions of the zero Edited March 26, 2017 by b0N3z Quote Link to comment Share on other sites More sharing options...
jjd Posted March 27, 2017 Share Posted March 27, 2017 On 3/25/2017 at 7:10 PM, Onus said: Im going to play around with this tomorrow afternoon.. thank you so much.. we can investigate later about decreasing boot time. Im just trying to understand the bones.. can you speak a bit to what the thought process of picking ip range.. you will have issues if you pick an ip range that the client or pi connect to on wireless so i just picked one I'm not likely to run into Quote Link to comment Share on other sites More sharing options...
targetdrone Posted March 27, 2017 Share Posted March 27, 2017 Have you looked at WarBerryPi yet? https://github.com/secgroundzero/warberry It seems similar to what you're wanting to end up with. I know you want to roll your own to learn, so don't just download it and go. Keep working at yours. But if you do get stuck trying to figure something out, have a look at what they've done. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.