Port Forwarding issues

I can access the server locally but not publicly (outside my local network) even though the port is forwarded. I tried from my phone hotspot so I don't think its interference with the local network.
63 Replies
Admincraft Meta
Admincraft Metaβ€’3w ago
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by thegoatler#0
Loudbook
Loudbookβ€’3w ago
Show the rule
Snowman_Sir
Snowman_Sirβ€’3w ago
local server, firewall and ports is all you need really. Something went wrong along that path. Check both those and all devices that have this.
Katnax
Katnaxβ€’3w ago
You forwarded both TCP and UDP? Also the server has firewall opened? I have something simmilar, i have getsockopt error and I'm unsure why, maybe router is blocking, maybe ISPs router is in the way
SilentBot
SilentBotβ€’3w ago
You only need TCP for Java, or UDP for bedrock. The only case you would need both is Java + Geyser (for bedrock) Being able to access the server locally means the local firewall is setup right Can you share what your port forwarding rules look like? And also check if you're behind CGNAT? !cgnat
Carl-bot
Carl-botβ€’3w ago
We may have bad news for you :C You may be under a CGNAT which is a method that ISP's use to conserve IPV4 IP's due to how limited they are now. What this means in plain terms is that your IP address is being shared with other people as your router goes to the ISP's router, by default this means port forwarding doesn't work. We need to check if you are under a CGNAT and we got 2 options. Option 1: commands Depending on your OS, run the following command: - Windows: iex (Invoke-RestMethod -Uri "https://raw.githubusercontent.com/DominicTWHV/Is-It-CGNAT/refs/heads/main/windows.ps1") - Linux: curl -s https://raw.githubusercontent.com/DominicTWHV/Is-It-CGNAT/refs/heads/main/linux.sh | bash -# You should never run such things without reviewing and understanding the code Option 2: manually Open your router's configuration interface. Somewhere, you'll see something like 'external' or 'public' IP. If your external IP is in one of the following ranges, you're basically screwed as long as port forwards go: - 10.0.0.0/8 - 172.16.0.0/20 - 192.168.0.0/16 - 100.64.0.0/10 - any IPv6 address/range - This shouldn't be a problem, but Minecraft's IPv6 support is still rather quirky. You're at your own, but we're happy if you share your experience. What do I do now? You should ask your ISP for a public and IPv4 address (but this may cost you money). NB: your internal IP should and most probably will be in one of the first three ranges, don't mix them up
Katnax
Katnaxβ€’3w ago
In my case, that's what i have set in Opnsense, changed to default minecraft port for now. below are similar rules but configured for SSH and other things (which work) And between internet and my OpnSense router there is ISP's router with DMZ set. In the the future i plan to avoid ISPs router but i need specialized hardware for that.
No description
SilentBot
SilentBotβ€’3w ago
Yeah, that does look correct
Katnax
Katnaxβ€’3w ago
So yea, I can connect through my local network but not through my domain or public adress.
ProGamingDk
ProGamingDkβ€’3w ago
on a seperate network correct?
Katnax
Katnaxβ€’3w ago
same newtork. Now I'm trying to do a test why it doesn't work, then I will be moving my serwer to a VLAN
ProGamingDk
ProGamingDkβ€’3w ago
if yes, check cgnat, have also seen isps wanting you to call em to unlock portforwarding before hairpin nat can cause it to not work so test on a device outside your network
Katnax
Katnaxβ€’3w ago
mcsrvstat.us doesn't show anything and I can't connect through my phones hotspot. and if I had CGNAT then Wireguard wouldn't work, right?
ProGamingDk
ProGamingDkβ€’3w ago
wireguard as a server iirc no, but client wise should?
Katnax
Katnaxβ€’3w ago
hm, so one year ago I created a server and my friend was able to join it, but that was only on ISPs router, now I have OpnSense between, and firewall on the server is set properly as I can access from my local network but it pings for a long time
ProGamingDk
ProGamingDkβ€’3w ago
cgnat can be applied whenever
Katnax
Katnaxβ€’3w ago
Yeah, but i set up wireguard server recently and it works fine
ProGamingDk
ProGamingDkβ€’3w ago
from outside? does it show up on a port checker+
Katnax
Katnaxβ€’3w ago
yeah, i stream videos via jellyfin regulary when I'm outside.
TheGoatler
TheGoatlerOPβ€’3w ago
My issue isn't CGNAT and this is my forwarding rule, I have no firewall rules on my server
No description
TheGoatler
TheGoatlerOPβ€’3w ago
Also port forwarding works fine, I had my proxmox port forwarded for a couple days while I was on vacation I'm not able to reach the port over telnet either And I am running a stock vanilla minecraft server through lodestone on debian 12 version 1.21.1 it seems like none of the ports I forward to that computer work whatsoever
SilentBot
SilentBotβ€’3w ago
1.60 and 2.17 are two different subnets Can your router even speak with that other subnet? i.e. do you have a static route on your ISP router (if you can even add one) saying 192.168.2.x via opensense or does it have an ip address on the 192.168.2.x range?
TheGoatler
TheGoatlerOPβ€’3w ago
the router is 2.1 I'm not sure how it all works because my dad set it up but I know it does work
SilentBot
SilentBotβ€’3w ago
opensense or isp?
TheGoatler
TheGoatlerOPβ€’3w ago
I don't know but I know this works like this its how we have always done it in the past and he checked this where do you even see 1.60?
SilentBot
SilentBotβ€’3w ago
.
TheGoatler
TheGoatlerOPβ€’3w ago
oh thats a different dude lmao
SilentBot
SilentBotβ€’3w ago
Oh, completely different person :D
TheGoatler
TheGoatlerOPβ€’3w ago
no idea who that is
SilentBot
SilentBotβ€’3w ago
I mean, next step would be to see if any traffic is reaching port 25565 when connecting from a different internet connection / from mcstatus
TheGoatler
TheGoatlerOPβ€’3w ago
yeah mcstatus can't connect
SilentBot
SilentBotβ€’3w ago
Yeah, but is any traffic hitting the port or not where does it drop off? router, computer?
TheGoatler
TheGoatlerOPβ€’3w ago
I'm not really sure how to check that should I use tracert? wait that wont check the port
SilentBot
SilentBotβ€’3w ago
is the machine running the game server windows or linux based?
TheGoatler
TheGoatlerOPβ€’3w ago
its running Debian there is no firewall
SilentBot
SilentBotβ€’3w ago
If it's linux, something like tcpdump -i any port 25565 will check on the end machine
TheGoatler
TheGoatlerOPβ€’3w ago
ok I'll try that
SilentBot
SilentBotβ€’3w ago
But the router would probably be a difficult one to check
TheGoatler
TheGoatlerOPβ€’3w ago
No description
TheGoatler
TheGoatlerOPβ€’3w ago
Thats what the command gave me
Katnax
Katnaxβ€’3w ago
different dude, sam eproblem
π’Ÿπ‘œπ“‚π’Ύπ“ƒπ’Ύπ’Έ
does not have this issue as an opnsense user
ProGamingDk
ProGamingDkβ€’3w ago
he has 2 routers no? depends on his second router setup
π’Ÿπ‘œπ“‚π’Ύπ“ƒπ’Ύπ’Έ
2 routers? That might be your issue Double nat is usually a major problem
ProGamingDk
ProGamingDkβ€’3w ago
@π’Ÿπ‘œπ“‚π’Ύπ“ƒπ’Ύπ’Έ
Katnax
Katnaxβ€’3w ago
In my case, ISPs router has DMZ set up, but I want to aviod that router which comes with a risk that I'm not using their infrastructure and I could get banned. And that ISP is the only one providing internet in my building
SilentBot
SilentBotβ€’3w ago
Does the router not have a modem-only mode?
Katnax
Katnaxβ€’2w ago
Nope. And that drives me mad. No bridge mode, no modem only. That company is one of the biggest and they have 8Gbps down 1Gbps up, yet they deliberately limit the functionality for homelab users. They have ONT but I can get it while signing new contract. So I'm left with GPON SFP card.
π’Ÿπ‘œπ“‚π’Ύπ“ƒπ’Ύπ’Έ
GPON is pretty common amongst ISPs nowadays My isp also uses GPON with their SFP module and ONT
TheGoatler
TheGoatlerOPβ€’2w ago
Maybe I have the same problem as Katnax but for me I tried changing the static IP to a different one, I disabled the firewall, I added the rules in the firewall to allow all traffic and enabled it. Neither of these worked. I tried TCPdump and it didn't show any traffic. I tried making a new VM on a different OS and using the same steps to no avail. However, both VMs were Debain based (Debain 12 and Ubuntu Server). If anyone has any new ideas that would be great! -# also no ports work, I can't forward any of the ports I'm using including ssh and lodestone
SilentBot
SilentBotβ€’2w ago
I would check for CGNAT if no port forwarding is working !cgnat
Carl-bot
Carl-botβ€’2w ago
We may have bad news for you :C You may be under a CGNAT which is a method that ISP's use to conserve IPV4 IP's due to how limited they are now. What this means in plain terms is that your IP address is being shared with other people as your router goes to the ISP's router, by default this means port forwarding doesn't work. We need to check if you are under a CGNAT and we got 2 options. Option 1: commands Depending on your OS, run the following command: - Windows: iex (Invoke-RestMethod -Uri "https://raw.githubusercontent.com/DominicTWHV/Is-It-CGNAT/refs/heads/main/windows.ps1") - Linux: curl -s https://raw.githubusercontent.com/DominicTWHV/Is-It-CGNAT/refs/heads/main/linux.sh | bash -# You should never run such things without reviewing and understanding the code Option 2: manually Open your router's configuration interface. Somewhere, you'll see something like 'external' or 'public' IP. If your external IP is in one of the following ranges, you're basically screwed as long as port forwards go: - 10.0.0.0/8 - 172.16.0.0/20 - 192.168.0.0/16 - 100.64.0.0/10 - any IPv6 address/range - This shouldn't be a problem, but Minecraft's IPv6 support is still rather quirky. You're at your own, but we're happy if you share your experience. What do I do now? You should ask your ISP for a public and IPv4 address (but this may cost you money). NB: your internal IP should and most probably will be in one of the first three ranges, don't mix them up
TheGoatler
TheGoatlerOPβ€’2w ago
its not CGNAT, the ports only can't be forwarded to this VM, my dad has all kinds of crazy port forwards in place that all work fine sorry for the ping, I meant to disable it
SilentBot
SilentBotβ€’2w ago
Then likely you should ask your dad If traffic isn't even hitting the machine You'd have to troubleshoot the router itself.
π’Ÿπ‘œπ“‚π’Ύπ“ƒπ’Ύπ’Έ
id be glad to accept some kind of a pr to fix my janky scripts
TheGoatler
TheGoatlerOPβ€’2w ago
Thats the thing though, he says everything in the router is fine and he does this stuff for a living
Katnax
Katnaxβ€’2w ago
But other services like SSH work fine? what should we watch out for in server config? server ip should be 0.0.0.0 or localhost or 127.0.0.1 and the default minecrafts port is 25565. those query and rcon ports do matter?
ProGamingDk
ProGamingDkβ€’2w ago
Server ip should be 0.0.0.0 or blank No to query and rcon
SilentBot
SilentBotβ€’2w ago
If the traffic is not hitting the machine, then it is not fine Β―\_(ツ)_/Β―
TheGoatler
TheGoatlerOPβ€’2w ago
thats what I'm saying I'll bring it up again, sometimes he just doesn't wanna talk networking after he gets home from work doing networking all day it was the router smh, my dad broke it a while ago, thanks guys
SilentBot
SilentBotβ€’2w ago
Nice
TheGoatler
TheGoatlerOPβ€’4d ago
yeah actually !close router just needed a reboot

Did you find this page helpful?