2

I have a Debian system with multiple network interfaces. For the uplink interface (eno2), two different profiles are valid, depending whether the system is:

  • on my desk
  • in the lab

I would want NetworkManager to always automatically try to connect using the Lab connection (profile) for eno2, as I can manually select the other profile, if necessary. How can I control which connection NetworkManager applies?

1
  • You could create a connection profile for it and add a startup script containing nmcli connection up id <connection-id> (more info.
    – harrymc
    Commented May 25, 2018 at 16:29

2 Answers 2

0

According to this: https://wiki.debian.org/NetworkManager

NetworkManager by default does not manage any wired network connections, those defined in /etc/network/interfaces.

You can tell NetworkManager to manage these by setting managed=true in /etc/NetworkManager/NetworkManager.conf.

You should then be able to define the configuration of NetworkManager, including the network you wish it to always attempt to connect.

1
  • thank you for the reply. However, on a recent Debian installation (9.3), the only interface defined in /etc/network/interfaces is the loop back interface, all others are by default managed by NetworkManager. In addition, my question was about controlling which connection NetworkManager applies. Commented Jun 1, 2018 at 12:24
0

Ok, I think I have a working solution for this.

First of all, the options available in the GUI for NetworkManager (network-manager-applet?) is rather limited, so it's better to use the command line interface directly, which is nmcli.

Tecmint had a reasonably good article on using nmcli.

The solution works by configuring Connection options as follows:

  • for each interface, I configure the default Connection so that it is bound to the interface with the interface-name option and only one such connection is bound per interface.
  • for all other Connections, I set the option autoconnect=false so that the Connection will only be applied, if I request so.

I think this should work. Will have to test.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .