ufw allow port from ip code example
Example 1: enable ufw ubuntu
sudo ufw enable
Example 2: ufw allow port
sudo ufw allow http
sudo ufw allow 80
Example 3: allow ip through ufw
sudo ufw allow from 15.15.15.0/24 to any port 22
Example 4: iptables allow port from anywhere
sudo iptables -A INPUT -p tcp -m multiport --dports 80,443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp -m multiport --dports 80,443 -m conntrack --ctstate ESTABLISHED -j ACCEPT