Home >Operation and Maintenance >Linux Operation and Maintenance >What is the command to delete an IP address in Linux?

What is the command to delete an IP address in Linux?

青灯夜游
青灯夜游Original
2022-03-24 14:29:0515143browse

The Linux command to delete an IP address is "ip addr". This command is used to view and operate the IP address. If you want to delete the specified IP address, you can use the "ip addr del ip address dev interface" statement to clear the specified network card. All IPs can use the "ip addr flush dev interface" statement.

What is the command to delete an IP address in Linux?

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

The Linux command to delete an IP address is "ip addr".

The abbreviation of "ip addr" is ip a, you can check the ip, mac, etc. of the network card.

There are two ways to delete the ip address:

1. Delete the specified ip

ip addr del ip地址 dev 接口

2. Clear all ips of the specified network card

ip addr flush dev 接口

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, to view the information of the network card interface, it is ip addr show eth0

2. Add ip

ip addr add ip/netmask dev 接口

For example Add a 172.25.21.1/24 address to eth0

ip addr add 172.25.21.1/24 dev eth0

3. Give the network card an alias. Giving an alias is equivalent to binding an extra IP to the network card

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 the alias

 ip addr del ip/netmask dev eth0

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of What is the command to delete an IP address 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