I'm running an application, where I need to use the LAN interface as a communication input with a device, using a socket server open on the IP for that interface, make the handling of this data and then send it to another server through the wireless interface. Searching a little, I tried to use the metrics configuration of the interfaces, inside the /etc/network/interfaces
file as follows:
auto eth0
iface eth0 inet static
address 192.168.20.1
netmask 255.255.255.0
metric 200
iface wlan0 inet static
address 192.168.10.154
netmask 255.255.255.0
gateway 192.168.10.1
metric 100
However, when the LAN interface is connected to the device, traffic is interrupted on the wireless interface and using the route -n
command I realize that the metrics made no difference, where eth0 is with metric 202 and wireless interface with metric 303.
I performed these tests using a Raspberry PI4 as Ubuntu LTS Server 20:04:01 Arm64 and also the Raspberry Pi OS (32-bit) with desktop, both had the same problem.