Network management is a fundamental skill for Linux system administrators. In this article, we’ll explore the main tools and commands for configuring, monitoring, and diagnosing networks in Linux systems.
Why Use the ip Command?
The ip command is the modern and more robust tool for network management in Linux. It has gradually replaced older commands like ifconfig and route, offering a more consistent interface and advanced functionalities. The main advantage is its ability to perform multiple network tasks through a single unified tool.
Basic Commands for Network Visualization
Viewing Interface Configurations
ip addr show
# or simply
ip a
This command displays all available network interfaces, their IP addresses, network masks, and status.
Checking Network Card Information
ip link show
Shows information about network interfaces, including MAC addresses, MTU, and interface state.
Viewing Network Routes
ip route show
Displays the system’s routing table, showing how packets are directed to different destinations on the network.
Testing Connectivity
Ping Command
ping <ip_address>
The ping command is essential for testing connectivity with a specific host. It sends ICMP packets and measures response time, being fundamental for network troubleshooting.
ARP Protocol
The ARP (Address Resolution Protocol) is responsible for mapping IP and MAC addresses on the local network. To view the ARP table:
arp -a
The -a parameter means “all”, displaying all entries in the ARP table.
Dynamic Network Configuration
Adding IP Addresses
ip addr add <ip_address> dev <interface>
Assigns an IP address to a network interface temporarily.
Practical example:
ip addr add 192.168.1.100/24 dev eth0
Removing IP Addresses
ip addr del <ip_address> dev <interface>
Removes an IP address from an interface.
Clearing Manual Configurations
ip addr flush dev <interface>
This command removes manually added IPs on an interface, theoretically maintaining dynamic configurations (DHCP).
Interface Management
Enabling/Disabling Interfaces
ip link set <interface> up # Enable interface
ip link set <interface> down # Disable interface
Activates or deactivates a network interface, controlling the physical state of the network adapter.
Routing Commands
Removing Routes
ip route del <ip_address>
Removes a specific route from the routing table.
Querying Specific Routes
ip route get <ip_address>
Shows the route that would be used to reach a specific IP address, helpful for troubleshooting routing issues.
Removing Default Route
ip route del default
Removes the default gateway route, disconnecting the system from external networks.
Additional Diagnostic Tools
Installing Traditional Tools
If you still need ifconfig:
apt install net-tools
Name Resolution
nslookup <domain>
dig <domain>
nslookup queries DNS servers to resolve domain names, while dig provides more detailed DNS record information. Both are essential for DNS diagnosis and name resolution.
Route Tracing
traceroute <destination>
traceroute shows the path that packets take to reach the destination, being useful for identifying where connectivity problems occur.
Security Considerations
From a security perspective, it’s important to always prioritize updated tools. The ip command is actively maintained and receives regular security updates, making it more secure than some legacy tools.
Conclusion
Network management in Linux offers powerful and flexible tools. The ip command centralizes most network operations, while complementary tools like ping, traceroute, and dig provide essential diagnostic capabilities. Mastering these commands is fundamental for any Linux system administrator.
Regular practice with these commands in test environments will help develop competence and confidence in managing production networks.
Until the next post!

