Basics Of Networking in DevOps


How to set-up first webserver and explore AWS security group?
Step 1: Go to EC2 Instance in AWS console
Step 2: Go to Network Setting
Step 3: Edit the Security group
You can edit the Protocol here according to requirements.
Set 4: Set up my First Webserver
sudo apt-get update
sudo apt-get install nginx
Step 5 : Create a index.html page
cd /var/www/html
sudo vim index.html
Result:
Basic networking commands to troubleshoot issues.
Ping
A basic network utility used to test connectivity between your computer and another device (like a server, router, or website) on a network.
🔹 How it works:
ping
sends small packets of data called ICMP Echo Requests to a target IP address or hostname.If the target is reachable, it replies with ICMP Echo Replies.
ping
then shows how long it took for each packet to travel to the target and back (round-trip time, or RTT).
Sample output:
nslookup
A network utility used to query DNS (Domain Name System) servers. It helps you find out the IP address of a domain name or the domain name associated with an IP address. It help is troubleshooting DNS issue.
traceroute/tracert : Traceroute (Linux/macOS) / tracert (Windows) is a network diagnostic command that shows you the path your data takes to reach a destination host.
🔹 How it works:
Your computer sends packets to the destination with increasing TTL (Time To Live) values.
Each router (or "hop") along the way decreases the TTL.
When TTL reaches zero, the router replies back with an error message, revealing its identity (IP/hostname).
This process repeats until the packet reaches the final destination.
netstat
A command-line tool that shows network connections, routing tables, interface statistics, and ports in use on your computer.
🔹 What you can do with netstat
:
See active connections (who your machine is talking to).
Check listening ports (which services are waiting for connections).
View routing tables (how packets move through your machine).
Monitor interface statistics (data sent/received, errors, drops).
#Show all active connections
netstat -a
#Show listening ports
netstat -l # Linux/macOS
netstat -an # Windows
#Show process IDs with connections
netstat -p # Linux
netstat -ano # Windows
#Show routing table
netstat -r
#Show interface statistics
netstat -i
curl
a command-line tool used to transfer data to or from a server using different protocols, most commonly HTTP and HTTPS.
🔹 What curl
can do:
Fetch a web page’s HTML
Call APIs (GET, POST, PUT, DELETE requests)
Send headers, cookies, authentication
Download or upload files via HTTP, FTP, SFTP, etc.
Test endpoints in DevOps or debugging
Fetch a webpage
curl https://example.com
Save output to a file
curl -o page.html https://example.com
Follow redirects
curl -L https://bit.ly/some-link
Send custom headers
curl -H "Authorization: Bearer <token>" https://api.example.com/data
POST request with data (API testing)
curl -X POST -d "username=test&password=1234" https://example.com/login
Download a file
curl -O https://example.com/file.zip
Subscribe to my newsletter
Read articles from Sirsha Thapa directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
