KEMBAR78
Linux_Networking_for_DevOps_Lecture1.pptx.pdf
Linux & Networking for DevOps
Engineers
From Shell to Systems
Engr. Akum Blaise
DevOps Engineer, Gozem Africa
Why This Matters for DevOps
• Linux and networking form the foundation of
DevOps.
• Cloud platforms, containers, and automation
tools all rely on them.
• Understanding these topics makes you a
better engineer and problem solver.
Lecture Roadmap
• 1. Linux Advanced: Shell scripting, Logging,
Cron
• 2. Networking Basics: IPs, Ports, SSH, DNS
• 3. Advanced Networking: Firewalls, Proxies,
Load Balancers
• All hands-on tasks will be done directly on
your Ubuntu VM.
What is a Shell Script?
• A shell script is a text file containing
commands.
• It automates tasks you would normally run
manually.
• Why it matters: DevOps relies on automation
for deployments, backups, and monitoring.
Basic Shell Script Example
• #!/bin/bash
• echo 'System Info:'
• date
• uptime
• free -h
• Run with: chmod +x script.sh && ./script.sh
Task: Write Your Own Script
• Write a script that:
• - Shows CPU, RAM, and disk usage
• - Saves the output into a file called
system_report.txt
• Run the script on your Ubuntu VM.
System Logging
• Logs capture important events.
• Locations: /var/log and journalctl.
• Why important: Troubleshooting crashes,
failed logins, and monitoring system health.
Task: Explore Logs
• On your VM, check logs for:
• - Failed logins (auth.log)
• - Kernel messages (dmesg)
• - System events (journalctl)
• Explain what you found.
Cron Jobs
• Cron automates recurring tasks.
• Examples: backups, monitoring scripts,
cleanup jobs.
• Why it matters: Automates repetitive work in
DevOps.
Setting up Cron
• Use crontab -e to add jobs.
• Example: */5 * * * * /home/user/myscript.sh
• Runs myscript.sh every 5 minutes.
Task: Cron + Script
• Write a shell script that logs CPU usage to a
file.
• Set up a cron job to run it every 5 minutes.
• Check results in the file after 15 minutes.
IP Addresses
• IP addresses uniquely identify devices on a
network.
• IPv4: 192.168.1.10 (private)
• IPv6: newer, larger address space.
• In the cloud: servers use private IPs internally
and public IPs externally.
Task: Find Your IP
• Run: ip a
• Find your VM’s private IP.
• Ping google.com to test connectivity.
Ports & Services
• Ports allow multiple services on one machine.
• Examples:
• 22 → SSH
• 80 → HTTP
• 443 → HTTPS
• In DevOps, open ports expose applications to
the internet.
Task: Open Ports
• Run: ss -tuln
• See which services are listening.
• Check how ports change when you start/stop
services.
DNS
• DNS translates domain names to IPs.
• Why important: Users don’t remember IPs.
• DevOps: Configure DNS for apps, troubleshoot
issues.
Task: Fake DNS Entry
• Edit /etc/hosts:
• 127.0.0.1 myapp.local
• Ping myapp.local → should resolve to
127.0.0.1.
SSH & SFTP
• SSH: Secure remote login to servers.
• SFTP: Secure file transfer.
• Why important: All DevOps/cloud work is
remote.
• SSH is the entry point to servers.
Task: SSH Between VMs
• SSH from one VM to another.
• Create a file remotely to confirm it works.
• Use SFTP to transfer a text file between VMs.
Firewalls
• Firewalls control traffic into/out of a system.
• Linux tools: ufw, iptables.
• In cloud: firewalls protect servers from
attacks.
Task: Configure Firewall
• On Ubuntu VM:
• sudo ufw allow ssh
• sudo ufw deny 8080
• sudo ufw enable
• Check: sudo ufw status
Proxies
• Proxies forward requests between clients and
servers.
• Uses: caching, filtering, hiding internal
networks.
• In DevOps: reverse proxies distribute requests
to microservices.
Load Balancers
• Load balancers distribute traffic across
multiple servers.
• Why important: scalability, reliability.
• In cloud: ELB (AWS), Azure LB, Nginx, HAProxy.
Visual: Load Balancer
• Client → Load Balancer → Server A + Server B
• Requests are split for performance and
reliability.
Task: Simulate Load Balancer
• Run Nginx on 2 VMs.
• Use a third VM as a reverse proxy.
• Test requests distribute across servers.
Wrap-Up
• We covered:
• - Shell scripting, logging, cron
• - Networking essentials: IP, DNS, SSH
• - Advanced networking: firewalls, proxies, load
balancers
• Assignment: Document your scripts, cron jobs,
and networking tasks.
• Push to GitHub.

