NAT: What Network Address Translation Is and How It Works

VDS / VPS Servers · 19.04.2026
NAT: What Network Address Translation Is and How It Works

NAT (Network Address Translation) lets many devices with private IPs share one public IP to access the internet.

NAT Types

TypeDirectionUse Case
SNAT/MasqueradeOutboundLAN internet access
DNATInboundPort forwarding

iptables NAT Setup

# Enable IP forwarding
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward

# Masquerade (LAN → internet)
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

# Port forwarding (DNAT)
sudo iptables -t nat -A PREROUTING -p tcp --dport 80     -j DNAT --to-destination 192.168.1.10:80
💡 ZevsHost VDS: All VDS servers come with a dedicated public IPv4 — essential for mail servers, VPN, and game servers.
← Back to Knowledge Base Ask Support