Home ip cheatsheet
Post
Cancel

ip cheatsheet

I’m an old school guy. I learned to use ifconfigin the old times and, with ifconfig, I continue until today.

But, for a while, there is a new contender ip. ip is a network tool called to replace ipconfig, is installed on all modern gnu/linux distributions, and, it’s more powerful than ipconfig.

So, it’s time to learn ip, and, what better way to do it than by keeping a cheeatsheet with the most used commands?

Syntax

1
ip [OPTIONS] OBJECT {COMMAND}  

Display network interfaces information

1
ip addr [show]
1
ip link show 

Display IPv4 addresses

1
ip -4 addr

Display IPv6 addresses

1
ip -6 addr

Display information from a single network interface

1
ip addr show dev eth0
1
ip link show eth0 

Bring down a network interface

1
ip link set eth0 up

Bring down a network interface

1
ip link set eth0 down

Assing an IP address to a network interface

1
sudo ip address add 10.0.0.1/24 dev eth0

Deleting an IP address

1
sudo ip address del 10.0.0.1/24 dev eth0

Enjoy! ;)

This post is licensed under CC BY 4.0 by the author.