I have a laptop connected to the internet via Wi-Fi. It is also connected to a private network via LAN. If the laptop is connected to both networks it doesn't have internet connection. How can I tell the systen that I want all of my programs to use the Wi-Fi and only selected ones to use LAN
1 Answer
Your private LAN is preferred since it is on a potentially faster connection. In order to get Linux to prefer the other Wi-Fi, you will have to change its metric. How you change the metric may depend on which distribution of Linux you are using. Any answer I give past this will probably be flagged as a duplicate since there are other posts that answer it for various distributions. This link tells how to do it in Ubuntu.
The other part of your question is how to get certain processes to use the private "NIC. In this situation, the easiest way is for the ones that need to use the LAN to connect to devices based on IP, assuming that the programs will be connecting to hosts on that actual subnet, and not routed somewhere else public. Depending on where that is, you may have to add some static routes. Otherwise Linux will not be able to easily know which traffic needs to go out which NIC.
There is a similar answer here which discusses how to use a different NIC for different processes. This would be good in situations where the boundaries aren't very distinct.