Search code examples
linuxnetwork-programmingsystemd

How to make a network interface unavailable to all but one process


In an embedded project I'm using 5 modems. One main modem for OTA upgrade, remote SSH, sending data on the cloud, etc. And 4 modems for network survey (reading signal strenght, making speedtest, on each network operator in my country).

My main modem (wwan-main) have a sim card with a subscription with a lot of data available. 4 other modems (wwan-aux) have sim card with a very limited amount of data available.

I want to be sure that, even if my main-modem fails, applications other than my network-survey process will never use the wwan-aux interfaces to send data.

I've defined metric, wwan-main with metric 10 and wwan-aux with metric 50, but if my wwan-main failed, the system will use the next available interface, so wwan-aux and I don't want that.

Do you have any solution for this?


Solution

  • even if my main-modem fails, applications other than my network-survey process will never use the wwan-aux interfaces to send data.

    So just do not add default route via these interfaces, so that they will never picked.