My workbench has an Ethernet switch, and when my printer is in its enclosure, I can hardwire it, which is my preferred connection type. When I have the printer out for maintenance, however, it's usually in another room (with more room & better light) that has no Ethernet available. I'm looking for established / expected behavior in regards for configuring both types of connections - will one take precedent over the other?
FWIW, my home Router lets me configure dual MAC addresses for one IP, specifically for the purpose of devices that may have both Ethernet & WiFi connections (both my MacBook and my Laser Printer have this enabled on the router, which is nice to have). Because the enclosure for the 3D printer is basically a Faraday cage, I'm hoping it'll prefer Ethernet when it's in its home, but will connect to WiFi when it's out and about for maintenance and testing. Is this the case?
Should work fine.
Just use the ip of your preferred interface to reach OctoPrint to make sure it doesn't use wifi when it's connected to ethernet.
edit just read the second part. How does the router know which interface you want when both are connected?
I believe it's the order of the MAC in the reservation table. I'm running FreshTomato on my router, I'd need to look up the full documentation, I just noted I could add dual MACs to a single IP, and in the case of other hardware I had, one interface just took priority over the other (i.e. - with my Brother Laser, when the Ethernet is connected, the WiFi automatically shuts off).
Edit - it's assumed in the manual for dnsmasq / DHCPv4 that only one interface will be active at a time - the above mentioned situation of the printer disabling WiFi, and this behavior extends to Windows 10 as well (Link to discussion). Hence, my question here - if Ethernet is connected to my Pi, will WiFi still try to connect as well, or will it disable itself if Ethernet is no longer connected?
You can use the ifmetric
command (apt install ifmetric
) to set the routing priority. The route
or ip route
command(s) will show the current metric value(s).