Task 2: Network Configuration & Monitoring
Following up on server deployment, here is my guide for Task 2 covering Network Configuration and Monitoring. Whether we are connecting a web framework to a backend database or ensuring our mobile applications can reliably reach our APIs, understanding how to diagnose network traffic on a Linux server is essential. Below are the modern, standard commands used to configure, test, and monitor a Debian/Ubuntu server's network. 1. Interface & IP Configuration The older ifconfig command is largely deprecated on modern Linux systems. To find the server's local IP address, MAC address, and check if the network interface (like eth0 or ens3) is physically "UP", we use the modern ip tool. Command: ip a (or ip addr show) 2. Routing and Gateways If the server is failing to send data to another subnet, we need to check its internal map—the routing table. This tells us the default gateway (router) the server is using to reach the outside world. Command: ip route 3. DNS Diagnostics (Domain Resolution) When our server can ping an IP address but fails to connect to an external domain (like a third-party API), it is usually a Domain Name System (DNS) issue. To query the DNS servers and get a detailed breakdown of the request and answer, we use the Domain Information Groper tool. Command: dig eurosom.com 4. Advanced Connectivity Testing ping is great for checking if a server is awake, but it does not tell us if a specific application port is open through the firewall. To test if a remote server is accepting connections on a specific port (for example, port 3306 for a remote database), we use Netcat. Command: nc -zv {ip-address} {port} Note: The -z flag tells it to scan without sending data, and -v makes the output verbose so we can see the success or failure message. 5. Real-Time Bandwidth Monitoring If a server is suddenly running slowly and the CPU/RAM look normal, the network bandwidth might be maxed out. To get a live, constantly updating view of our server's network traffic, we can use iftop.