I've recently been exploring Oracle's Cloud offerings while looking to migrate a website from an Amazon EC2 instance. After struggling with troubleshooting connectivity through Oracle's Cloud seemingly straight forward security offerings, I found the default Ubuntu image has iptables configured as well. It restricts all ingress except port 22 for SSH.
Given I rarely dabble in iptables, here's a few tips for next time:
! Show iptables configuration including line numbers
sudo iptables -L -n --line-numbers
! Add and entry to accept traffic on port 80 at configuration line number 4
! Existing entries at line 4 and beyond will slide down to 5 and beyond
sudo iptables -I INPUT 4 -p tcp --dport 80 -m state --state NEW -j ACCEPT
! Add and entry to accept traffic on port 443 at configuration line number 4
! Existing entries at line 4 and beyond will slide down to 5 and beyond
sudo iptables -I INPUT 4 -p tcp --dport 443 -m state --state NEW -j ACCEPT
! Make the entries persistent
sudo netfilter-persistent save