type
status
date
slug
category
password
tags

📌 Final AWS CSE (Networking) Interview Preparation Checklist

This checklist is now fully aligned with both Basic & Preferred Qualifications listed in the job description.

✅ 1. Core Networking Concepts to Master

📖 Protocols & Troubleshooting

  • HTTP vs HTTPS (SSL/TLS encryption, handshake process).
  • DNS (query process, caching, records: A, CNAME, MX, TXT, PTR).
  • TCP/IP Stack (3-way handshake, 4-way termination, windowing).
  • UDP vs TCP (when to use each, advantages/disadvantages).
  • Routing & Switching (OSPF vs BGP, VLANs, STP).
  • Load Balancing (Layer 4 vs Layer 7, sticky sessions, cookie-based).
✅ Tools to Practice: ping, traceroute, mtr, iperf, tcpdump, nslookup/dig, curl.

✅ 2. AWS-Specific Networking Services

📖 AWS VPC & Networking

  • VPC Subnets (public vs private), Route Tables, Internet & NAT Gateway.
  • Security Groups vs NACLs (stateless vs stateful).
  • AWS Transit Gateway & VPC Peering (differences, use cases).
  • AWS Direct Connect vs VPN (hybrid networking).
  • VPC Flow Logs & Network Troubleshooting.

📖 AWS Load Balancing & Traffic Control

  • ALB vs NLB vs CLB (when to use each).
  • How Elastic Load Balancer handles HTTP requests.
  • DNS Failover & Route 53 Routing Policies.
✅ Hands-on Practice: Create a VPC, configure VPC Peering, NAT Gateway, Security Groups, and NACLs.

✅ 3. Network Security & Firewalls

📖 Security Concepts

  • SSL/TLS Encryption (certificate verification, AWS ACM).
  • Web Application Firewall (AWS WAF) (how it blocks SQLi, XSS).
  • Intrusion Detection & Prevention (IDS/IPS) (AWS GuardDuty vs AWS Network Firewall).
  • DDoS Protection with AWS Shield.
  • DNS Security Best Practices (domain hijacking prevention).
Hands-on Practice: Deploy AWS WAF, configure AWS GuardDuty.

✅ 4. Linux & Windows System Administration

📖 Linux Fundamentals

  • Startup Process (BIOS, GRUB, systemd).
  • User & File Permissions (chmod, chown, sudo roles).
  • Monitoring Logs (journalctl, tail -f /var/log/syslog).
  • Firewall Management (iptables, firewalld --list-all).
  • Networking Commands (ifconfig, ip addr, netstat, ss).

📖 Windows Fundamentals

  • Windows networking (ipconfig, netstat -an, firewall settings).
  • Event Viewer for troubleshooting logs.
Hands-on Practice: Debug Linux/Windows connectivity issues.

✅ 5. Application Monitoring & Performance Analysis

  • AWS CloudWatch (Monitoring Logs, Metrics, Alerts).
  • Grafana & Datadog (Setting up dashboards for network monitoring).
  • Prometheus (Metrics collection & alerting rules).
Hands-on Practice: Deploy CloudWatch Dashboards for VPC Flow Logs.
 

1. HTTP

1.1 The Traffic Flow of HTTP

HTTP follows a client-server model, where a request flows through:
  1. Client (Browser/API Requester) → User sends an HTTP request.
  1. DNS Resolution → Converts domain (example.com) into an IP address.
  1. Frontend Server (CDN/Load Balancer) → Serves static content and routes traffic.
  1. Backend Server → Handles logic, interacts with the database.
  1. Database → Stores and retrieves data.
  1. Response Back to Client → Server returns HTTP response to the browser.

1.2 About Cookies

Cookie is data that a server transmits to a user’s web browser.
  • Purpose: Store session data, authentication tokens, and user preferences.
  • Types:
    • Session Cookies → Temporary, deleted when the browser closes.
    • Persistent Cookies → Stored on disk, expire after a set time.
    • Secure Cookies → Sent only over HTTPS.
    • HttpOnly Cookies → Not accessible via JavaScript (prevents XSS attacks).
  • Set-Cookie Header Example: Set-Cookie: sessionId=abc123; Secure; HttpOnly

