Technical skill

Linux commands: network management

Start with the computer's local network picture

To send information to another computer, a device needs a network connection, an address, and directions for where to send traffic. The connection may be a Wi-Fi, wired, or virtual interface. An address identifies one of the device's network interfaces, and a route tells it which way to send traffic for a destination. If a site will not open, checking these parts in order helps show whether the computer has a link, an address, and a path toward the destination.

Linux provides ip to inspect or change network settings, and ss to show sockets and their states. A socket is an endpoint that a program uses to communicate. ss can list sockets that use TCP and UDP, two common network protocols. Start with these read-only checks:

ip -br link
ip -br address
ip route show
ip route get 203.0.113.10
ss -lntup

Read what the commands report

ip is part of iproute2 and reads or changes networking objects in the Linux kernel. The object name tells it what to examine: link for interfaces, address for assigned addresses, route for paths, or neigh for nearby network neighbors. ip link show, ip address show, and ip route show list the current values. The -br option makes interface output shorter.

ip route get asks which route and source address the kernel would choose for one destination. It sends no packet. The address 203.0.113.10 is set aside for examples and documentation; use the actual destination when tracing a real connection. In ss -lntup, -l shows listening sockets, -n leaves addresses and ports as numbers, and -t and -u choose TCP and UDP. -p asks which process owns a socket, though an ordinary user may not see every process. Reading these settings is usually allowed without administrator privileges. Changing addresses, interfaces, or routes usually requires root privileges or the relevant network capability and can disconnect a remote session.

An interface shown as down points toward a connection problem. An interface without the expected address points toward local network configuration. A route lookup shows the outgoing interface and next hop that the kernel would use. ip neigh show lists cached link-layer neighbors on directly connected networks. An incomplete entry may indicate a local link or address-resolution problem; it does not prove that a distant computer is offline.

If the computer has a route but a service still does not answer, check whether a program is listening on the expected port and address. A service bound to 127.0.0.1 accepts connections from the local computer, not from its external interface. A firewall, DNS, policy routing, a remote network path, or the application itself may still be involved. A local listing cannot prove that the complete connection works.

Change settings carefully

Commands such as ip link set and ip route add change the kernel's live network state. Confirm the interface or route before changing it, and keep a recovery path when working remotely. A network manager may replace a temporary change later; persistent settings are usually stored separately by the system's network service.

Interactive exercises

Materials

Skillsets
Skillset Devops preview
image descriptionDevops
by Dio
3 users
Skillset Linux administrator preview
image descriptionLinux administrator
by Infinite Education
3080 users
Skillset Devops preview
image descriptionDevops
by Ajay Kumar
2004 users
Do you know that ...?
Any useful or interesting facts about the skill. Any peace of information would be useful