linux重新启动网络_如何在Linux上启动,停止,重新启动网络?

linux重新启动网络

linux重新启动网络

I have changed my network configuration and want to restart to make changes effective. Or there are some problems with my network and I think restarting it will solve my problems. Here we will look at how to restart networking service in various network distributions like Ubuntu, Debian, Fedora, CentOS.

我已经更改了网络配置,并希望重新启动以使更改生效。 或者我的网络存在一些问题,我认为重新启动它可以解决我的问题。 在这里,我们将研究如何在各种网络发行版(如Ubuntu,Debian,Fedora,CentOS)中重新启动网络服务。

获取网络服务状态 (Get Status Of Network Service)

We will get status of network with the following command.

我们将使用以下命令获取网络状态。

Debian,Ubuntu,Kali (Debian, Ubuntu, Kali)

For deb based distributions we will use init.d  system. We will provide status option to the networking script.

对于基于deb的发行版,我们将使用init.d系统。 我们将为networking脚本提供status选项。

$ /etc/init.d/networking status
Get Status Of Network
Get Status Of Network
获取网络状态

As we cab see that networking service is active from given date. Its PID is 897 .

正如我们看到的那样,网络服务从给定日期开始处于活动状态。 其PID为897。

CedOS的Fedora (Fedora, CentOS)

For distributions like CentOS, RedHat, Fedora we will use systemctl command. We will provide the options status and network which is the networking service.

对于CentOS,RedHat,Fedora等发行版,我们将使用systemctl命令。 我们将提供选件statusnetwork ,这是网络服务。

$ systemctl status network
Get Status Of Network
Get Status Of Network
获取网络状态

停止网络服务(Stop Network Service)

We can stop network like below. Bu keep in mind for remote connection it can be create problems with ssh

我们可以像下面那样停止网络。 Bu记住要进行远程连接,这可能会给ssh造成问题

Ubuntu,Debian,Kali(Ubuntu, Debian, Kali)

We will use stop option with networking command in order to stop network services in Ubuntu, Debian, Kali, Mint etc.

我们将在networking命令中使用stop选项,以便在Ubuntu,Debian,Kali,Mint等中停止网络服务。

$ sudo /etc/init.d/networking stop
Stop Network Service
Stop Network Service
停止网络服务

CedOS的Fedora(Fedora,CentOS)

We will use systemctl again with stop option which will stop network services. We also require root privileges that will beget with sudo command.

我们将再次使用systemctlstop选项,该选项将停止网络服务。 我们还需要通过sudo命令获得的root特权。

$ sudo systemctl stop network

启动网络 (Start Network)

We can start network like below.

我们可以像下面这样启动网络。

Ubuntu,Debian,Kali (Ubuntu, Debian, Kali)

We will provide start option in order to start network services in deb based distributions.

我们将提供start选项,以便在基于deb的发行版中启动网络服务。

$ sudo /etc/init.d/networking start

CedOS的Fedora (Fedora,CentOS)

We will use start network option in order to start network services in rpm based distributions.

我们将使用start network选项来启动基于rpm的发行版中的网络服务。

$ sudo systemctl start network

重新启动网络 (Restart Network)

Now we can restart our network or network services.

现在,我们可以重新启动网络或网络服务。

LEARN MORE  How To Discover Network Hosts With Nmap?
了解更多如何使用Nmap发现网络主机?

Ubuntu,Debian,Kali (Ubuntu, Debian, Kali)

$ /etc/init.d/networking restart

CedOS的Fedora (Fedora,CentOS)

$ systemctl restart network
How To Start, Stop, Restart Networking On Linux Infografic
How To Start, Stop, Restart Networking On Linux Infografic
如何在Linux Infografic上启动,停止,重新启动网络

翻译自: https://www.poftut.com/start-stop-restart-networking-linux/

linux重新启动网络

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值