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

青灯夜游
Release: 2022-03-24 14:29:15
Original
14887 people have browsed it

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 接口
Copy after login

2. Clear all ips of the specified network card

ip addr flush dev 接口
Copy after login

Extended knowledge: other uses of "ip addr"

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

ip addr show device
Copy after login

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 接口
Copy after login

For example Add a 172.25.21.1/24 address to eth0

ip addr add 172.25.21.1/24 dev eth0
Copy after login

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
Copy after login

4. Delete the alias

 ip addr del ip/netmask dev eth0
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!