The ip command
Everything about a Linux machine's network is shown and changed with one tool: ip. Its most useful view is ip addr (addresses on each interface). An interface is a network connection point: a physical card, a virtual device, or lo, the loopback that every machine has for talking to itself at 127.0.0.1:
ip addr show
ip -brief addr showIn the terminal
student@vulntech:~$ ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: enp0s5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 00:22:15:29:19:14 brd ff:ff:ff:ff:ff:ff student@vulntech:~$ ip -brief addr show lo UNKNOWN 127.0.0.1/8 ::1/128 enp0s5 DOWN
-brief gives one tidy line per interface. This machine has only lo — later in the module you'll add more interfaces yourself.
Links and routes
ip link shows the interfaces themselves (their state and hardware addresses), and ip route shows the routing table: the rules that decide where a packet is sent based on its destination:
ip link show
ip route showIn the terminal
student@vulntech:~$ ip link show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: enp0s5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 00:22:15:29:19:14 brd ff:ff:ff:ff:ff:ff student@vulntech:~$ ip route show
Tip:
ipreplaces the olderifconfigandroutecommands you may see in guides.ip a,ip landip rare accepted short forms.
Remember:
ip addrshows interfaces and their IP addresses,ip linkthe interfaces themselves,ip routethe routing table.lois the loopback interface (127.0.0.1).