Home  >  Article  >  System Tutorial  >  What is the command to restart the network card in Linux?

What is the command to restart the network card in Linux?

下次还敢
下次还敢Original
2024-04-11 21:09:14707browse

You can restart the network card in the Linux system through the following command: shut down the network card: sudo ifdown start the network card: sudo ifup <network card name>

What is the command to restart the network card in Linux?

Linux command to restart the network card

In Linux system, you can restart the network card through the following command:

<code class="shell">sudo ifdown <网卡名称> && sudo ifup <网卡名称></code>

Among them:

  • <Network Card Name> Replace with the name of the network card to be restarted, such as eth0.

Detailed explanation of steps:

  1. Close the network card: ifdown <Network card name> Command The specified network card will be shut down.
  2. Start the network card: ifup <network card name> The command will restart the specified network card.

Example:

The following command will restart the network card eth0:

<code class="shell">sudo ifdown eth0 && sudo ifup eth0</code>

Note:

  • Executing this command requires root privileges, so please use sudo.
  • If the network card has been configured to start automatically, the network card will also start automatically after restarting the system.
  • You can also use the service networking restart command to restart all network services, including the network card.

The above is the detailed content of What is the command to restart the network card in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn