I've been trying to create a webserver and an email server on my Virtual Machine (Virtual Box) running Ubuntu 20.04 LTS. It all works wonderfully on my local network, but whenever I try to use my email server or visit my webpages it can't connect me to the servers.
I've already set up my Virtual Box as a Bridged Adapter, setup the correct settings on my router.
I've tried the same configurations on my host computer and I can access it from outside of my network.
The reason I want to have both of this servers in a Virtual Machine is because I will use the host computer to run windows and manage other stuff through there.
I could also buy another computer and use that as the servers, but I wanted to spend as little money as possible.
EDIT
I had setup a DMZ host and then was setting port forwarding. When I first set this up I didn't have a clue about what it was, but it worked so I didn't change it. Now I went searching and found out I was being stupid.
I removed DMZ host and now I'm using just port forwarding. It works with OpenVPN, forwarded port 1194 to my physical machine's IP.
My webserver is installed on the virtual machine. I've forwarded it to my VM's IP. When I try to access the webserver via domain name, inside my local network it works fine.
When I try the same remotely it doesn't work. I've then tried to access by my public IP and it worked.
I thought it was the firewall, but I allowed both port 80 and 443 on my ubuntu webserver and it still didn't work (searching for domain name).