1.3 What is in a Request?

🔹 HTTP Version
  • Defines the protocol version (HTTP/1.1, HTTP/2, HTTP/3).
🔹 URL
  • Specifies resource location (https://example.com/api/users).
🔹 HTTP Method
Method
Purpose
GET
Retrieve data.
POST
Create a new resource.
PUT
Update an entire resource.
PATCH
Partially update a resource.
DELETE
Remove a resource.
🔹 HTTP Request Headers
Metadata sent with the request:
🔹 HTTP Body
  • Only used in POST, PUT, and PATCH requests.
  • Contains JSON, XML, or form data.
  • Example JSON Request Body:

    1.4 What is in a Response?

    🔹 HTTP Status Codes
    Category
    Popular Codes
    Meaning
    1xx Informational
    100 Continue
    Request received
    2xx Success
    200 OK, 201 Created, 204 No Content
    Request successful.
    3xx Redirection
    301 Moved Permanently, 302 Found
    Resource moved.
    4xx Client Errors
    400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found
    Client-side errors.
    5xx Server Errors
    500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable
    Server-side failures.
    🔹 HTTP Response Headers
    Metadata about the response:
    🔹 HTTP Body
    • Contains HTML, JSON, or XML data.
    • Example JSON Response:

      1.6 curl in PowerShell Syntax Summary

      Command
      Description
      curl.exe -X GET https://jsonplaceholder.typicode.com/posts/1
      Show response body.
      curl.exe -X GET -I https://jsonplaceholder.typicode.com/posts/1
      Show only response headers.
      curl.exe -X GET -i https://jsonplaceholder.typicode.com/posts/1
      Show response headers and body.
      curl.exe -X POST ... -d "{...}"
      Create a new resource.
      curl.exe -X PUT ... -d "{...}"
      Update an existing resource.
      curl.exe -X DELETE ...
      Delete a resource.
      curl.exe -X GET -H "User-Agent: MyPowerShellClient/1.0"
      Custom request User-Agent
      curl.exe -X GET -H "Authorization: Bearer my-token"
      Send an Authorization header.

      1.7 curl Examples in PowerShell

      Here are all curl.exe examples formatted properly with comments explaining each command.

      1.8 How to Filter JSON Response in PowerShell

      2 HTTPS

      HTTPS (HyperText Transfer Protocol Secure) is an encrypted version of HTTP that uses SSL/TLS to secure data transfer between a client (browser, API) and a server.
      • Asymmetric Encryption → Used initially for key exchange.
      • Symmetric Encryption → Used after the handshake for secure data transmission.

      2.1 TLS Handshake

      TLS handshake is an application layer protocol in the TCP/IP model. It is used to build trust between a client and server (CS) and establish encrypted communication.
      Client Hello: Client sends supported TLS version and encryption methods (cipher suites).
      Server Hello: Server responds with Chosen TLS version & encryption method, Public key and TLS certificate.
      Certificate Validation: Client verifies the server's certificate using a Certificate Authority (CA).
      Key Exchange: If the certificate is valid, the client generates a shared secret key. Client encrypts this key using the server's public key and sends it to the server.
      Encrypted Communication: Both client & server now use the shared key for encrypted communication.

      2.2 TLS Certificate and CA

      TLS Certificate is a digital certificate used to establish encrypted communication between a client and a server, ensuring data security and authenticity over HTTPS.
      Certificate Authority (CA) is a trusted organization that verifies the identity of websites and issues TLS certificates, enabling secure connections and preventing impersonation attacks.

      2.3 Integrity and Encryption

      Hashing is a one-way process that converts data into a fixed-length value, commonly used for password storage and data integrity verification. SHA-256, MD5
      Encryption is a two-way process that secures data by converting it into ciphertext, which can be decrypted using a key for secure communication. AES, RSA

      2.4 MITM (Man-in-the-Middle) Attacks

      MITM attack occurs when an attacker intercepts and alters communication between two parties (e.g., a client and a server) without their knowledge.
      Examples includes rogue Wi-Fi hotspots, SSL stripping, session hijacking, and DNS spoofing
      TLS prevents MITM attacks by encrypting communication to make intercepted data unreadable, validating server certificates to prevent fake websites, and enforcing HTTPS with HSTS to block SSL stripping attacks.

      3 TCP/IP Model vs. OSI Model

      3.1 TCP/IP Model (4 Layers)

      The TCP/IP model is the real-world networking model used for the internet and modern network communication. It has 4 layers:
      Layer
      Function
      Example Protocols
      Application Layer
      Handles user interaction, data formatting
      HTTP, HTTPS, DNS, FTP, SMTP
      Transport Layer
      Ensures reliable data transfer between devices
      TCP, UDP
      Internet Layer
      Responsible for addressing and routing packets
      IP, ICMP, ARP
      Network Access Layer
      Defines physical hardware and data link protocols
      Ethernet, Wi-Fi, MAC
      Key Takeaway: TCP/IP is a simplified, practical model for networking.

      3.2 OSI Model (7 Layers)

      The OSI (Open Systems Interconnection) Model is a conceptual model for networking with 7 layers:
      Layer
      Function
      Example Protocols/Devices
      7. Application
      Interfaces with users & applications
      HTTP, FTP, SMTP
      6. Presentation
      Data encoding & encryption
      SSL/TLS, JPEG, ASCII
      5. Session
      Manages sessions between devices
      NetBIOS, RPC
      4. Transport
      Ensures reliable/unreliable delivery
      TCP, UDP
      3. Network
      Handles IP addressing & routing
      IP, ICMP, ARP, Routers
      2. Data Link
      Manages MAC addresses & switches
      Ethernet, Wi-Fi, VLANs
      1. Physical
      Transmits raw bits over cables/wireless
      Cables, Fiber, Radio Waves
      Key Takeaway: OSI is a theoretical model, while TCP/IP is practical and widely used.
       

      4 DNS

      4.1 Top-Level Domain and Level 2 Domain

      A Top-Level Domain (TLD) is the highest hierarchical part of a domain name. like .com, .org, .net, and .uk, .za A Level 2 Domain is the name directly below the TLD representing a company, brand or organization, google in google.com;

      4.2 DNS Query Types

      🔹 A Record: Maps a domain name to an IPv4 address.
      🔹 CNAME Record (Alias): query alias name
      🔹 MX Record (Mail Exchange) :Query mail servers
      🔹 TXT Record (Verification & Security)
      🔹 PTR Record (Reverse DNS Lookup): Maps an IP address back to a domain name.

      4.3 DNS Recursive vs. Iterative Query

      • When a hostname (e.g., www.example.com) is queried, most DNS resolvers perform recursion by default.
      • Iterative queries are mainly used for IP-based reverse lookups (PTR records) or when querying root/TLD DNS servers.
      Recursive Query : The DNS resolver handles the full lookup on behalf of the client and returns the final IP address. Used by browsers, apps, and public DNS services (e.g., Google 8.8.8.8).
      Iterative Query → The DNS resolver provides referrals to the next DNS server, and the client must query each server step by step. Used by root & TLD DNS servers.
      Comparison:
      • Recursive: One query, resolver does all work, used by ISPs & public DNS.
      • Iterative: Multiple queries, client follows referrals, used by root & TLD servers.

      4.4 DNS UDP and TCP

      • DNS normally uses UDP (port 53) for speed.
      • If the response is larger than 512 bytes, the server sets the TC flag, and the client switches to TCP.

      5 TCP

      TCP (Transmission Control Protocol) is a reliable transport protocol as it establishes a connection before sending any data and everything that it sends is acknowledged by the receiver
      TCP is reliable, ordered, and ensures data integrity, making it ideal for applications like web browsing (HTTP/HTTPS), email (SMTP), and file transfer (FTP).

      5.1 TCP Header Packet Form

      TCP Packet is min 20 bytes to 60 bytes, decided by length of flexible options at the end, marked by DO:
      • Source port: this is a 16 bit field that specifies the port number of the sender. (0-65,535)
      • Destination port: this is a 16 bit field that specifies the port number of the receiver.
      • Sequence number: the sequence number is a 32 bit field that indicates how much data is sent during the TCP session. When you establish a new TCP connection (3 way handshake) then the initial sequence number is a random 32 bit value. The receiver will use this sequence number and sends back an acknowledgment. Protocol analyzers like wireshark will often use a relative sequence number of 0 since it’s easier to read than some high random number.
      • Acknowledgment number: this 32 bit field is used by the receiver to request the next TCP segment. This value will be the sequence number incremented by 1.
      • DO: this is the 4 bit data offset field, also known as the header length. It indicates the length of the TCP header so that we know where the actual data begins.
      • RSV: these are 3 bits for the reserved field. They are unused and are always set to 0.
      • Flags: there are 9 bits for flags, we also call them control bits. We use them to establish connections, send data and terminate connections:
        • URG: urgent pointer. When this bit is set, the data should be treated as priority over other data.
        • ACK: used for the acknowledgment.
        • PSH: this is the push function. This tells an application that the data should be transmitted immediately and that we don’t want to wait to fill the entire TCP segment.
        • RST: this resets the connection, when you receive this you have to terminate the connection right away. This is only used when there are unrecoverable errors and it’s not a normal way to finish the TCP connection.
        • SYN: we use this for the initial three way handshake and it’s used to set the initial sequence number.
        • FIN: this finish bit is used to end the TCP connection. TCP is full duplex so both parties will have to use the FIN bit to end the connection. This is the normal method how we end an connection.
      • Window: the 16 bit window field specifies how many bytes the receiver is willing to receive. It is used so the receiver can tell the sender that it would like to receive more data than what it is currently receiving. It does so by specifying the number of bytes beyond the sequence number in the acknowledgment field.
      • Checksum: 16 bits are used for a checksum to check if the TCP header is OK or not.
      • Urgent pointer: these 16 bits are used when the URG bit has been set, the urgent pointer is used to indicate where the urgent data ends.
      • Options: this field is optional and can be anywhere between 0 and 320 bits.
      A TCP packet consists of a header (for control and sequencing) and data (actual payload).
      Field
      Size
      Description
      Source Port
      16 bits
      Identifies sender's port.
      Destination Port
      16 bits
      Identifies receiver's port.
      Sequence Number
      32 bits
      Keeps track of data order.
      Acknowledgment Number
      32 bits
      Confirms received data.
      Data Offset (Header Length)
      4 bits
      Size of TCP header.
      Flags (Control Bits)
      6 bits
      Includes SYN, ACK, FIN, RST, PSH, URG.
      Window Size
      16 bits
      Controls the flow of data (Sliding Window).
      Checksum
      16 bits
      Ensures data integrity.
      Urgent Pointer
      16 bits
      Used for urgent data.
      Options (Optional)
      Variable
      Used for extensions (e.g., Window Scaling).
      Data (Payload)
      Variable
      Actual transmitted content.

      5.2 TCP Lifecycle

      The TCP lifecycle involves connection establishment, data transmission, and connection termination while ensuring reliable delivery using ACK (Acknowledgment), SEQ (Sequence numbers), flow control, and retransmissions.
      • TCP uses a 3-way handshake to establish a connection between client and server.
        • Client sends a SYN packet with an initial sequence number (SEQ=x).
        • Server responds with a SYN-ACK, acknowledging the client's SEQ (ACK=x+1) and sending its own SEQ=y.
        • Client sends a final ACK (ACK=y+1), confirming the connection. Once established, both sides can start sending data.
      • During data transmission, TCP ensures flow control and error recovery using sequence numbers (SEQ) and acknowledgment numbers (ACK). The sender assigns a SEQ number to each packet (SEQ=100). The receiver responds with an ACK number (ACK=101), meaning "I received SEQ 100 and expect 101 next." The sender continues sending packets, and the receiver keeps acknowledging.
      • If a packet gets lost or corrupted, TCP retransmits it. If the receiver does not receive a packet, it does not send an ACK for it. The sender notices a missing ACK and retransmits the packet. TCP can use timeout-based retransmission or fast retransmit (triggered by duplicate ACKs).
      • To close a connection, TCP uses a 4-way handshake.
        • The client sends a FIN request.
        • The server acknowledges the FIN with an ACK.
        • The server then sends its own FIN.
        • The client acknowledges the FIN, closing the connection fully.

      5.3 TCP Sliding Window

      MSS defines the largest amount of data (payload) a TCP segment can carry, excluding headers. It ensures that TCP segments fit within the network's MTU to avoid fragmentation.
      • If MTU = 1500 bytes (Ethernet default) (VPN IPSec 1400 bytes)
      • IP Header = 20 bytes, TCP Header = 20 bytes
      • Then, MSS = 1500 - 40 = 1460 bytes
      With a 64KB window, 1460 MSS, the client sends 45 segments one by one and waits for the ACK. As soon as the client receives the ACK for the first segment, it can send another batch of 45 segments without waiting for all 45 ACKs. If a segment is lost, the client retransmits it upon detecting the missing ACK.

      5.4 UDP vs TCP

      TCP is a connection-oriented protocol that ensures reliable data delivery through acknowledgments and retransmissions. It is ideal for applications where accuracy is crucial, such as web browsing, email, and file transfers. However, it introduces latency due to connection setup and error checking.
      UDP is a connectionless protocol that sends data without ensuring delivery. It is used for real-time applications like video streaming, VoIP, and online gaming, where low latency is more important than guaranteed delivery. Since UDP does not have flow control or retransmission mechanisms, it is faster but less reliable than TCP.
      • TCP 80: HTTP (Web Traffic)
      • TCP 443: HTTPS (Secure Web Traffic)
      • TCP 22: SSH (Secure Shell)
      • TCP 25: SMTP (Email Sending)
      • UDP 53: DNS (Domain Name System)
      • UDP 67/68: DHCP (Dynamic Host Configuration Protocol)
      • UDP 123: NTP (Network Time Protocol)
      • UDP 161: SNMP (Simple Network Management Protocol)

      5.5 TCP Q&A

      ❓ Q1: Why does TCP require a three-way handshake?
      ✅ A1: The three-way handshake ensures both client and server are ready for communication and can establish a reliable connection by synchronizing sequence numbers.
      ❓ Q13: Why does TCP use a four-way handshake for termination but only a three-way handshake for connection establishment?
      ✅ A13: Connection termination requires two FIN-ACK sequences to ensure both sides have finished sending data.
      ❓ Q4: What is the purpose of TCP’s sliding window mechanism? ✅ A4: The sliding window controls how much data can be sent before receiving an acknowledgment, preventing buffer overflow.
      ❓ Q8: What is TCP congestion control?
      ✅ A8: TCP congestion control is a network mechanism that dynamically adjusts the data transmission rate using algorithms like Slow Start, AIMD, and Fast Retransmit to prevent congestion and ensure efficient data flow.

      6 ALB (Application Load Balancer) Cookie-Based Session Persistence

      6.1 Logic Flow

      1️⃣ Client Sends a Request
      • The client (browser, API, mobile app) initiates a request to the Application Load Balancer (ALB)
      2️⃣ ALB Listener Filters the Request to a Target Group
      • The Listener in ALB is configured on Port 80 (HTTP) or 443 (HTTPS).
      • The listener rules decide which Target Group the request should go to.
      • Example Rules:
        • If the path is /api/*, forward to Target Group A (Backend API servers).
        • If the path is /dashboard/*, forward to Target Group B (Web App servers).
      ✅ The ALB selects the right Target Group based on the rules.
      3️⃣ Target Group Selects a Backend Server
      • The Target Group contains multiple backend instances (EC2, containers, or Lambda functions).
      • The ALB chooses a healthy backend server from the target group and forwards the request.
      4️⃣ ALB Checks for Stickiness (Cookie-Based Session Persistence)
      • If stickiness is enabled, ALB checks if the client already has a session cookie (AWSALB or application-defined cookie).
      • Scenario 1: First Request (No Cookie Yet)
        • ALB routes the request to a randomly selected backend server.
        • The backend server processes the request.
        • ALB sets a session cookie (AWSALB) in the response.
      • Scenario 2: Returning Request (Cookie Present)
        • The client sends the same AWSALB cookie in the next request.
        • ALB reads the cookie and forwards the request to the same backend server.
      5️⃣ Backend Server Processes the Request and Returns a Response
      • The backend server handles the request, processes data, and sends back a response to the client.
      6️⃣ Client Stores the Cookie and Uses It for Subsequent Requests
      • The client stores the AWSALB cookie in the browser or API client.
      • For future requests, the client automatically sends the cookie, ensuring that requests stay on the same backend server.

      6.2 Key Terms Explained

      Term
      Explanation
      Application Load Balancer (ALB)
      AWS service that distributes HTTP/HTTPS traffic across backend servers.
      Listener
      ALB component that listens on a port (80, 443) and applies routing rules.
      Target Group
      A set of backend servers (EC2, containers, Lambda) that receive traffic.
      Stickiness (Session Persistence)
      Ensures that a client is consistently routed to the same backend server.
      AWSALB Cookie
      ALB-generated cookie used to maintain session stickiness.
      Application-Controlled Cookie
      A custom cookie managed by the backend application.
      Backend Server
      The EC2 instance, container, or Lambda function that processes requests.

      6.3 Summary

      1️⃣ Client sends a request to ALB.
      2️⃣ Listener forwards request to the correct Target Group.
      3️⃣ Target Group selects a backend server.
      4️⃣ ALB assigns a session cookie (AWSALB) for stickiness.
      5️⃣ Backend server processes the request and responds.
      6️⃣ Client sends the cookie in future requests to maintain stickiness.

      7 Summary of Bottleneck Troubleshooting with Iperf

      Step
      Command
      What It Checks
      1. Check local speed
      iperf -c <local-ip> -P 5 -w 512K
      Measures local network performance.
      2. Find max window size
      iperf -c <local-ip> -P 5 -w 2M
      Checks if increasing TCP window improves speed.
      3. Test packet loss (UDP mode)
      iperf -u -c <local-ip> -b 100M
      Detects network congestion or packet loss.
      4. Test reverse mode
      iperf -c <local-ip> -P 5 -w 512K -R
      Compares upload vs. download speed.
      5. Check for MTU issues
      iperf -c <local-ip> -P 5 --set-mss 1200
      Detects fragmentation issues.
      6. Test external connection
      iperf -c <internet-server-ip> -P 5 -w 512K
      Identifies ISP bottlenecks.

      8. When an HTTP Request to a Host Fails? tcpdump and telnet

      8.1 Check Logs, Use tcpdump, and Attempt a telnet Connection

      • Check web server and firewall Logs
        • Inspect web server logs (/var/log/nginx/access.log, /var/log/httpd/error.log).
        • Check application and firewall logs for possible issues
      • Use tcpdump to Analyze Network Traffic: Monitor incoming/outgoing packets to detect timeouts, resets, or dropped connections.
        • Attempt a Telnet Connection:Verify if the server is reachable on HTTP/HTTPS ports.

          8.2 Alternative Debugging Steps

          If the above steps do not resolve the issue, try these:
          1. Check if the web server is running
            1. Verify firewall rules (ensure HTTP/HTTPS traffic is allowed)
              1. Check DNS resolution
                1. Test network connectivity with curl

                  8.3 Summary of the Troubleshooting Approach

                  Step 1: Check logs (/var/log/nginx/error.log, /var/log/httpd/error.log)
                  Step 2: Use tcpdump to inspect network traffic
                  Step 3: Attempt a Telnet connection to the HTTP/HTTPS ports
                  Step 4: Verify server status, firewall rules, and DNS resolution
                  Would you like a troubleshooting script to automate these checks? 🚀

                  9 Linux

                  9.1 Linux Command

                  1. System and User Information Commands
                  • hostname → Displays the system's hostname.
                  • whoami → Shows the current logged-in user.
                  • pwd → Prints the current working directory.
                  • lscpu → Displays detailed CPU information.
                  • df → Shows disk space usage.
                  • df -h → Displays disk space usage in a human-readable format.
                  • du → Shows disk usage of files and directories.
                  • du /home → Checks disk usage in the /home directory.

                  2. File and Directory Management
                  • ls → Lists files and directories in the current location.
                  • ls -l → Lists files with detailed information (permissions, ownership, size).
                  • ls -la → Lists all files, including hidden ones.
                  • ls -li → Lists files with inode numbers.
                  • mkdir linuxcmd → Creates a directory named linuxcmd.
                  • cd <directory> → Changes to a specific directory.
                  • cd . → Stays in the same directory.
                  • cd .. → Moves to the parent directory.
                  • touch testfile.txt → Creates an empty file.
                  • mv text4.txt text5.txt → Renames text4.txt to text5.txt.
                  • find text4.txt → Searches for text4.txt in the current directory.
                  • find . -name text5.txt → Searches for text5.txt within the current directory tree.
                  • rpm -q package_name → Redhat Package Management for query package

                  3. File Viewing and Text Processing
                  • cat text5.txt → Displays the contents of text5.txt.
                  • cat file1 file2 → combine two files
                  • less text5.txt → Allows scrolling through text5.txt.
                  • more text5.txt → Views text5.txt page by page.
                  • head -5 text5.txt → Shows the first 5 lines of text5.txt.
                  • tail -5 text5.txt → Shows the last 5 lines of text5.txt.
                  • wc -l text5.txt → Counts the number of lines in text5.txt.
                  • diff text3.txt text5.txt → Compares two files line by line.
                  • sort text5.txt → Sorts the contents of text5.txt.
                  • file → Show file type

                  4. Searching within Files
                  • grep "name" text5.txt → Searches for the word "name" in text5.txt.
                  • egrep "name" text5.txt → Similar to grep, but supports extended regular expressions.

                  5. File Redirection and Output Handling
                  • pwd > pwd.txt → Saves the output of pwd into pwd.txt.
                  • history > command.txt → Saves the command history into command.txt.
                  • pwd 2> pwd.txt → Redirects error output to pwd.txt.
                  • cat abc 2> pwd.txt → Redirects error messages when trying to read abc to pwd.txt.

                  6. Process and System Monitoring
                  • top → Displays active system processes.
                  • ps → Shows running processes.
                  • ps -ef → Displays all running processes with full details.
                  • kill 1595 → Terminates the process with PID 1595.
                  • alias ll='ls -lah’ → An alias is a shortcut for a command or a series of commands in Linux.

                  7. Network Commands
                  • ip → Displays network interfaces and IP addresses.
                  • ifconfig → Shows network interface configuration.
                  • ping www.google.com → Checks connectivity to Google.
                  • ping 8.8.8.8 → Checks connectivity to Google's public DNS.
                  • netstat → Displays network connections.
                  • netstat -l → Shows listening ports.
                  • netstat -putan | grep 22 → Finds active processes using port 22.
                  • curl → Fetches data from a URL.
                  • curl --help → Displays help for the curl command.
                  • telnet → Connects to remote servers via Telnet.

                  8. System Services and Crontab
                  • crontab -i → Edits the cron jobs interactively.
                  • crontab -u randon -i → Modifies cron jobs for user randon.
                  • systemctl status ssh → Checks the status of the SSH service.
                  • systemctl start ssh.service → Starts the SSH service.
                  • systemctl status https → Checks the status of the HTTPS service.
                  • systemctl restart http.service → Restarts the HTTP service.

                  9. File Deletion and Shredding
                  • shred -u text3.txt → Securely deletes text3.txt.
                  • shred --remove testfile.txt → Securely deletes testfile.txt.

                  10. Command History Management
                  • history → Displays a list of previously executed commands.
                  • history > history.txt → Saves command history into history.txt.

                  9.2 Linux Concepts

                  • The Kernel is the core component of the Linux operating system. It acts as a bridge between the hardware and software, managing system resources like memory, CPU, and device drivers.
                  • Swap Space is a portion of the hard disk used as virtual memory when the system runs out of physical RAM.
                  • Runlevel defines the state of the system and determines which services and processes are running.
                    • Different runlevels help optimize performance, security, and troubleshooting.
                    • Servers often run in Runlevel 3 (without GUI) to save resources.
                    • Desktops use Runlevel 5 (GUI Mode) for a graphical experience.
                  • The Linux system boot process starts with POST (Power-On Self-Test) to check hardware components, followed by the bootloader loading the kernel into memory, which then initializes hardware drivers, memory management, and system processes before finally loading startup services, mounting file systems, and launching the GUI or command-line login prompt.

                  9.3 Permission Structure:

                  Each file/directory has three permission groups:
                  1. User (Owner)
                  1. Group (Users in the same group)
                  1. Others (Everyone else)
                  Permissions are represented as:
                  Symbol
                  Permission
                  Numeric Value
                  r
                  Read
                  4
                  w
                  Write
                  2
                  x
                  Execute
                  1
                  check permision ls -l text5.txt
                  modify permissionchmod 755 file.txt
                  • User (Owner) → 7 (rwx) → Read, write, execute.
                  • Group → 5 (r-x) → Read, execute, no write.
                  • Others → 5 (r-x) → Read, execute, no write.

                  9.4 Ownership

                  Change ownership sudo chown alice:staff file.txt both owner and group
                  1️⃣A file owner may not always have full access to their file, as permissions (rwx) determine what they can do.
                  2️⃣ However, if the owner wants, they can grant themselves full access by modifying the file permissions using chmod.
                  3️⃣ Root is not the default owner of all files, but it has full control and can modify, access, or change ownership of any file in the system.

                  9.5 Process and Thread

                  • A process is an independent program running on a computer with its own memory space.
                    • For CPU-intensive tasks, use multi-processing.
                  • A thread is a lightweight process that runs within a process and shares the same memory (heap, code, files) with other threads in the same process.
                    • For threads for I/O-heavy tasks, use multi-thread.

                  10 IP Address and DHCP

                  10.1 Summary of IPv4 Classes

                  Public IP Range
                  Private IP Range
                  Subnet Mask
                  # of Networks
                  # of Hosts per Network
                  Class A
                  1.0.0.0 to127.0.0.0
                  10.0.0.0 to10.255.255.255
                  255.0.0.0
                  126
                  16,777,214
                  Class B
                  128.0.0.0 to191.255.0.0
                  172.16.0.0 to172.31.255.255
                  255.255.0.0
                  16,382
                  65,534
                  Class C
                  192.0.0.0 to223.255.255.0
                  192.168.0.0 to192.168.255.255
                  255.255.255.0
                  2,097,150
                  254

                  10.2 When a device (client) connects to a network, it follows these 4 DHCP steps:

                  Step
                  Description
                  1️⃣ DHCP Discover
                  Client broadcasts a request (Who can give me an IP?).
                  2️⃣ DHCP Offer
                  Server responds with an available IP address and settings.
                  3️⃣ DHCP Request
                  Client accepts the offered IP and requests to use it.
                  4️⃣ DHCP Acknowledgment (ACK)
                  Server confirms, and client starts using the assigned IP.
                  ip dhcp snooping: Blocks rogue DHCP servers by allowing only trusted DHCP traffic on specific ports.
                  VPC (Virtual Private Cloud) in AWS is a private, isolated network where you can launch and manage AWS resources (e.g., EC2, RDS, Lambda) with customized IP addressing, subnets, routing, and security settings. ROUTE 53
                   
                  My Global Network Engineer Projects Suffering in the Jiabiangou Labor Camp: by Xianhui Yang