iptables rules reset after reboot by default, I would suggest you to re run iptables commands required by wireguard and use
Code:
sudo netfilter-persistent save
After running iptables commands so that rules are automatically reloaded after reboot
To open a particular port on oracle cloud, for example to open port 80/tcp
Code:
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
To use udp, replace tcp with udp and 80 with required port, also remember to run sudo netfilter-persistent save
There is a reason iptables resets after every reboot by default, because it's quite powerful and can be dangerous, one wrong command can even block port 22 and lock you out of your VM, which can be solved by a simple reboot of the VM from console.
My original wireguard script also had problems after VM restart but some iptables tweak solved the problem.
I will try to tweak my script to work properly with Oracle cloud and share once it's ready