Network Cheat Sheet: IPv4, IPv6, CIDR, and Subnetting Basics

Listen to this Post

Featured Image

Comprehensive List of IPv4 Commands (Windows, Linux, macOS)

Windows IPv4 Commands

ipconfig  Display IP configuration 
ipconfig /all  Detailed network info 
ipconfig /release  Release DHCP lease 
ipconfig /renew  Renew DHCP lease 
netsh interface ip show config  Show interface IP config 

Linux IPv4 Commands

ifconfig  Display network interfaces (deprecated, use ip) 
ip addr show  Show IP addresses (modern alternative) 
ip route  Display routing table 
nmcli device show  NetworkManager details (if used) 

macOS IPv4 Commands

ifconfig  Show network interfaces 
netstat -rn  Display routing table 
scutil --dns  Check DNS configuration 

Network Diagnostic Commands (All Platforms)

Ping & Traceroute

ping google.com  Basic connectivity test 
traceroute google.com  Linux/macOS - trace network path 
tracert google.com  Windows - trace network path 

DNS & Port Checks

nslookup google.com  DNS query (Windows/Linux) 
dig google.com  Advanced DNS lookup (Linux/macOS) 
netstat -tuln  List listening ports (Linux/macOS) 

IPv6 Commands

ip -6 addr show  Linux - show IPv6 addresses 
netsh interface ipv6 show addresses  Windows IPv6 config 
ifconfig | grep inet6  macOS/Linux - filter IPv6 

CIDR & Subnetting Basics

Calculate Subnets

 Example: Split 192.168.1.0/24 into /26 subnets 
Subnet Mask: 255.255.255.192 
Subnets: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/26 

Check Subnet Membership (Linux)

ipcalc 192.168.1.50/26  Verify if IP is in subnet 

You Should Know:

Advanced Linux Networking

ss -tuln  Modern replacement for netstat 
tcptraceroute google.com  TCP-based traceroute 
mtr google.com  Real-time network diagnostic tool 

Windows PowerShell Networking

Test-NetConnection google.com -Port 80  Check port connectivity 
Get-NetIPConfiguration  Detailed IP info 
Resolve-DnsName google.com  PowerShell DNS lookup 

Subnetting Practice

 Calculate number of hosts per subnet: 
 Formula: 2^(32 - CIDR) - 2 
 Example: /24 = 254 hosts, /26 = 62 hosts 

What Undercode Say

Mastering IPv4, IPv6, CIDR, and subnetting is essential for network security and administration. Use `tcpdump` for packet analysis (tcpdump -i eth0), `nmap` for network scanning (nmap -sP 192.168.1.0/24), and `iptables` for firewall rules. Windows admins should learn `netsh advfirewall` for firewall management. Always verify routes (route -n in Linux, `route print` in Windows) and test DNS propagation (dig +trace google.com).

Expected Output:

– `ip addr show` → Displays all network interfaces and IPs.
– `ping -c 4 google.com` → Sends 4 ICMP packets to Google.
– `nmap -p 22,80,443 target_ip` → Scans common ports on a target.
– `ip route add 10.0.0.0/8 via 192.168.1.1` → Adds a static route.

For further reading:

References:

Reported By: Activity 7321578831377539072 – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 Telegram