Linux_Networking_for_DevOps_Lecture1.pptx.pdf

  • 1.
    Linux & Networkingfor DevOps Engineers From Shell to Systems Engr. Akum Blaise DevOps Engineer, Gozem Africa
  • 2.
    Why This Mattersfor DevOps • Linux and networking form the foundation of DevOps. • Cloud platforms, containers, and automation tools all rely on them. • Understanding these topics makes you a better engineer and problem solver.
  • 3.
    Lecture Roadmap • 1.Linux Advanced: Shell scripting, Logging, Cron • 2. Networking Basics: IPs, Ports, SSH, DNS • 3. Advanced Networking: Firewalls, Proxies, Load Balancers • All hands-on tasks will be done directly on your Ubuntu VM.
  • 4.
    What is aShell Script? • A shell script is a text file containing commands. • It automates tasks you would normally run manually. • Why it matters: DevOps relies on automation for deployments, backups, and monitoring.
  • 5.
    Basic Shell ScriptExample • #!/bin/bash • echo 'System Info:' • date • uptime • free -h • Run with: chmod +x script.sh && ./script.sh
  • 6.
    Task: Write YourOwn Script • Write a script that: • - Shows CPU, RAM, and disk usage • - Saves the output into a file called system_report.txt • Run the script on your Ubuntu VM.
  • 7.
    System Logging • Logscapture important events. • Locations: /var/log and journalctl. • Why important: Troubleshooting crashes, failed logins, and monitoring system health.
  • 8.
    Task: Explore Logs •On your VM, check logs for: • - Failed logins (auth.log) • - Kernel messages (dmesg) • - System events (journalctl) • Explain what you found.
  • 9.
    Cron Jobs • Cronautomates recurring tasks. • Examples: backups, monitoring scripts, cleanup jobs. • Why it matters: Automates repetitive work in DevOps.
  • 10.
    Setting up Cron •Use crontab -e to add jobs. • Example: */5 * * * * /home/user/myscript.sh • Runs myscript.sh every 5 minutes.
  • 11.
    Task: Cron +Script • Write a shell script that logs CPU usage to a file. • Set up a cron job to run it every 5 minutes. • Check results in the file after 15 minutes.
  • 12.
    IP Addresses • IPaddresses uniquely identify devices on a network. • IPv4: 192.168.1.10 (private) • IPv6: newer, larger address space. • In the cloud: servers use private IPs internally and public IPs externally.
  • 13.
    Task: Find YourIP • Run: ip a • Find your VM’s private IP. • Ping google.com to test connectivity.
  • 14.
    Ports & Services •Ports allow multiple services on one machine. • Examples: • 22 → SSH • 80 → HTTP • 443 → HTTPS • In DevOps, open ports expose applications to the internet.
  • 15.
    Task: Open Ports •Run: ss -tuln • See which services are listening. • Check how ports change when you start/stop services.
  • 16.
    DNS • DNS translatesdomain names to IPs. • Why important: Users don’t remember IPs. • DevOps: Configure DNS for apps, troubleshoot issues.
  • 17.
    Task: Fake DNSEntry • Edit /etc/hosts: • 127.0.0.1 myapp.local • Ping myapp.local → should resolve to 127.0.0.1.
  • 18.
    SSH & SFTP •SSH: Secure remote login to servers. • SFTP: Secure file transfer. • Why important: All DevOps/cloud work is remote. • SSH is the entry point to servers.
  • 19.
    Task: SSH BetweenVMs • SSH from one VM to another. • Create a file remotely to confirm it works. • Use SFTP to transfer a text file between VMs.
  • 20.
    Firewalls • Firewalls controltraffic into/out of a system. • Linux tools: ufw, iptables. • In cloud: firewalls protect servers from attacks.
  • 21.
    Task: Configure Firewall •On Ubuntu VM: • sudo ufw allow ssh • sudo ufw deny 8080 • sudo ufw enable • Check: sudo ufw status
  • 22.
    Proxies • Proxies forwardrequests between clients and servers. • Uses: caching, filtering, hiding internal networks. • In DevOps: reverse proxies distribute requests to microservices.
  • 23.
    Load Balancers • Loadbalancers distribute traffic across multiple servers. • Why important: scalability, reliability. • In cloud: ELB (AWS), Azure LB, Nginx, HAProxy.
  • 24.
    Visual: Load Balancer •Client → Load Balancer → Server A + Server B • Requests are split for performance and reliability.
  • 25.
    Task: Simulate LoadBalancer • Run Nginx on 2 VMs. • Use a third VM as a reverse proxy. • Test requests distribute across servers.
  • 26.
    Wrap-Up • We covered: •- Shell scripting, logging, cron • - Networking essentials: IP, DNS, SSH • - Advanced networking: firewalls, proxies, load balancers • Assignment: Document your scripts, cron jobs, and networking tasks. • Push to GitHub.