Sometimes you might not be able to reach your public ip from within your vm, one way to solve that issue is to add a firewall rule that routes your public ip to your local vm ip.
sudo nano /etc/ufw/before.rules
Code: Select all
# Redirect connections to the public IP toward the LAN IP
*nat
:OUTPUT ACCEPT [0:0]
-A OUTPUT -d yourpublicip/32 -j DNAT --to-destination YOURLOCALIP
COMMITufw enable
ufw allow http
ufw allow https
ufw allow 53/udp && ufw allow 53/tcp
ufw allow 30111:32575/tcp && sudo ufw allow 30111:32575/udp
ufw reload
Make sure that you change your public ip with your actual public ip and your local ip with your actual local ip