Howto disable networkmanager and systemd-resolved?

Hi everyone! I don’t want networkmanager and systemd-resolved to manage my network. I just want a custom script which use the ip command. But i found that i can not disable these two. everything i tried will be useless. So…what is the correct way to disable them?

Hi @wptskybzy, welcome to the Clear Linux* Forum!

Did you already try disabling the services via systemctl?

Disabling NetworkManager and systemd-resolved

  1. Open a terminal and run

    sudo -s
    

    then type your admin password to obtain admin privileges.

  2. Stop and disable NetworkManager with these commands:

    systemctl stop NetworkManager.service
    systemctl mask NetworkManager.service
    
  3. Stop and disable systemd-resolved with these commands:

    systemctl stop systemd-resolved.service
    systemctl mask systemd-resolved.service
    

Done, now you can close the terminal! :smile:

Re-enabling NetworkManager and systemd-resolved

If you want to reverse the changes you can follow the next steps:

  1. Open a terminal and run

    sudo -s
    

    then type your admin password to obtain admin privileges.

  2. Enable and start NetworkManager with these commands:

    systemctl unmask NetworkManager.service
    systemctl start  NetworkManager.service
    
  3. Enable and start systemd-resolved with these commands:

    systemctl unmask systemd-resolved.service
    systemctl start  systemd-resolved.service
    

Done, now you can close the terminal! :smile:

5 Likes

Thanks very much! This is indeed the right way to disable these services!

1 Like

You’re welcome @wptskybzy!

I would also suggest moving your question from General Discussion to Q&A and, if it works for you, to pick my answer as solution. In this way, it can be found more easily by anyone else who has the same problem.

You can do this by clicking the :pencil2: button near the post title :smile:

I’m a little bit curious, Why do you want to use script?

Are you setting static IP?

Setting a static IP with systemd-networkd is relatively simple. Please read the man pages for e.g. man systemd.network.

Sure, indeed i know. My dell server has 4 physical ethernet port,and for business reason,these four port must have different ip,mask,route and rule.I have create three additional table at rt_tables to handle this.And for history reason,i do have a .sh script to create network,which is running very well.