Linux - How do I bind my internal ip to my external ip?

I'm making a minecraft a minecraft server, I have forwarded the port 25565 and have doe everything necessary for it to work, with a functioning DNS that updates from the external ip every 5 minutes.

But it doesn't work; when I start the minecraft server it works but only on the local network. Which means it's not reaching outside the network. How do I use iptables to make this work?

I have forwarded my servers' internal ip and I tested on a website to see if it can listen on the ports 25565. It was successful but I'm not sure why it won't work?

I've heard of postrouting having something to do with this? What iptabels commands should I use?

To open the port in iptables, try the commands:

iptables -A INPUT -p udp -m state --state NEW -m udp --dport 25565 -j ACCEPT
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 25565 -j ACCEPT

If it works, save the configuration so it's used when the machine restarts.

If that does not work, try

iptables -A INPUT -p udp --dport 25565 -j ACCEPT
iptables -A INPUT -p tcp --dport 25565 -j ACCEPT

That's ignoring the connection state and simply accepting everything to the destination port.

The prerouting / postrouting stuff is normally only needed for redirecting data within the connection or to yet another machine.

If you are only using udp or tcp, you can leave out the line for the other protocol.