Issue with WiFi and eth0 at same time

Having a hard time enabling both WiFi and ethernet on DietPi Os running on Intel Celeron NUC.

Basically I am running a Plex server on my Diet Pi system and want to stream video to a Plex client on another machine via Ethernet ! I want to connect to internet using WiFi and connect to client via Ethernet cable

  • WiFi is set to DHCP and say has a ip address 192.168.1.70

  • Enabled ethernet via DietPi-config

  • set static ip for ethernet and set the ip to 192.168.1.71

  • I need to enter gateway in DietPi-config screen, so used the gateway 192.168.1.1 (say my router)

  • ssh access is lost because system by default will prefer ethernet over WiFi. So I adjusted the default route as below

    ip route replace default via 192.168.1.1 dev wlan0

  • removed gateway from ethernet by making the change in /etc/network/interfaces

  • restarted networking using
    systemctl restart networking.service

Now the issues is iam no longer able to SSH using WiFi ip say 192.168.1.70 even though I adjusted the gatway to be use wlan0 as default !

What I am doing wrong here ! Appreciate any help !!!

I basically fixed the issue as below:

I just needed to Remove ethernet route as below

ip route del 192.168.1.0/24 dev eth0

And I am able to use SSH and both WiFi and Ethernet co-exist.

I got this idea from the below post:

What would be the benefit of having both WiFi as well as Ethernet connected to same network? What is the use case?

Well I am essentially running Plex media server on diet pi system.

The Plex server should stream video to local clients over LAN

The Plex server should also stream video to a remote client over internet

That’s Why I need both the interfaces ! But just verified that Plex still use WiFi interface to stream to local clients (even after selecting prefer lan for local Clients setting in Plex server settings)

Basically it’s because there is only one route on the system using WiFi wlan0 interface , so looking further into it. But hope I was able to clearly explain my usecase. Please Suggest me if you have any recommendations using other approaches.

Personally, I would go with Ethernet only. I don’t see any benefit of using both. Ethernet should have lower latency and should be more reliable.

Well imagine this

I have two devices that receive video from Plex server !

Device 1 - is outside my network (say a friend / neighbour)

Device 2 - a device (Linux box like raspberry pi or any other SBC with Linux) in my house

So basically the flaw in my the approach i said above is I am using same network range for both eth0 and wlan0 interfaces. All I have to do is

  1. Enable eth0 interface on Plex server running on diet pi os.

  2. If my WiFi router has 192.168.1.0/24 range and 192.168.1.1 as gateway, I need to ensure that eth0 on Plex server and eth0 on all my local devices use a different network range like 10.0.0.0/24

  3. On Plex server ensure there is a route for wlan0 Gateway as discussed in my above post.

  4. Als, on my Plex server running on DietPi OS, add a static route to the LAN subnet through the eth0 interface. For example:

sudo ip route add 10.0.0.0/24 dev eth0

Add the above route to all Linux machines on my LAN network !

So you try to split network load between Ethernet and WiFi to avoid an overload situation on Ethernet? Did you already faced network issues while using Ethernet only?

No I am not trying to split network load between WiFi and internet ! What I want to achieve is

  • I have a media server (Plex server) running on Diet Pi OS on an Intel NUC box !

  • some devices can talk to my media server over internet , so internet connectivity through WiFi is necessary because connecting my internet router to my media server using ethernet is not possible as I can’t hide the cable inside the wall or roof (I am renting here)

  • My custom TV box based on OSMC with a Plex client needs to be connected directly (using ethernet cable) to my media server ! This way I can stream high quality high bitrate 4k video without buffering to my TV box.

  • My tv box and Plex server are adjacent to each other so connecting them using a short ethernet cable is not a problem at all. I can very well use WiFi network for that , but the 4k video buffers and extremely slow / struck.

  • Also there are atleast 20 devices on my WiFi network like smart sonos speakers, custom tv box, Apple TV 4K, smart bulbs, mac mini, MacBooks and iPhones that wat the bandwidth of WiFi and also cause some interference so WiFi network speed is greatly diminished. Where as for buffer free high bitrate 4k streaming I need atleast 200 to 300 Mbps speed and ethernet connection from my media server to custom TV box is my best best !

I tried it last night and it all works wonderfully without a lag / stutter !

Does this mean your NUC is connecting to your local network via WiFi? And your TV box is connecting to the internet via your NUC?

Maybe you should think of using a network bridge interface instead of Ethernet and WiFi having same network IP range Easy Raspberry Pi WiFi Bridge - Pi My Life Up

Or a different way to create a network bridge How to setup and configure network bridge on Debian Linux - nixCraft

Thanks for that ! Will look into the network bridge
Option. Well as of now my Ethernet and WiFi interfaces are setup with different network IP ranges.

NUC has both eth0 & wlan0 interfaces
TV box also has both eth0 & wlan0 interfaces

eth0 interfaces are on 10.x.x.x network
Wlan0 interfaces are on 192.x.x.x network

  • My NUC is connecting to internet via WiFi
  • My TV box is also connecting to the internet via WiFi
  • eth0 of my NuC and eth0 of TV box are connected together by a cat5 cable !

Anyway my setup works pretty fine now !