Configure network services to start automatically at boot

8.3 Configure network services to start automatically at boot

πŸ“˜Red Hat Certified System Administrator (RHCSA – EX200)


In Red Hat Enterprise Linux (RHEL), when your server boots up, not all services start automatically by default. A network service like NetworkManager or a specific network interface might need to start on boot so your system can connect to networks without manual intervention. This is crucial in servers, data centers, and enterprise IT environments where human intervention isn’t always possible.

Here’s everything you need to know for the exam.


1. Understanding Services and Targets

  • Services are programs that run in the background, like networking (NetworkManager, sshd, firewalld).
  • Systemd is the init system in RHEL that controls services and boot targets.
  • Targets are like β€œmodes” for your system. For example, multi-user.target is normal server mode without a graphical interface.

In the exam, you may need to ensure a network service starts automatically after boot.


2. Checking the Status of Network Services

Before configuring a service, you need to check its current status:

sudo systemctl status NetworkManager

You will see something like:

  • Active: shows whether it is currently running
  • Enabled: shows whether it starts on boot

3. Enabling a Network Service

To make a network service start automatically at boot, use the enable command:

sudo systemctl enable NetworkManager
  • enable tells systemd: β€œStart this service at boot.”
  • disable tells systemd: β€œDo not start this service at boot.”

Example:
If you want sshd (SSH service) to start automatically:

sudo systemctl enable sshd

4. Disabling a Network Service from Boot

Sometimes you might want to prevent a service from starting at boot:

sudo systemctl disable NetworkManager
  • After running this, the service won’t start automatically, but you can still start it manually with:
sudo systemctl start NetworkManager

5. Checking Which Services Are Enabled at Boot

To see which services are set to start at boot:

systemctl list-unit-files --type=service | grep enabled
  • This shows all enabled services.
  • You can also filter for network-related services:
systemctl list-unit-files --type=service | grep Network

6. Starting and Stopping Services Immediately

  • start β†’ starts the service now, but does not change boot behavior
  • stop β†’ stops the service now, but does not affect boot

Example:

sudo systemctl start NetworkManager
sudo systemctl stop NetworkManager

Remember: For exam purposes, enabling is what affects boot behavior.


7. Combining Enable and Start

If you want a service to start immediately AND at boot, you can use:

sudo systemctl enable --now NetworkManager
  • --now option starts it right away and enables it for future boots.
  • Very useful in exams to save time.

8. Exam Notes – Network Services Specifics

  • Common network services you may need to manage:
    • NetworkManager – manages network interfaces
    • sshd – allows remote login over SSH
    • firewalld – firewall service
  • For RHEL 8+, NetworkManager is usually the default network service.
  • Old network.service (from RHEL 7) is mostly replaced by NetworkManager in RHEL 8+.
  • Make sure the service is active and enabled for the system to function properly after reboot.

9. Quick Commands Summary

TaskCommand
Check statussystemctl status NetworkManager
Enable at bootsystemctl enable NetworkManager
Disable at bootsystemctl disable NetworkManager
Start immediatelysystemctl start NetworkManager
Stop immediatelysystemctl stop NetworkManager
Enable and start nowsystemctl enable --now NetworkManager
List all enabled services`systemctl list-unit-files –type=service

10. Practical IT Scenario (Exam-Focused)

  • Server setup: You install a new server that will act as a web server. After reboot, the network must be up automatically so other servers can reach it. You run:
sudo systemctl enable --now NetworkManager
  • Remote access: You want SSH to always be available after a reboot so administrators can log in remotely:
sudo systemctl enable --now sshd
  • Firewall management: Firewall rules must be active on boot:
sudo systemctl enable --now firewalld

These are real-world tasks that match the RHCSA exam objectives.


βœ… Key Points for RHCSA Exam:

  1. Know the difference between start/stop (immediate) and enable/disable (boot-time behavior).
  2. Use systemctl commands for service management.
  3. Network services like NetworkManager and sshd must often start automatically.
  4. --now saves time by starting immediately and enabling at boot.
  5. Be comfortable checking service status and listing enabled services.

This covers everything you need for RHCSA 8.3 – configuring network services to start at boot in a clear, exam-focused way.

Buy Me a Coffee