If you wish to obtain information about your server’s IP on a Linux machine you can use the ip command. This is a very handy and useful command suitable for all beginner users. In this article, we will show you the basic usage of the Linux ip command.
Display all network interfaces and their assigned IP addresses
ip a
Switching between IPv4 and IPv6
ip -4 a ip -6 a
Assign an IP address to an interface
ip a add IP dev INTERFACE ip a add 1.1.1.1 dev eth0
Delete an IP address from an interface
ip a del IP dev INTERFACE ip a del 1.1.1.1 dev eth0