Unix HowTo: Start / Stop / Restart Network Service Command

See all UNIX related articles/faq
How do I start, stop, or restart networking service under HP-UX, OpenBSD, AIX and other Unix like operating systems?

You can use the following commands as per your UNIX operating systems to start, stop, or restart the network sevice.
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Linux or Unix terminal
Category Processes Management
OS compatibility AIX BSD HP-UX Linux Unix
Est. reading time 3 minutes
Advertisement

HP-UX Unix start / stop / restart networking service

Open the terminal app and type the following commands:
# /sbin/init.d/net stop
# /sbin/init.d/net start
# /sbin/init.d/hostname start

IBM AIX Unix start / stop / restart networking service

Simply type the following command to make changes to tcp/ip
# smitty mktcpip
Start network service:
# startsrc
Stop network service:
# startsrc

OpenBSD start / stop / restart networking service

See this faq for more information on how to restart networking service:
## FreeBSD 4.x/5.x and older ##
# sh /etc/netstart pnc0
# /etc/rc.d/netif restart && /etc/rc.d/routing restart
## Recommended commands on the latest version of FreeBSD ##
# service netif restart && service routing restart

FreeBSD start / stop / restart networking service

See this post for more information on how to restart networking service:
# /etc/rc.d/netif restart

Sun/Oracle Solaris Unix start / stop / restart networking service

# svcadm restart physical
## OR ##
# svcadm restart network/physical

Linux: CentOS / RHEL / Red Hat / Fedora start / stop / restart networking service

See this faq for more information:
# service network stop
# service network start
# service network restart

Replace the service command with systemctl command when using the latest version of RHEL and friends. For example:
$ sudo systemctl start NetworkManager.service
$ sudo systemctl restart NetworkManager.service
$ sudo systemctl stop NetworkManager.service
$ sudo systemctl status NetworkManager.service

Linux: Debian / Ubuntu server start / stop / restart networking service

See faq for more information:
# service networking stop
# service networking start
# service networking restart

Again, on the latest version of Ubuntu or Debian Linux and friends use the systemctl command as follows:
$ sudo systemctl start NetworkManager.service
$ sudo systemctl restart NetworkManager.service
$ sudo systemctl stop NetworkManager.service
$ sudo systemctl status NetworkManager.service

Sample outputs:

 NetworkManager.service - Network Manager
     Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendo>
     Active: active (running) since Thu 2022-05-19 14:02:44 IST; 10h ago
       Docs: man:NetworkManager(8)
   Main PID: 1184 (NetworkManager)
      Tasks: 3 (limit: 37929)
     Memory: 12.4M
     CGroup: /system.slice/NetworkManager.service
             └─1184 /usr/sbin/NetworkManager --no-daemon

May 20 00:09:19 wks01 NetworkManager[1184]:   [1652985559.3110] dhcp4 (en>
May 20 00:09:19 wks01 NetworkManager[1184]:   [1652985559.3111] dhcp4 (en>
May 20 00:09:19 wks01 NetworkManager[1184]:   [1652985559.3111] dhcp4 (en>
May 20 00:09:19 wks01 NetworkManager[1184]:   [1652985559.3111] dhcp4 (en>
May 20 00:09:19 wks01 NetworkManager[1184]:   [1652985559.3111] dhcp4 (en>
May 20 00:09:19 wks01 NetworkManager[1184]:   [1652985559.3111] dhcp4 (en>
May 20 00:09:19 wks01 NetworkManager[1184]:   [1652985559.3112] dhcp4 (en>
May 20 00:09:19 wks01 NetworkManager[1184]:   [1652985559.3112] dhcp4 (en>
May 20 00:09:19 wks01 NetworkManager[1184]:   [1652985559.3112] dhcp4 (en>
May 20 00:09:19 wks01 NetworkManager[1184]:   [1652985559.3112] dhcp4 (en>

Summing up

For more info read the following manual pages using the man command or help command:
$ man systemctl
$ man service
$ man smitty
$ man svcadm

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

7 comments… add one
  • Aprigio Simoes Aug 14, 2012 @ 17:07

    not, error in text.

    for HP-UX is /sbin/init.d/net and not /etc/init.d/net

  • Frank Aug 15, 2012 @ 21:48

    For Debian, this method throws an error.

  • Ajith Aug 26, 2012 @ 17:40

    For AIX, to stop the service “stopsrc”. for refresh the services “refresh

  • Fasial Ali May 16, 2013 @ 12:52

    Realy very help full these command of me Ubuntu machine
    Regards

  • waseel Nov 23, 2016 @ 6:08

    What about SCO UNIX how I can stop and start the services such as ssh and telnet.
    and how to enable telnet services

    thanks

  • Diego Mar 2, 2017 @ 19:42

    Awesome tips, thank you!

  • Jeremy May 18, 2022 @ 17:51

    This was helpful. I was looking for something related to AIX and HP-UX.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.