How To Disable NetworkManager on Rocky Linux 10
Rocky Linux administrators often encounter scenarios where disabling NetworkManager becomes essential for optimal system performance and network control. Whether managing servers, implementing legacy network configurations, or transitioning to alternative network management solutions, understanding the proper methods to disable NetworkManager is crucial for system stability and performance.
This comprehensive guide provides detailed instructions for safely disabling NetworkManager on Rocky Linux 10 systems. You’ll discover multiple approaches, troubleshooting techniques, and best practices to ensure seamless network management transitions while maintaining system reliability and security.
Understanding NetworkManager in Rocky Linux 10
NetworkManager serves as the primary network configuration daemon in Rocky Linux 10, automatically managing network interfaces and connections. This service provides dynamic network configuration capabilities, making it particularly valuable for desktop environments and systems requiring frequent network changes.
The service integrates deeply with the GNOME desktop environment and other graphical interfaces. NetworkManager automatically detects network hardware, manages wireless connections, and handles VPN configurations without manual intervention. However, this automation can sometimes conflict with static network configurations or specialized server requirements.
In Rocky Linux 10, NetworkManager operates differently from traditional network-scripts approaches. It uses D-Bus for communication and maintains configuration files in multiple locations, including /etc/NetworkManager/
and /etc/sysconfig/network-scripts/
. Understanding these differences is essential before attempting to disable the service.
Server environments often benefit from disabling NetworkManager in favor of more predictable network management solutions. Static network configurations, custom routing requirements, and legacy application compatibility frequently necessitate alternative approaches to network management.
Prerequisites and System Requirements
Successfully disabling NetworkManager requires careful preparation and system access verification. Root or sudo privileges are mandatory for modifying system services and network configurations. Without proper administrative access, the transition process will fail, potentially leaving the system in an unstable networking state.
System backup procedures should be implemented before making any network configuration changes. Document current network settings, including IP addresses, gateway configurations, DNS servers, and routing tables. This documentation proves invaluable during troubleshooting or rollback scenarios.
Verify network interface names and configurations using commands like ip addr show
and nmcli device status
. Understanding the current networking setup prevents configuration errors during the transition process. Record active connections, interface types, and any custom network settings that require preservation.
Remote system access considerations are critical when disabling NetworkManager. Ensure console access or alternative connection methods exist before proceeding. Network service transitions can temporarily interrupt connectivity, making remote recovery impossible without proper planning.
Alternative Network Management Solutions
Rocky Linux 10 offers several alternatives to NetworkManager, each suited for different use cases and system requirements. Understanding these options helps determine the most appropriate replacement for specific environments and workloads.
Systemd-networkd represents a modern, lightweight alternative focused on server environments. This solution provides robust network configuration capabilities without the desktop-oriented features of NetworkManager. Systemd-networkd excels in containerized environments, cloud deployments, and systems requiring minimal resource overhead.
Traditional network-scripts offer compatibility with legacy RedHat-style network configurations. This approach maintains familiar configuration file formats and procedures used in earlier RHEL and CentOS versions. Network-scripts work well for organizations with established configuration management practices and existing automation scripts.
Performance comparisons reveal significant differences between these solutions. Systemd-networkd typically consumes fewer system resources and provides faster boot times. Network-scripts offer predictable behavior but may lack some modern features like automatic configuration discovery and dynamic updates.
Security implications vary between network management approaches. Systemd-networkd integrates with systemd’s security features, including sandboxing and privilege separation. Network-scripts provide simpler configurations that are easier to audit but may lack advanced security features found in modern alternatives.
Method 1: Disabling NetworkManager with systemd-networkd
Installing and Configuring systemd-networkd
Systemd-networkd installation begins with enabling the service and creating appropriate configuration files. Rocky Linux 10 includes systemd-networkd by default, but activation requires manual intervention to prevent conflicts with NetworkManager.
Enable systemd-networkd and systemd-resolved services using systemctl commands:
sudo systemctl enable systemd-networkd
sudo systemctl enable systemd-resolved
Create network configuration files in /etc/systemd/network/
directory. Configuration files use descriptive naming conventions like 10-eth0.network
for interface-specific settings. These files define network parameters including IP addresses, routing, and DNS configurations.
Sample DHCP configuration for eth0 interface:
[Match]
Name=eth0
[Network]
DHCP=yes
Static IP configuration requires additional parameters:
[Match]
Name=eth0
[Network]
Address=192.168.1.100/24
Gateway=192.168.1.1
DNS=8.8.8.8
DNS=8.8.4.4
Configure systemd-resolved for DNS resolution by creating symbolic links and adjusting resolver settings. This step ensures proper domain name resolution after NetworkManager removal.
Transitioning from NetworkManager to systemd-networkd
The transition process requires careful service management to prevent network interruption. Stop NetworkManager service before enabling systemd-networkd to avoid conflicts between network management systems.
Execute the following command sequence for service transition:
sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sudo systemctl mask NetworkManager
Start systemd-networkd and systemd-resolved services:
sudo systemctl start systemd-networkd
sudo systemctl start systemd-resolved
Create symbolic link for /etc/resolv.conf
compatibility:
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
Verify network connectivity and DNS resolution functionality using ping and nslookup commands. Test both internal and external network access to confirm successful transition. Monitor system logs for any error messages or configuration issues.
Method 2: Using Legacy network-scripts Package
Installing network-scripts Package
Legacy network-scripts installation provides compatibility with traditional RedHat-style network management. This package may require installation on Rocky Linux 10 systems as it’s not included by default in minimal installations.
Install network-scripts package using dnf package manager:
sudo dnf install network-scripts
The network-scripts package provides the network
service and supporting utilities for traditional interface configuration management. This approach maintains compatibility with existing configuration files and management procedures used in previous RHEL versions.
Verify successful installation by checking for the presence of network service files and supporting scripts. The installation creates necessary systemd service files and maintains backward compatibility with existing network configurations.
Configuring Interface Files
Interface configuration files reside in /etc/sysconfig/network-scripts/
directory with names following the ifcfg-*
pattern. These files contain network parameters specific to each interface, including IP addresses, subnet masks, and gateway configurations.
Modify existing interface configuration files to disable NetworkManager control by adding the NM_CONTROLLED="no"
parameter. This setting prevents NetworkManager from managing specific interfaces while allowing network-scripts to maintain control.
Sample ifcfg-eth0 configuration for static IP:
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
DNS2=8.8.4.4
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
Create backup copies of all configuration files before making modifications. This precaution allows quick recovery if configuration errors occur during the transition process.
Service Management Transition
Service transition involves stopping NetworkManager and enabling the network service for boot-time initialization. This process requires careful timing to minimize network disruption and ensure proper service startup ordering.
Stop and disable NetworkManager service:
sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sudo systemctl mask NetworkManager
Enable and start the network service:
sudo systemctl enable network
sudo systemctl start network
Restart network service to apply configuration changes:
sudo systemctl restart network
Verify service status and network connectivity after transition completion. Monitor system logs for error messages and validate that all network interfaces are functioning correctly.
Step-by-Step Implementation Guide
Pre-implementation Checks
Document current network configuration using comprehensive system analysis tools. Record IP addresses, interface names, routing tables, and DNS settings for reference during transition and troubleshooting procedures.
Identify active network interfaces using multiple commands:
ip addr show
nmcli device status
cat /proc/net/dev
Create configuration backups in a dedicated directory:
sudo mkdir -p /root/network-backup-$(date +%Y%m%d)
sudo cp -r /etc/NetworkManager/ /root/network-backup-$(date +%Y%m%d)/
sudo cp -r /etc/sysconfig/network-scripts/ /root/network-backup-$(date +%Y%m%d)/
Test network connectivity to establish baseline performance metrics. Document response times, available bandwidth, and any connectivity issues that exist before implementing changes.
Detailed Implementation Process
The implementation process varies depending on the chosen alternative network management solution. Both systemd-networkd and network-scripts approaches require specific command sequences and configuration steps.
For systemd-networkd implementation:
- Create network configuration files in
/etc/systemd/network/
- Enable systemd-networkd and systemd-resolved services
- Stop and disable NetworkManager
- Start systemd networking services
- Configure DNS resolution symbolic links
- Verify network functionality
For network-scripts implementation:
- Install network-scripts package if not present
- Modify interface configuration files with NM_CONTROLLED=no
- Stop and disable NetworkManager service
- Enable and start network service
- Restart network service to apply changes
- Verify interface status and connectivity
Monitor system logs during implementation using journalctl commands:
sudo journalctl -f -u NetworkManager
sudo journalctl -f -u systemd-networkd
sudo journalctl -f -u network
Post-implementation Verification
Comprehensive testing ensures successful NetworkManager disabling and proper alternative service functionality. Verify network connectivity, DNS resolution, and service status through multiple validation methods.
Test network connectivity using various protocols and destinations:
ping -c 4 google.com
ping -c 4 8.8.8.8
nslookup google.com
dig google.com
Verify service status and startup configuration:
sudo systemctl status systemd-networkd
sudo systemctl status network
sudo systemctl is-enabled systemd-networkd
sudo systemctl is-enabled network
Check interface configuration and routing tables:
ip route show
ip addr show
cat /etc/resolv.conf
Document any issues discovered during testing and implement necessary corrections. Successful verification confirms proper NetworkManager disabling without compromising network functionality.
Configuration Management and Best Practices
Interface Configuration Best Practices
Network interface configuration requires consistent naming conventions and documentation standards to maintain system reliability and troubleshooting efficiency. Establish clear procedures for configuration file management, version control, and change tracking.
Use descriptive naming conventions for configuration files that reflect interface purpose and network segment. For systemd-networkd, employ numbered prefixes to control processing order: 10-management.network
, 20-storage.network
, etc.
Implement proper file permissions and ownership for network configuration files. Restrict access to root user only to prevent unauthorized modifications that could compromise network security or stability:
sudo chmod 600 /etc/systemd/network/*.network
sudo chown root:root /etc/systemd/network/*.network
Document configuration changes with inline comments and external documentation. Maintain change logs that record modification dates, reasons for changes, and responsible administrators. This documentation proves invaluable during troubleshooting and audit processes.
Version control systems like Git can track configuration changes over time. Initialize repositories in configuration directories to maintain historical records and enable quick rollback capabilities when problems arise.
Monitoring and Maintenance
Regular monitoring of network service status prevents issues from escalating into system failures. Implement automated monitoring solutions that track service availability, interface status, and connectivity performance metrics.
Monitor system logs regularly for network-related messages and errors:
sudo journalctl -u systemd-networkd --since "1 hour ago"
sudo journalctl -u network --since "1 hour ago"
sudo grep -i network /var/log/messages
Establish performance baselines for network connectivity, including latency, throughput, and packet loss measurements. Regular performance monitoring helps identify degradation trends before they impact system operations.
Create monitoring scripts that automatically check network service status and alert administrators to failures:
#!/bin/bash
if ! systemctl is-active systemd-networkd >/dev/null 2>&1; then
echo "systemd-networkd service is not running" | mail -s "Network Service Alert" admin@example.com
fi
Schedule regular configuration audits to verify that network settings match documented standards and haven’t been inadvertently modified. Automated configuration management tools can help maintain consistency across multiple systems.
Troubleshooting Common Issues
Service Conflicts and Resolution
Service conflicts between NetworkManager and alternative network management solutions can cause connectivity failures and system instability. Understanding common conflict scenarios and resolution procedures ensures quick recovery from network issues.
DNS resolution problems frequently occur during service transitions when multiple network managers compete for resolver configuration control. Symptoms include failed hostname lookups and application connection timeouts despite working IP connectivity.
Resolve DNS conflicts by ensuring proper /etc/resolv.conf
configuration:
sudo ls -la /etc/resolv.conf
sudo systemctl status systemd-resolved
sudo networkctl status
Service startup ordering issues can prevent proper network initialization during boot. Systemd dependencies and service ordering affect when network services start relative to other system components.
Configure proper service dependencies in systemd unit files when necessary. Create drop-in configuration files to modify service behavior without editing original service files:
sudo mkdir -p /etc/systemd/system/systemd-networkd.service.d/
sudo cat > /etc/systemd/system/systemd-networkd.service.d/override.conf << EOF
[Unit]
After=local-fs.target
Wants=local-fs.target
EOF
Interface detection failures may occur when hardware drivers haven’t loaded before network services attempt interface configuration. This timing issue particularly affects systems with multiple network interfaces or specialized hardware.
Network Connectivity Problems
Connectivity issues after disabling NetworkManager typically stem from incomplete configuration migration or service startup failures. Systematic troubleshooting approaches help identify root causes and implement appropriate solutions.
Interface status verification reveals whether network interfaces are properly configured and active:
ip link show
ip addr show
networkctl list
networkctl status eth0
DHCP client functionality problems manifest as interfaces without IP addresses or incorrect network configurations. Verify DHCP client services are running and properly configured for dynamic address assignment.
Static IP configuration errors include incorrect subnet masks, gateway addresses, or DNS settings. Compare current configuration with documented network requirements and validate against working reference systems.
Routing table problems prevent communication between network segments or internet access despite local connectivity. Examine routing tables and default gateway configurations:
ip route show
ip route show default
netstat -rn
Firewall interactions can block network traffic even when underlying network services function correctly. Verify firewall rules don’t inadvertently block necessary network protocols or services.
Security and Performance Considerations
Disabling NetworkManager affects system security posture and network performance characteristics. Understanding these implications helps administrators make informed decisions and implement appropriate compensating controls.
Security implications include changes in network configuration management, access control, and attack surface exposure. NetworkManager provides certain security features like automatic VPN management and secure wireless authentication that may require alternative implementations.
Performance benefits in server environments typically include reduced memory usage, faster boot times, and more predictable network behavior. Systemd-networkd particularly excels in containerized environments and cloud deployments where resource efficiency matters.
Resource usage comparisons demonstrate significant differences between network management approaches. NetworkManager consumes more system resources due to its comprehensive feature set and desktop-oriented functionality.
Benchmark network performance before and after NetworkManager disabling to quantify performance improvements:
iperf3 -c target_server -t 60
ping -c 100 target_host
traceroute target_host
Network security best practices without NetworkManager include manual VPN configuration, static wireless settings, and explicit firewall rule management. Implement appropriate security controls to maintain network protection levels.
Firewall integration considerations vary between network management solutions. Ensure firewall rules remain effective after service transitions and update automation scripts that depend on NetworkManager integration.
Congratulations! You have successfully disabled NetworkManager. Thanks for using this tutorial to turn off the NetworkManager on your Rocky Linux 10 system. For additional help or useful information, we recommend you check the official AlmaLinux website.