Skip to content

Networking Basics You Should Know as a DevOps Engineer 🌐🚀

What is an IP? 🌍

An IP (Internet Protocol) address is like your device's home address on the internet. It helps in identifying and locating devices connected to a network.

Clearing the confusion between Public and Private IP or Network 🕵️‍♂️🔍

Private IP: Definition 🏡

A Private IP address is used within a private network. These addresses are not routable on the internet, meaning they only work within the local network (LAN).

Private IP Ranges 📏

  • 10.0.0.0 to 10.255.255.255 - CLASS A
  • 172.16.0.0 to 172.31.255.255 - CLASS B
  • 192.168.0.0 to 192.168.255.255 - CLASS C

Public IP: Definition 🌐

A Public IP address is used to identify devices on the internet. These addresses are routable on the global internet.

Public IP Example 🌍

Any IP address that is not in the private IP ranges mentioned above is a public IP address. For example, 8.8.8.8 (Google's DNS).

What is an Invalid IP? ❌

An Invalid IP address is one that does not conform to the rules of IP address allocation. For instance, an IP address where any octet exceeds 255 is invalid.

Explanation: Crossing 8 Bits 💡

IP addresses are divided into four octets, each ranging from 0 to 255 (8 bits). If any octet crosses 255, it's invalid.

Invalid IP Examples ❌

  • 256.100.50.25
  • 192.300.1.1

What is a Subnet? 🌐➗

A Subnet (Subnetwork) divides a larger network into smaller, more manageable pieces. It improves network performance and security.

What is a Public Network? 🌐

A Public Network is a network where devices are connected to the internet and can communicate with other devices globally.

What is a Private Network? 🏡

A Private Network is a network where devices are connected within a limited scope, like a home or office, and cannot be accessed from the global internet.

Difference between Public and Private Networks 🌐 vs. 🏡

  • Public Network: Global, accessible via the internet, less secure.
  • Private Network: Local, not accessible via the internet, more secure.

What is VPN? 🛡️

A VPN (Virtual Private Network) creates a secure, encrypted connection over a less secure network, like the internet. It ensures privacy and security.

What is a Bastion Host? 🛡️🖥️

A Bastion Host is a special-purpose computer on a network specifically designed to withstand attacks. It typically acts as a gateway between a public and private network.

What is VPN Peering? 🔗🛡️

VPN Peering connects two VPN networks, allowing secure communication between them. It extends the private network across the internet securely.

Calculating CIDR for an IP Address 📏🔍

CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and IP routing. A CIDR notation consists of an IP address followed by a slash (/) and a number (prefix length). This number represents the number of significant bits in the subnet mask.

Steps to Calculate CIDR for an IP Address

  1. Identify the IP Address and Subnet Mask 📝
  2. Example: IP Address: 192.168.1.10
  3. Subnet Mask: 255.255.255.0

  4. Convert the Subnet Mask to Binary 🔢

  5. Subnet Mask: 255.255.255.0
  6. Binary: 11111111.11111111.11111111.00000000

  7. Count the Number of '1' Bits in the Binary Subnet Mask 🔍

  8. 11111111.11111111.11111111.00000000 has 24 '1' bits.

  9. Write the CIDR Notation 🖊️

  10. The CIDR notation is the IP address followed by a slash and the number of '1' bits in the subnet mask.
  11. Example: 192.168.1.10/24

Example Calculation with Detailed Steps

Step 1: Identify the IP Address and Subnet Mask
  • IP Address: 192.168.1.10
  • Subnet Mask: 255.255.255.0
Step 2: Convert the Subnet Mask to Binary
  • Decimal to Binary:
  • 255 -> 11111111
  • 255 -> 11111111
  • 255 -> 11111111
  • 0 -> 00000000
  • Combined Binary: 11111111.11111111.11111111.00000000
Step 3: Count the Number of '1' Bits
  • Count of '1' bits: 24
Step 4: Write the CIDR Notation
  • CIDR Notation: 192.168.1.10/24

Choosing a Subnet Mask

The choice of subnet mask depends on the size and structure of the network. Here are a few considerations:

  • Small Network: Use a subnet mask like 255.255.255.0 (/24) for small networks where you need up to 254 hosts.
  • Medium Network: Use a subnet mask like 255.255.0.0 (/16) for medium-sized networks where you need up to 65,534 hosts.
  • Large Network: Use a subnet mask like 255.0.0.0 (/8) for large networks where you need up to 16,777,214 hosts.

Example: Changing Subnet Masks for Different Needs

Example 1: Small Office Network
  • IP Address: 192.168.1.0
  • Subnet Mask: 255.255.255.0
  • CIDR Notation: 192.168.1.0/24
  • Number of Hosts: 254
Example 2: Large Corporate Network
  • IP Address: 10.0.0.0
  • Subnet Mask: 255.0.0.0
  • CIDR Notation: 10.0.0.0/8
  • Number of Hosts: 16,777,214

By choosing the appropriate subnet mask, you can efficiently allocate IP addresses and design networks that meet the specific needs of your environment.

Conclusion

Understanding these networking basics will help you navigate the complexities of network configurations and enhance your DevOps skills! 🌟🚀