Ravindra BagaleCourses & study guides मराठी Track your progress

1. IP Addressing: IPv4, Subnets, Public and Private IPs

1.6 Static vs Dynamic IP and DHCP

Ghari Wi-Fi la connect kelyavar tumhi IP type karta ka? Nahi na? To DHCP deto. Server la matra fix address lagto. Chala baghu farak.

Feature Static IP Dynamic IP
Assigned by Manually by an admin (or reserved) Automatically by a DHCP server
Changes? Never, unless changed manually May change on reboot / lease expiry
Best for Servers, DNS records, printers, VPN endpoints Laptops, phones, home users
Cost Often extra (ISPs charge) Usually included
AWS equivalent Elastic IP Auto-assigned public IPv4

DHCP (Dynamic Host Configuration Protocol) hands out IP address, subnet mask, default gateway and DNS server in four steps: Discover → Offer → Request → Acknowledge (DORA).

  Client (no IP yet)                         DHCP server (router)
        |  1. DISCOVER  (broadcast: "any DHCP server?")   |
        | ------------------------------------------------> |
        |  2. OFFER     ("take 192.168.1.23")               |
        | <------------------------------------------------ |
        |  3. REQUEST   ("I want 192.168.1.23")             |
        | ------------------------------------------------> |
        |  4. ACK       ("done, lease 24 h, gw .1, dns .1") |
        | <------------------------------------------------ |

Why this matters for security

Because DHCP trusts the first answer, an attacker on the same LAN can run a rogue DHCP server and hand out their own machine as the gateway or DNS server – a classic man-in-the-middle setup. Switches defend with DHCP snooping. On the server side, anything that must be reachable or referenced in DNS needs a static address (on AWS, an Elastic IP).

Ravindra Bagale's Tip

Many students put an EC2 instance's auto-assigned public IP in DNS, stop the instance at night, and in the morning the website is down! The public IP changes after a stop/start. Give an Elastic IP to anything that needs a fixed address – we'll do this hands-on in Part 6. Remember this.

Practice task

On Windows run ipconfig /all and find DHCP Enabled, Lease Obtained and DHCP Server. On Linux run ip route and note your default gateway.

Extended teaching notes

Why this lesson matters

Malware analysis in this course is defensive: recognise indicators, isolate hosts, preserve evidence. Never run unknown malware on your main OS or on someone else's network.

  1. Isolate the host from the network.
  2. Capture volatile data if trained to do so.
  3. Hash samples; search only in licensed/safe tools.
  4. Rebuild from a known-good image when unsure.
  5. Share IOCs with your SOC, not on random chats.

Mini case study

Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.

Defender's worksheet (do this today)

  1. Write the lesson title, date and the exact lab target you are allowed to use.
  2. List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
  3. Run one safe check from the lesson on a lab system only. Paste the command and output.
  4. Write a two-sentence fix you would give a teammate.
  5. Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.

Indian workplace (sample data)

Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).

Global practice

Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.

Everyday analogy

Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.

Key terms

  • Control: a safeguard (patch, config, process, detection).
  • Finding: a weakness backed by evidence.
  • Remediation: the fix plus how you verified it.
  • Scope: systems you have written permission to touch.
  • Least privilege: only the access the task needs.
  • Defence in depth: several layers so one failure does not end the story.

Common mistakes

  • Skipping written permission "just for a quick scan".
  • Practising on hostel, office or public targets without authorisation.
  • Collecting tool output without writing the fix.
  • Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
  • Publishing screenshots that contain secrets, cookies or internal hostnames.

Recap

  • Evidence, fix, owner, date.
  • Own lab only.
  • Fix > spectacle.