Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: How do I force NM to try and make lan connection.

  1. #1
    Join Date
    Nov 2008
    Posts
    2,096
    Blog Entries
    1

    Default How do I force NM to try and make lan connection.

    If I have disconnected a lan connection which has a manual ip address in order to select another connection which has a different subnet configuration I frequently find NM just gives up and says there is no connection available even though the lan cable is connected and the device powered on.

    This problem usually occurs when I am connecting to a device using a default fixed address and when no DHCP sever is available, for example when connecting to a new and unconfigured switch or AP.

    When I am confronted with this problem all I can do at present is reboot. Is there a better way?
    Budge

  2. #2
    Join Date
    Sep 2012
    Posts
    6,775

    Default Re: How do I force NM to try and make lan connection.

    This is far too vague to make any guess. Explain what "disconnect a lan connection" means and how you select another connection. Show logs when it happens and connection(s) definition(s).

  3. #3
    Join Date
    Nov 2008
    Posts
    2,096
    Blog Entries
    1

    Default Re: How do I force NM to try and make lan connection.

    Hi arvidjaar,
    Will have to come back to this later when I have time to take proper record of issues. Am working on site but much more slowly because of this problem.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,101

    Default Re: How do I force NM to try and make lan connection.

    I am with @avidjaar that you probably should do less of prose, but more a step wise explanation of what you do..

    But it is possible that I more or less understand what you mean.

    1. You configure NM with a fixed IP address, thus telling it explicitly that you do not want it to use DHCP to get an IP address from any source.
    2. You disconnect the ethernet cable and connect it to another network.
    3. NM still tries to use the IP you told it to use and that fails of course because there is no partner within the subnet now connected.


    IMHO this is a logical situation. I do not know of any way how NM can decide that your configuration all of a sudden should be changed from not using DHCP into using it. NM fails the feature of mind reading.
    Henk van Velden

  5. #5
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    820

    Default Re: How do I force NM to try and make lan connection.

    Quote Originally Posted by Budgie2 View Post
    If I have disconnected a lan connection which has a manual ip address in order to select another connection which has a different subnet configuration I frequently find NM just gives up and says there is no connection available even though the lan cable is connected and the device powered on.

    This problem usually occurs when I am connecting to a device using a default fixed address and when no DHCP sever is available, for example when connecting to a new and unconfigured switch or AP.

    When I am confronted with this problem all I can do at present is reboot. Is there a better way?
    Budge
    I do not really understand what you did and what you wanted to achieve. But hopefully some of the following hints are helpful for you:

    • By default, NetworkManager creates a temporary wired connection for any Ethernet device that is managed and doesn't have a connection configured. To avoid this behaviour i created a file /etc/NetworkManager/conf.d/20-cable_autoconnect.conf with no-auto-default=* in it. This disables that behaviour and gives me full control (when will which port be activated / de-activated) on all my LAN connections.
    • For each connection there is a file in /etc/NetworkManager/system-connections in which the connection specific parameters (LAN/WLAN, DHCP/manual IP address, ...) are defined. I have one file to connect to any network that provides DHCP-connection. And many different files with manual setup (IP, DNS, ...) connections. How to create these connection files and how to switch between them depends on your desktop environment (in KDE i use plasma-nm5). But as far as i know the NetworkManager package will always provide nmcli and nmtui (to be used from the command line) for that purpose.
    • I always de-activate an active connection (with one of the tools mentioned above) before i unplug/change the LAN cable.

    Regards

    susejunky

  6. #6
    Join Date
    Nov 2008
    Posts
    2,096
    Blog Entries
    1

    Default Re: How do I force NM to try and make lan connection.

    Quote Originally Posted by susejunky View Post
    I do not really understand what you did and what you wanted to achieve. But hopefully some of the following hints are helpful for you:

    • By default, NetworkManager creates a temporary wired connection for any Ethernet device that is managed and doesn't have a connection configured. To avoid this behaviour i created a file /etc/NetworkManager/conf.d/20-cable_autoconnect.conf with no-auto-default=* in it. This disables that behaviour and gives me full control (when will which port be activated / de-activated) on all my LAN connections.
    • For each connection there is a file in /etc/NetworkManager/system-connections in which the connection specific parameters (LAN/WLAN, DHCP/manual IP address, ...) are defined. I have one file to connect to any network that provides DHCP-connection. And many different files with manual setup (IP, DNS, ...) connections. How to create these connection files and how to switch between them depends on your desktop environment (in KDE i use plasma-nm5). But as far as i know the NetworkManager package will always provide nmcli and nmtui (to be used from the command line) for that purpose.
    • I always de-activate an active connection (with one of the tools mentioned above) before i unplug/change the LAN cable.

    Regards

    susejunky
    Perfect. You understand my problem and have a solution. Many thanks.

    Only one question; is the de-activation of an active connection as you describe essential? What are implications of crashing out by just unplugging or by rebooting the device to a new subnet?

    For example, say I have used a default ip on a new device to log in, reconfigured the device connection as required and then rebooted it, of course I lose the connection. What I wish is to be able to go straight to NM and be able to select the new, already preconfigured connection. It might be for DHCP if I have enabled DHCP on my laptop but more usually it is for a new fixed subnet to which I can connect, log in and continue with configuration of the device.

    I am thinking that once the original connection has been broken and after a sensible timeout, I would like to connect to the new connection and have NM succeed. Is the crude disconnection going to cause further problems with NM?

    Many thanks again for your help. Will try as you suggest and report back if there are issues.
    Budge

  7. #7
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,306
    Blog Entries
    1

    Default Re: How do I force NM to try and make lan connection.

    Quote Originally Posted by Budgie2 View Post
    Only one question; is the de-activation of an active connection as you describe essential? What are implications of crashing out by just unplugging or by rebooting the device to a new subnet?

    For example, say I have used a default ip on a new device to log in, reconfigured the device connection as required and then rebooted it, of course I lose the connection. What I wish is to be able to go straight to NM and be able to select the new, already preconfigured connection. It might be for DHCP if I have enabled DHCP on my laptop but more usually it is for a new fixed subnet to which I can connect, log in and continue with configuration of the device.
    I have multiple ethernet connection definitions (and some VPN connections) configured, and frequently change networks as you describe without issue. I have them set up to reach various network devices (usually for config purposes), as well as a DHCP connection for when that i required.
    Last edited by deano_ferrari; 22-Mar-2021 at 09:28.
    openSUSE Leap 15.3; KDE Plasma 5

  8. #8
    Join Date
    Nov 2008
    Posts
    2,096
    Blog Entries
    1

    Default Re: How do I force NM to try and make lan connection.

    Hi Deano,
    You clearly understand the procedure. Glad you don't have any problems with NM.

    My own NM experience has been just about acceptable until recently when NM stopped working for me until I had to reboot. NM has been irritating in the past and in fact my office workstation has been using wicked for the last couple of years because of the problems I have had previously. For work on site however the laptop with NM is what I use but now has become impossible. To do testing and write up the symptoms accurately requires time I do not have, hence my hasty post.

    I now have some other options to work on. Not sure the blanket no-auto-default is quite right for me until I learn how to bring some options back, in particular when turning on for normal use rather than playing with switches and aps. If you have any suggestions on an intermediate configuration please say.
    Regards,
    Budge

  9. #9
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    820

    Default Re: How do I force NM to try and make lan connection.

    Quote Originally Posted by Budgie2 View Post
    ... is the de-activation of an active connection as you describe essential?
    I am not sure if it is essential. I just do so in order to avoid potential (?) problems.

    Quote Originally Posted by Budgie2 View Post
    ... What are implications of crashing out by just unplugging or by rebooting the device to a new subnet?

    For example, say I have used a default ip on a new device to log in, reconfigured the device connection as required and then rebooted it, of course I lose the connection. What I wish is to be able to go straight to NM and be able to select the new, already preconfigured connection.
    As long as you have a connection file that represents your new connection setup you should be able to switch NetworkManager to that connection (as soon as the device has booted completely).

    If you do not have a connection file available you still can create it (using nmcli, nmtui, plasma-nm5, ... or even just a text editor) but then you might have to restart NetworkManager to set the new connection file active..

    Regards

    susejunky

  10. #10
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,306
    Blog Entries
    1

    Default Re: How do I force NM to try and make lan connection.

    Quote Originally Posted by Budgie2 View Post
    My own NM experience has been just about acceptable until recently when NM stopped working for me until I had to reboot. NM has been irritating in the past and in fact my office workstation has been using wicked for the last couple of years because of the problems I have had previously. For work on site however the laptop with NM is what I use but now has become impossible. To do testing and write up the symptoms accurately requires time I do not have, hence my hasty post.
    You could examine the NetworkManager logging to gain a better understanding of what is not working as expected. There should be no need to reboot either. (You can just restart the NetworkManager service if necessary.)
    openSUSE Leap 15.3; KDE Plasma 5

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •