How do you restart a single network card in Linux?
In Linux, you can restart a single network card using the following command:
- Firstly, use the ifconfig command or ip command to view all currently available network cards and their corresponding interface names (such as: eth0, eth1, enp0s3, etc.).
- Next, restart the specified network card using the following command, taking eth0 as an example:
- Disable and then enable the eth0 network interface using sudo commands.
- Alternatively, you can use the following command:
- Turn off and then turn on the Ethernet interface eth0 using the following command.
- The commands ifdown and ifup are used to enable and disable network cards with the ifconfig method, while the command ip link set is used to enable and disable network cards with the ip method.
- If you need to restart other network cards, simply replace the network interface name in the command with the corresponding interface name.
Please ensure you have root privileges or are running these commands as an administrator before executing them.