This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!
ip
¶
ip
is a program used to show / manipulate routing, network devices, interfaces and tunnels.
Reference(s)
curl cheat.sh/ip
Table of contents¶
Install¶
TODO
Config¶
TODO
Use¶
WiP
-
Display all interfaces with addresses:
-
Take down / up the wireless adapter:
-
Set a static IP and netmask:
-
Remove a IP from an interface:
-
Remove all IPs from an interface:
-
Display all routes:
-
Display all routes for IPv6:
-
Add default route via gateway IP:
-
Add route via interface:
-
Get the route used for an destination
-
Change your mac address :
-
View neighbors (using ARP and NDP):
Practical use case¶
Let's say you have a network, e.g. 192.168.1.0/24
,
so with the following IP range: 192.168.1.42
to 192.168.1.254
.
Now you want to connect to this network with the following address: 192.168.1.42
.
Here is how to do it with ip
:
-
Stop the DHCP service:
-
Check your interfaces:
-
Choose an available interface, e.g.
enp1s1
. -
Add an IP address (
192.168.1.42
) to your interface: -
Add a gateway (e.g.
192.168.1.254
), if your network has one: -
Add a DNS (e.g.
192.168.1.1
), if your network has one: -
Check you connectivity:
If this cheat sheet has been useful to you, then please consider leaving a star here.