Hello all, I am trying to setup a dedicated server and I believe that I am having issues forwarding ports necessary to connect to the server form the internet.
Currently, my setup consists of a VPN server that is acting as my “router” or gateway to the wider internet, and a laptop server permanently connected to said vpn that does the actual hosting.
I have a range of ports already forwarded (25565-25600) and I have verified that they work and are forwarded by running a different server on those ports and checking canyouseeme.org. (three guesses as tho what i tested with, and the first two don’t count)
I have decided to try and run an Unturned server on those ports since they were already forwarded and setup. This is what my iptables rules look like at the gateway:
root@server:~# iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT udp -- anywhere anywhere udp dpt:1369
2 ACCEPT tcp -- anywhere anywhere tcp dpt:25565
3 ACCEPT tcp -- anywhere anywhere tcp dpt:1368
4 ACCEPT udp -- anywhere anywhere udp dpt:25565
5 ACCEPT udp -- anywhere anywhere udp multiport dports 25566:25600
6 ACCEPT tcp -- anywhere anywhere tcp multiport dports 25566:25600
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
2 ACCEPT all -- 10.8.0.0/24 anywhere
3 ACCEPT tcp -- anywhere 10.8.0.2 tcp dpt:25565
4 ACCEPT tcp -- anywhere 10.8.0.2 tcp dpt:1368 state NEW,RELATED,ESTABLISHED
5 ACCEPT udp -- anywhere 10.8.0.2 udp dpt:25565
6 ACCEPT tcp -- anywhere 10.8.0.2 multiport dports 25566:25600 state NEW,RELATED,ESTABLISHED
7 ACCEPT udp -- anywhere 10.8.0.2 multiport dports 25566:25600 state NEW,RELATED,ESTABLISHED
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
root@server:~# iptables -t nat -L --line-numbers
Chain PREROUTING (policy ACCEPT)
num target prot opt source destination
1 DNAT tcp -- anywhere anywhere tcp dpt:25565 to:10.8.0.2
2 DNAT tcp -- anywhere anywhere tcp dpt:25565 to:10.8.0.2:25565
3 DNAT tcp -- anywhere anywhere tcp dpt:1368 to:10.8.0.2:22
4 DNAT udp -- anywhere anywhere multiport dports 25566:25600 to:10.8.0.2
5 DNAT tcp -- anywhere anywhere multiport dports 25566:25600 to:10.8.0.2
Chain INPUT (policy ACCEPT)
num target prot opt source destination
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
num target prot opt source destination
1 SNAT all -- 10.8.0.0/24 !10.8.0.0/24 to:[serverip]
I understand that Unturned needs 3? ports. unturned.info has conflicting information saying that it needs 3 ports but only telling me to forward 2 of them.
On the server end I have configured Commands.dat to use the different ports I have assigned. This is what my Commands.dat looks like:
Map Germany
Port 25565
GSLT [GSLT I have]
Password [password]
MaxPlayers 80
Name server
By all appearances, this seems to work. I launch the server using:
./ServerHelper.sh +InternetServer/MyServer
and when I try to connect using the ““local”” ip while connected to the vpn, it works. If i put in 10.8.0.2 for the ip and 25565 for the port i can connect to the server.
But when I try to connect using the external ip, it doesnt work. canyouseeme.org does not detect a server running on any ports within the range with error: Connection Refused.
The ports definitely work. I can see other servers running on the same ports on that machine throught eh external IP. But when shut those servers down and run the Unturned server instead it does not work.
The server is running on Ubuntu 22.04.2 LTS and connecting to the gateway through OpenVPN
Any help is appreciated
Thanks,
Augentism