IP command


Show / manipulate routing, devices, policy routing and tunnels.

The IP command englobes a lot of functionalities from now obsolete network managing commands. Some of them are:

Obsolete commands Equivalent commands
arp ip n (ip neighbor)
ifconfig ip a (ip addr), ip link, ip -s (ip -stats)
netstat ss, ip route (for netstat -r), ip -s link (for netstat -i), ip maddr (for netstat -g)
route ip r (ip route)

iproute2 ip
Substitutes commands like ifconfig, route, and arp.

ip [Options] Object [Command [Arguments]]

Objects:

Activate and deactivate a network device: ip link set enp0s3 up/down

Activate and deactivate ARP: ip link set dev enp0s3 arp on/off

See IP addresses: ip addr show
Pasted image 20240819185307.png

ip -c a
Pasted image 20240819185400.png

Add IP addresses: ip addr add 192.168.1.4/24 dev enp-s3

See routing table: ip route add 10.10.50.0/24 via 192.168.1.1 dev enp0s3

Add route: ip route add 10.10.50.0/24 via 192.168.1.1 dev enp0s3

Delete route: ip route del 10.10.50.0/24

Configure gateway: ip route add default via 192.168.1.1