Set preference for Wifi over Ethernet

Than you for a fine write-up.

I’m sure it works, so I’ve very little to add. Ok, just a couple of things :slight_smile:

  1. Point 9. If dnsmasq starts before eth0 is up, you can probably delay it in systemd by changing the lines in /lib/systemd/system/dnsmasq.service that contain network.target to read network-online.target and then enabling “Wait for network” in MyOSMC. For this change to survive updates, you should make a copy of the new dnsmasq.service file in /etc/systemd/system.

  2. Point 18. Do you mean enable the dnsmasq service, ie sudo systemctl enable dnsmasq?

Edit: A few follow-on questions:

  1. What are the IP addresses of the router, thw Pi WiFi interface and the NAS?
  2. Do you need to give the NAS a fixed IP address?
  3. How is the NAS data now shared to other devices on the network?
  4. What is the role of dnsmasq (a DNS proxy) in the system? Put another way, why does the NAS need a DNS proxy?

I will try this one.

No it is to start the dnsmasq service. I had re-checked the command from history

The IP address of my router is 192.168.1.1 and the Pi Wifi Interface has IP address of 192.168.1.11 and the NAS has an IP address of 192.168.2.30 (which is a static IP assigned by dnsmasq

There are 2 ways I have shared the NAS to other device on the network

  1. I have automounted all the drives from the NAS on to my Pi. Then I have shared these mount points as a samba share. This way all the machines in my network will be able to see the samba mounts.
  2. In my main router I have created a static route which will enable the hosts in 192.168.1.0/24 network to see the hosts in 192.168.2.0/24 network. This way I will be able to directly access the NAS drive without any intermediate samba and automount in RPI

The role of dnsmasq is to provide a control over the dhcp address which is allocated the the ethernet port as well as the machines which connect to the ethernet port. In this case I allocate an IP address of 192.168.2.1 to the ethernet port in my RPI and 192.168.2.30 for the mybooklive NAS which I had connected through the ethernet port.

This setup works very fine for me. I am able to stream movies and also share the files over the network

Ok. I raised the point because point 19 is “reboot the system”. If dnsmasq needed to be started, then it wasn’t already running. systemctl enable just means that it will run at system startup.

Otherwise, good job and thanks for sharing. :+1: