Ip (Linux Cli Tool)

Common Commands

The following examples will use the following:
IPv4: Subnet:
Usable Host IPv4 Range: -

IPv6 0:0:0:0:0:::0/64
Full IP Address: 0000:0000:0000:0000:0000:0000:0000:0000
Total IP Addresses: 18,446,744,073,709,551,616
Network: 0000:0000:0000:0000::
IP Range: 0000:0000:0000:0000:0000:0000:0000:0000 - 0000:0000:0000:0000:ffff:ffff:ffff:ffff

Device Name: eth0

Check route to see how networking is connecting

ip route get

Show all network interfaces (ethernet/wifi)

ip a

Show running interfaces

ip link ls up

Flush (delete) the IP address from the interface

ip -s -s a f to

Set device to up (turn on)

ip link set dev eth0 up

Set device to down (turn off)

ip link set dev eth0 down

assign ip to device/interface

ip a add dev eth0

add route to ip

ip route add via