Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 1.6 KB

Ex-6.md

File metadata and controls

66 lines (43 loc) · 1.6 KB

To Configure Networking Services to Start or Stop Automatically using command line

Procedure for macOS

  1. Open the Terminal application.

  2. To list all the network services, type the following command:

networksetup -listallnetworkservices
  1. To turn off a network service, type the following command:
networksetup -setnetworkserviceenabled Wi-Fi off
  1. To turn on a network service, type the following command:
networksetup -setnetworkserviceenabled Wi-Fi on
  1. To automatically turn on a network service when the computer starts up, type the following command:
sudo networksetup -setairportpower en0 on
  1. To automatically turn off a network service when the computer starts up, type the following command:
sudo networksetup -setairportpower en0 off

Procedure for Linux

  1. Open a terminal or command prompt on the Linux/Unix system.
  2. Identify the networking service to be configured, such as the NetworkManager or systemd- networkd service.
  3. Check the current status of the networking service using the command
systemctl status <service-name>
  1. If the service is not enabled to start at boot, enable it using the command
systemctl enable <service-name>
  1. If the service is currently running and should be stopped at boot, disable it using the command
systemctl disable <service-name>
  1. Restart the system to confirm that the service starts or stops automatically during boot.
  2. Verify that the service is running or stopped using the command
systemctl status <service-name>