Ravindra Bagale · AWSसर्व coursesया course चे lessonsशोधाEnglish

AWS · मराठी आवृत्ती

4.7 Network तपासण्याचे commands

रवींद्र बागले यांच्या course वर आधारित · सहज मराठीत explanation

या page मध्ये

Server चा problem की network चा? ss, curl आणि dig हे तीन tools रोज उपयोगी.

Commandकामउदाहरण
ip addr / ip aInterfaces/IPsip -4 a
ip routeRoutes/default gatewayip r
ss -tulnpListening TCP/UDP आणि processsudo ss -tlnp
netstat -tulnpजुना पर्याय; net-toolssudo netstat -tlnp
pingICMP reachabilityping -c 4 google.com
curlHTTP/API testcurl -I http://localhost
wgetDownloadwget https://wordpress.org/latest.tar.gz
dig / nslookupDNS; dnsutils/bind-utilsdig +short example.com
traceroute / tracepathदिसणारे route hopstracepath google.com
ncTCP connection testnc -zv 10.0.1.25 3306
hostnamectlHostname पहा/बदलाsudo hostnamectl set-hostname web01
sudo ss -tlnp                         # which programs listen on which ports?
sudo ss -tlnp | grep ':80 '           # is anything on port 80?
curl -I http://localhost              # only response headers (HTTP status)
curl -s http://localhost:3000/api/health
curl -o page.html https://example.com
wget -q -O - https://checkip.amazonaws.com    # print public IP
ping -c 3 8.8.8.8

Listening address चा अर्थ

0.0.0.0:80 म्हणजे सर्व IPv4 interfaces; *:80 चा address family सहित context तपासा. Route/firewall/SG योग्य असेल तर बाहेरून access शक्य. 127.0.0.1:3000 फक्त server वरून; reverse proxy मागच्या app साठी चांगलं.

Ping fail म्हणजे server down नाही. ICMP allowed नसू शकतो. Actual service वर curl/nc करा; गरज असल्यास फक्त स्वतःच्या IP मधून ICMP testing allow करा.

Tools install

# Ubuntu
sudo apt install -y net-tools dnsutils traceroute netcat-openbsd
# Amazon Linux 2023 / CentOS Stream 9
sudo yum install -y net-tools bind-utils traceroute nmap-ncat

Lab

EC2 वर ip -4 a, ip r, sudo ss -tlnp, curl -I http://localhost. Laptop वर nc -zv <PUBLIC_IP> 22. IP, default gateway, listening ports आणि HTTP status नोंदवा.