如何在Linux中重启网络 Linux systemctl restart network

CentOS/RHEL7 /8 /Fedora: sudo systemctl restart NetworkManager Ubuntu/Debian:应用 sudo netplan 系统不使用NetworkManager? systemctl status 网络
检查连接: ping -c4 www.example.com

Linux 启动、关闭、重启网络服务的两种方式

不推荐直接使用 service 和 init.d 命令。

CentOS 6 系统,使用Services Network Boot启动网络服务。
在 Debian 8 系统上,使用 /etc/init.d/network start 启动网络服务。

CentOS 6 系统,使用Service Network Shutdown禁用网络服务。
在 Debian 8 系统上,使用 /etc/init.d/network stop 停止网络服务。
在CentOS 6 系统上,使用Service Network Restart重新启动网络服务。
对于 Debian 8 系统,使用 /etc/init.d/network restart 重新启动网络服务。

现在每个人都使用systemd。
在 CentOS 7 或更高版本上,使用 systemctl start network 启动网络服务。
对于 Debian 9 或更高版本,使用 systemctl startnetworking 启动网络服务。
在 CentOS 7 或更高版本上,使用 systemctl stop network 禁用网络服务。
对于 Debian 9 或更高版本,使用 systemctl stopnetworking 禁用网络服务。
在 CentOS 7 或更高版本上,使用 systemctl restart network 重新启动网络服务。
对于 Debian 9 或更高版本,使用 systemctl restartnetworking 重新启动网络服务。

自己掂量一下。

linux服务器network起不来怎么处理

启动失败?请遵循以下五个步骤。

1 .查看状态,是不是服务没有启动?请重新启动! 2 、重启还是不行?检查配置文件。
格式正确吗? 3 .配置正确但还是失败?检查您的依赖项或重新安装。
4 . 所有配置依赖项均已考虑,但硬件和网络呢? 5 . 你的硬件没问题,但系统还是不工作?重新安装前请备份您的系统。

首先检查您的配置,然后检查您的依赖项,最后检查您的硬件和网络。
除非别无选择,否则不要急于重新安装系统。