Network Diagrams¶
Interface Types¶
Physical Interface¶
┌─────────────────────────────────────────────────┐
│ Physical NIC │
│ │
│ enp5s0 │
│ 192.168.1.100/24 │
│ │
└─────────────────────────────────────────────────┘
│
│
To Network
Bridge¶
┌─────────────────────────────────────────────────────────────────┐
│ Bridge (br0) │
│ 192.168.1.100/24 │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ eth0 │ │ vnet0 │ │ vnet1 │ │
│ │(physical)│ │ (VM1) │ │ (VM2) │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
└─────────┼───────────────┼───────────────┼───────────────────────┘
│ │ │
To Network VM1 VM2
Bond¶
┌─────────────────────────────────────────────────────────────────┐
│ Bond (bond0) │
│ 192.168.1.100/24 │
│ Mode: 802.3ad │
│ │
│ ┌──────────────────┐ ┌──────────────────┐ │
│ │ eth0 │ │ eth1 │ │
│ │ (1 Gbps NIC) │ │ (1 Gbps NIC) │ │
│ └────────┬─────────┘ └────────┬─────────┘ │
└─────────────┼───────────────────────────┼───────────────────────┘
│ │
└───────────┬───────────────┘
│
LACP Switch
(2 Gbps combined)
VLAN¶
┌─────────────────────────────────────────────────────────────────┐
│ Physical Interface (eth0) │
│ Trunk Port (Tagged) │
│ │
│ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │
│ │ eth0.10 │ │ eth0.20 │ │ eth0.30 │ │
│ │ VLAN ID: 10 │ │ VLAN ID: 20 │ │ VLAN ID: 30 │ │
│ │ 10.10.0.100/24 │ │ 10.20.0.100/24 │ │ 10.30.0.100/24 │ │
│ └────────────────┘ └────────────────┘ └────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│
Trunk Port
To Switch
Complex Topologies¶
Bond + VLAN + Bridge¶
┌───────────────────────────────────────────────────────────────────────────┐
│ Server │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Bond (bond0) │ │
│ │ Mode: 802.3ad │ │
│ │ ┌────────────┐ ┌────────────┐ │ │
│ │ │ eth0 │ │ eth1 │ │ │
│ │ └─────┬──────┘ └─────┬──────┘ │ │
│ └──────────┼─────────────────────────────────┼─────────────────────────┘ │
│ └────────────────┬────────────────┘ │
│ │ │
│ ┌───────────────────────────┼───────────────────────────────────────────┐ │
│ │ VLANs on bond0 │ │
│ │ ┌───────────┐ ┌───────────┐ ┌───────────┐ │ │
│ │ │ bond0.10 │ │ bond0.20 │ │ bond0.100 │ │ │
│ │ │ VLAN 10 │ │ VLAN 20 │ │ VLAN 100 │ │ │
│ │ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ │ │
│ └──────────┼────────────────┼────────────────┼──────────────────────────┘ │
│ │ │ │ │
│ ┌──────────┼────────────────┼────────────────┼──────────────────────────┐ │
│ │ Bridges │ │ │ │
│ │ ┌───────┴───────┐ ┌─────┴─────┐ ┌───────┴───────┐ │ │
│ │ │ br-mgmt │ │ br-vms │ │ br-storage │ │ │
│ │ │ 10.10.0.100/24│ │ (no IP) │ │10.100.0.100/24│ │ │
│ │ │ Management │ │ VMs │ │ Storage │ │ │
│ │ │ │ │ connect │ │ MTU 9000 │ │ │
│ │ │ │ │ here │ │ │ │ │
│ │ └───────────────┘ └───────────┘ └───────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
└───────────────────────────────────────────────────────────────────────────┘
Multi-Path Server¶
┌────────────────────────────────────────────────────────────────────────────┐
│ Server │
│ │
│ Management Application Storage Backup │
│ Network Network Network Network │
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │ eth0 │ │ eth1 │ │ eth2 │ │ eth3 │ │
│ │10.1.0.1│ │10.2.0.1│ │10.3.0.1│ │10.4.0.1│ │
│ │ /24 │ │ /24 │ │ /24 │ │ /24 │ │
│ │ │ │ │ │MTU 9000│ │ │ │
│ └───┬────┘ └───┬────┘ └───┬────┘ └───┬────┘ │
│ │ │ │ │ │
└───────┼──────────────────┼───────────────────┼──────────────────┼───────────┘
│ │ │ │
┌────┴────┐ ┌────┴────┐ ┌────┴────┐ ┌────┴────┐
│ Mgmt │ │ App │ │ Storage │ │ Backup │
│ Switch │ │ Switch │ │ Switch │ │ Switch │
│VLAN 10 │ │VLAN 20 │ │VLAN 100 │ │VLAN 200 │
└─────────┘ └─────────┘ └─────────┘ └─────────┘
VPN Topology¶
Internet
│
│
┌──────────────────────────────┼───────────────────────────────────┐
│ VPN Server │
│ 203.0.113.10 │
│ │ │
│ ┌────┴────┐ │
│ │ eth0 │ │
│ │ Public │ │
│ └────┬────┘ │
│ │ │
│ ┌────┴────┐ │
│ │ wg0 │ │
│ │10.10.0.1│ │
│ │ WireGuard│ │
│ └─────────┘ │
│ │ │
└──────────────────────────────┼───────────────────────────────────┘
│
┌────────────────────┼────────────────────┐
│ │ │
┌────┴────┐ ┌────┴────┐ ┌────┴────┐
│Client 1 │ │Client 2 │ │Site 3 │
│10.10.0.2│ │10.10.0.3│ │10.10.0.4│
│ │ │ │ │10.20.0/24│
└─────────┘ └─────────┘ └─────────┘
Container/VM Host¶
┌────────────────────────────────────────────────────────────────────────────┐
│ Hypervisor Host │
│ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ Host Networking (Netplan) │ │
│ │ │ │
│ │ ┌──────────────┐ ┌──────────────┐ │ │
│ │ │ br0 │ │ docker0 │ │ │
│ │ │192.168.1.100 │ │ 172.17.0.1 │ │ │
│ │ │ (VMs/LXD) │ │ (Docker) │ │ │
│ │ └──────┬───────┘ └──────┬───────┘ │ │
│ │ │ │ │ │
│ │ ┌──────┴───────┐ │ │ │
│ │ │ eth0 │ │ │ │
│ │ │ (Physical) │ │ │ │
│ │ └──────┬───────┘ │ │ │
│ └──────────┼──────────────────────────────────────────┼─────────────────┘ │
│ │ │ │
│ ┌──────────┼──────────────────────────────────────────┼─────────────────┐ │
│ │ │ Guests │ │ │
│ │ ┌─────┴─────┐ ┌───────────┐ ┌───────────┐ │ ┌─────────────┐ │ │
│ │ │ VM 1 │ │ VM 2 │ │ LXD 1 │ │ │ Container 1 │ │ │
│ │ │.168.1.101 │ │.168.1.102 │ │.168.1.103 │ │ │ 172.17.0.2 │ │ │
│ │ └───────────┘ └───────────┘ └───────────┘ │ └─────────────┘ │ │
│ │ Connected to br0 │ Docker network │ │
│ └─────────────────────────────────────────────────────┴─────────────────┘ │
└───────────────────────────────────────────────────────────────────────────────┘
│
To Network
Traffic Flow¶
NAT Flow (Default Docker/VM)¶
Internet
│
▼
┌──────────────────────────────────────────────────────────┐
│ Host │
│ │
│ eth0 (192.168.1.100) │
│ │ │
│ │ ◄──── DNAT (inbound to container) │
│ │ ────► SNAT/MASQUERADE (outbound) │
│ │ │
│ ┌─────┴─────┐ │
│ │ iptables │ NAT Table │
│ │ rules │ │
│ └─────┬─────┘ │
│ │ │
│ ┌─────┴─────┐ │
│ │ docker0 │ 172.17.0.1 │
│ │ bridge │ │
│ └─────┬─────┘ │
│ │ │
│ ┌─────┴─────┐ │
│ │ Container │ 172.17.0.2 │
│ │ │ │
│ └───────────┘ │
└──────────────────────────────────────────────────────────┘
Bridged Flow (Direct Access)¶
Switch
│
┌──────────┴──────────┐
│ │
▼ ▼
┌──────────────────────────────────────────────────────────┐
│ Host │
│ │
│ ┌───────────────────────────┐ │
│ │ Bridge (br0) │ │
│ │ │ │
│ ┌──────────┴──────────┬────────────────┴──────────┐ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ eth0 vnet0 vnet1 │
│ (physical) (VM1) (VM2) │
│ .168.1.101 .168.1.102│
└──────────────────────────────────────────────────────────┘
All traffic passes through switch - VMs are on same L2 as physical network
Policy Routing Flow¶
Packet arrives
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Policy Rule Check │
│ │
│ Rule 100: from 10.0.0.0/8 → table 100 │
│ Rule 200: from 192.168.0.0/16 → table 200 │
│ Rule 32766: from all → table main │
│ │
└─────────────────────────────────┬───────────────────────────┘
│
┌────────────────────────┼────────────────────────┐
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Table 100│ │ Table 200│ │Table main│
│ │ │ │ │ │
│default │ │default │ │default │
│via ISP1 │ │via ISP2 │ │via ISP1 │
└──────────┘ └──────────┘ └──────────┘
│ │ │
▼ ▼ ▼
ISP 1 ISP 2 ISP 1
Quick Reference Diagrams¶
Common Port Assignments¶
┌────────────────────────────────────────────────────────────┐
│ Common Services │
├────────────────────────────────────────────────────────────┤
│ 22/TCP - SSH │
│ 80/TCP - HTTP │
│ 443/TCP - HTTPS │
│ 3306/TCP - MySQL │
│ 5432/TCP - PostgreSQL │
│ 6379/TCP - Redis │
│ 8080/TCP - HTTP Alt │
│ 51820/UDP - WireGuard │
└────────────────────────────────────────────────────────────┘
CIDR Quick Reference¶
┌────────────────────────────────────────────────────────────┐
│ CIDR Reference │
├────────────────────────────────────────────────────────────┤
│ /32 - 1 host │
│ /30 - 4 hosts (2 usable) - point-to-point │
│ /29 - 8 hosts (6 usable) │
│ /28 - 16 hosts (14 usable) │
│ /27 - 32 hosts (30 usable) │
│ /24 - 256 hosts (254 usable) - common subnet │
│ /16 - 65,536 hosts - class B │
│ /8 - 16,777,216 hosts - class A │
└────────────────────────────────────────────────────────────┘
Private IP Ranges¶
┌────────────────────────────────────────────────────────────┐
│ RFC1918 Private Ranges │
├────────────────────────────────────────────────────────────┤
│ 10.0.0.0/8 (10.0.0.0 - 10.255.255.255) │
│ 172.16.0.0/12 (172.16.0.0 - 172.31.255.255) │
│ 192.168.0.0/16 (192.168.0.0 - 192.168.255.255) │
│ │
│ Link-Local: 169.254.0.0/16 │
│ Loopback: 127.0.0.0/8 │
└────────────────────────────────────────────────────────────┘