Web Hosting & VPS Tips

Unleash Your Server Potential with Expert Insights

Hosting provided by: Cloudways
Free to Try! Up to 40% Off!

Category: VPS Setup

Set up UFW route rules on Ubuntu—install with
apt install ufw
then edit /etc/ufw/before rules with
nano /etc/ufw/before.rules
adding before *filter:
*nat\n:POSTROUTING ACCEPT [0:0]\n-A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE\nCOMMIT
Enable IP forwarding in /etc/sysctl conf with net ipv4 ip_forward=1 apply with
sysctl -p
and allow SSH with
ufw allow 22
Enable with
ufw enable
On Vultr this routes internal traffic—test with
iptables -t nat -L
expecting \"MASQUERADE\" ensuring MySQL and FTP uptime in multi-NIC setups

Back to All Tips