Get the App
SLTechnology News&Howtos  ›  Servers  › 

Which is the command to delete the ip address in linux

Shulou Source: shulou.com Published: 2022-05-31 10:58:11 09月16日 Update

This article is about which command to delete the ip address in linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The command for linux to delete the ip address is "ip addr", which is used to view and manipulate the ip address; to delete the specified ip address, use the "ip addr del ip address dev interface" statement, and to clear all the ip of the specified network card, use the "ip addr flush dev interface" statement.

The operating environment of this tutorial: Red Hat Enterprise Linux 7.3 system, Dell G3 computer.

The command for linux to delete the ip address is "ip addr".

The abbreviation of "ip addr" is ip a. You can check the ip, mac and so on of the network card.

There are two ways to delete an ip address:

1. Delete the specified ip

Ip addr del ip address dev interface

2. Clear all ip of the specified network card

Ip addr flush dev interface

Extended knowledge: other uses of "ip addr"

1. Use "ip addr" to view the information of the specified network card.

Ip addr show device

For example, check the information of the network card interface, that is, ip addr show eth0.

two。 Add ip

Ip addr add ip/netmask dev interface

For example, add a 172.25.21.1ax 24 address to eth0.

Ip addr add 172.25.21.1/24 dev eth0

3. Giving an alias to the Nic is equivalent to binding an extra ip to the Nic.

Usage: for example, add an alias to the network card eth0

Ip addr add 172.25.21.1/32 dev eth0 label eth0:1

4. Delete alias

Ip addr del ip/netmask dev eth0, thank you for your reading! This is the end of the article on "which is the order to delete the ip address in linux?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Address network card interface command alias information content more knowledge article sentence good practical that is tutorial article way environment computer read it Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno NVidia Docker macOS Shulou Technology