Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: most simple way to restart NetworkManager

  1. #11
    Join Date
    Sep 2019
    Beans
    28

    Re: most simple way to restart NetworkManager

    Quote Originally Posted by TheFu View Post
    I'd setup the network using netplan and disable network-manager (everything). Once netplan was proven to be stable for a week, then I'd purge network-manager-{everything}. None of my systems have any network-manager software on them. My laptop that does move from time to time uses wicd for wifi. At home, that laptop uses a wired ethernet connection with a USB-to-ethernet adapter.
    Does it need systemd-networkd ?

  2. #12
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: most simple way to restart NetworkManager

    Quote Originally Posted by maketopsite View Post
    Does it need systemd-networkd ?
    I don't know. I've never had to install anything special.
    Code:
    $ dpkg -l '*networkd*'
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name                Version      Architecture Description
    +++-===================-============-============-=====================================>
    ii  networkd-dispatcher 2.0.1-1      all          Dispatcher service for systemd-networ
    is the only package with "*networkd*" in the name.

  3. #13
    Join Date
    Sep 2019
    Beans
    28

    Re: most simple way to restart NetworkManager

    Quote Originally Posted by TheFu View Post
    I don't know. I've never had to install anything special.
    Code:
    $ dpkg -l '*networkd*'
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name                Version      Architecture Description
    +++-===================-============-============-=====================================>
    ii  networkd-dispatcher 2.0.1-1      all          Dispatcher service for systemd-networ
    is the only package with "*networkd*" in the name.
    From example on https://netplan.io/examples/ :
    Code:
    renderer: networkd
    Code:
    Netplan supports both networkd and Network Manager as backends. You can specify which network backend should be used to configure particular devices by using the renderer key.
    Is it necessary to use renderer ?

    Are you running systemd-networkd ?
    Code:
    # systemctl status systemd-networkd
    ● systemd-networkd.service - Network Service
         Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; vendor preset: enabled)
         Active: inactive (dead)
           Docs: man:systemd-networkd.service(8)

  4. #14
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: most simple way to restart NetworkManager

    Code:
    renderer:
    is required as part of the netplan.io config file.

    If NetworkManager is listed, then networkd won't be used and all the issues that NetworkManager has come to the system.
    But a simple netplan config file for static IPs removes the need for NetworkManager and all those issues:

    Here's an example from a 20.04 system:
    Code:
    $ more /etc/netplan/01-ens3-static.yaml 
    network:
      version: 2
      renderer: networkd
      ethernets:
         ens3:
           addresses:
              - 172.22.22.3/24
           dhcp4: false
           dhcp6: false
           gateway4: 172.22.22.1
           nameservers:
             addresses: [ 172.22.22.80, 172.22.22.81 ]
    I've colored the parts you should insert different values for in blue.

    After changing those parts, run these commands:
    Code:
    sudo netplan generate
    sudo netplan apply --debug
    That's it. No more network-manager problems.

  5. #15
    Join Date
    May 2010
    Beans
    1,270

    Re: most simple way to restart NetworkManager

    Watch the spacing. YAML is picky. Some you have to TAB, some are SPACES.

  6. #16
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: most simple way to restart NetworkManager

    Quote Originally Posted by ActionParsnip View Post
    Watch the spacing. YAML is picky. Some you have to TAB, some are SPACES.
    The YAML spec doesn't mandate either, just be consistent. I've never used tabs in a yaml file. There is a requirement that at least 2 spaces are needed for an indentation level, but as long as there are 2 or more spaces, the number doesn't matter, provided all entries of the same level have the same number of spaces. Different levels can use different numbers of spaces. I suppose at least 1 tab could be used to create an indentation level. Just not my style.

    Be consistent in spaces, that's the rule for YAML.

    Some people may have their editor setup to swap
    spaces for tabs
    Or
    tabs for spaces
    automatically. This will always cause problems, IME.

    Now, gmake and other versions of Makefiles **do** have a tab character mandate, but that isn't YAML.

  7. #17
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,221
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: most simple way to restart NetworkManager

    I believe that yaml disallows tabs. Ref: section 6.1 here: https://yaml.org/spec/1.2/spec.html#id2777534 :
    To maintain portability, tab characters must not be used in indentation, since different systems treat tabs differently.
    I just tried python yaml module and it allows tabs equal to 4 spaces.
    Last edited by The Cog; 4 Weeks Ago at 05:47 PM.

  8. #18
    Join Date
    Apr 2014
    Beans
    737

    Re: most simple way to restart NetworkManager

    Quote Originally Posted by TheFu View Post
    I do this for laptops and devices that are hard or impossible to set static IPs, but for any system that will be a server, I set any static IPs on-the-OS so a dhcp failure doesn't prevent communications on the LAN. LAN systems don't need a router to talk.
    Sometimes the dhcp reservation setup is easy. Sometimes not. https://blog.jdpfu.com/2011/07/18/us...ice-management
    Good point. I have had this problem a few times.

    Quote Originally Posted by The Cog View Post
    I believe that yaml disallows tabs. Ref: section 6.1 here: https://yaml.org/spec/1.2/spec.html#id2777534 :


    I just tried python yaml module and it allows tabs equal to 4 spaces.
    I've used single spaces without a problem thus far. Anything else has always failed for me.

  9. #19
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: most simple way to restart NetworkManager

    Quote Originally Posted by The Cog View Post
    I believe that yaml disallows tabs. Ref: section 6.1 here: https://yaml.org/spec/1.2/spec.html#id2777534 :
    I just tried python yaml module and it allows tabs equal to 4 spaces.
    https://yaml.org/spec/1.2/spec.html#id2775170
    Section 5.5:
    YAML recognizes two white space characters: space and tab.
    There is an example with both spaces and tabs used for indentation. It is important to make things complicated, whenever possible to increase confusion, no doubt.

  10. #20
    Join Date
    Sep 2019
    Beans
    28

    Re: most simple way to restart NetworkManager

    Quote Originally Posted by TheFu View Post
    Code:
    renderer:
    is required as part of the netplan.io config file.

    If NetworkManager is listed, then networkd won't be used and all the issues that NetworkManager has come to the system.
    But a simple netplan config file for static IPs removes the need for NetworkManager and all those issues:

    Here's an example from a 20.04 system:
    Code:
    $ more /etc/netplan/01-ens3-static.yaml 
    network:
      version: 2
      renderer: networkd
      ethernets:
         ens3:
           addresses:
              - 172.22.22.3/24
           dhcp4: false
           dhcp6: false
           gateway4: 172.22.22.1
           nameservers:
             addresses: [ 172.22.22.80, 172.22.22.81 ]
    I've colored the parts you should insert different values for in blue.

    After changing those parts, run these commands:
    Code:
    sudo netplan generate
    sudo netplan apply --debug
    That's it. No more network-manager problems.
    Thank you. I spent some time but I'm sorry it does not work. I can't spent more time on it now. Maybe I will return to it when it can save my time.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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