After borking up my pi a few times and a night of research on the forums and web, I had found numerous threads about not being able to have both Ethernet and WiFi enabled at the same time with DietPi. I think I found a workaround by adding this custom script to autostart option:
#!/bin/bash
# DietPi-Autostart custom script
# Location: /var/lib/dietpi/dietpi-autostart/custom.sh
# Set the IP address of eth0 to 192.168.1.9/24
ip addr add 192.168.1.9/24 dev eth0
# Enable the eth0 interface
ip link set dev eth0 up
# Remove the default route from eth0
ip route del default dev eth0
# Enable the wlan0 interface
ip link set dev wlan0 up
# Set the default route to 192.168.1.1 on wlan0
ip route add default via 192.168.1.1 dev wlan0
exit 0
It locks up after you enable eth0 for the first time, but after reboot both eth0 and wlan0 are enabled! Still messing with routes and stuff but so far it seems to be working, thought I would share. Hope this helps!
FWIW - I have wlan0 connected to home internet AP, and eth0 connected to a POE switch with IP cameras on the other end, and am planning to test motionEye with them. Still can’t ping the other end but am still playing with routes.
That’s not true. You can easily enable both at the same time. This is what we do for our Hotspot feature. There you have Ethernet connection to the internet and WiFi offered as Hotspot
But your scenario is exactly the other way around. Use WiFi to connect to internet und Ethernet to connect to something else. However, it’s working to have both adapters up and running same time. Of course manual configuration steps needed to create a birded network between Ethernet and WiFi.
Well, it was true for me, for whatever reason. Both eth0 and wlan0 share the same subnet, I just had to add a route to the wired device via eth0 once both nics were up at the same time after the custom.sh runs on boot.
Regardless, if it works for everyone else, fine, just posting a solution that worked for me here in case anyone runs in to a similar issue I experienced.
Yes i think that’s the only real change going on (setting the default gateway back to wlan0 after enabling eth0) that i needed to do manually, otherwise as soon as i enabled eth0 via dietpi-config while connected to wifi, I wasn’t able to ssh in to the pi over wireless any longer because it set the new default route to eth0, which i didn’t want to do.
Thoughts? I can re-image my pi sometime this week and recreate this scenario if you like, otherwise this quick fix works fine for my use case.