{"id":3028,"date":"2026-11-16T14:46:58","date_gmt":"2026-11-16T14:46:58","guid":{"rendered":"https:\/\/hostry.com\/blog\/?p=3028"},"modified":"2026-11-16T14:46:59","modified_gmt":"2026-11-16T14:46:59","slug":"game-server-udp-port-not-reachable-vps","status":"publish","type":"post","link":"https:\/\/hostry.com\/blog\/game-server-udp-port-not-reachable-vps\/","title":{"rendered":"Game Server UDP Port Not Reachable on a VPS: Firewall Checklist"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-cover.webp\" alt=\"Game server UDP port not reachable on a VPS: a paper envelope stopped at the first of five gates on a road that leads to a server rack\" class=\"wp-image-3025\" srcset=\"https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-cover.webp 1200w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-cover-300x169.webp 300w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-cover-1024x576.webp 1024w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-cover-450x253.webp 450w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-cover-768x432.webp 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\" style=\"font-size:14px\"><em><strong>nc -zu printing \"succeeded\" does not mean a game server UDP port is reachable. In a lab run it printed exactly that, with exit code 0, for a UFW drop, a provider-side drop and a listener that never answers. Trust only a reply received outside the VPS.<\/strong><\/em><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Players get &#8220;timed out&#8221; or &#8220;Unable to connect to world&#8221; and the server console logs no join. The checks assume UFW is enabled with default deny incoming and an SSH allow rule, as in <strong><a href=\"https:\/\/hostry.com\/blog\/secure-new-linux-vps-first-30-minutes\/\">UFW defaults and SSH rules for a new server<\/a><\/strong>; run them as root on the VPS and from one outside machine.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Game server UDP port not reachable: check in packet order<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start at the provider edge and move inward, stopping at the first layer that fails.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Provider firewall in the control panel. A drop there leaves tcpdump on the VPS with 0 packets.<\/li><li>UFW, for a game running on the host: the port&#8217;s counter in <code>sudo iptables -L ufw-user-input -v -n<\/code> grows with each attempt. A game in Docker leaves that counter at 0 even while traffic flows, so container users go to check 3.<\/li><li>Docker: <code>docker port &lt;container&gt;<\/code> lists the port with <code>\/udp<\/code>, and the firewall backend decides which rules apply.<\/li><li>Bind address: <code>ss -ulnp 'sport = :PORT'<\/code> shows 0.0.0.0 or the public IP, never 127.0.0.1.<\/li><li>The game replies or logs the join attempt.<\/li><li>A machine outside the VPS gets a reply.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"800\" src=\"https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-check-order.webp\" alt=\"Check order for a game server UDP port: player, provider firewall, UFW, Docker, bind address and game server, each with the check that proves it, such as 0 packets in tcpdump, a growing UFW counter or a reply received\" class=\"wp-image-3019\" srcset=\"https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-check-order.webp 1200w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-check-order-300x200.webp 300w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-check-order-1024x683.webp 1024w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-check-order-450x300.webp 450w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-check-order-768x512.webp 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Reproduced with UDP stand-ins (Python and socat listeners, a small echo container) on the default game ports in Linux network namespaces: Ubuntu 24.04.5, ufw 0.36.2, nmap 7.94, OpenBSD netcat 1.226, socat 1.8.0.0, Docker Engine 29.9.2. A router namespace stood in for the provider firewall. The games did not run there; their behavior comes from their documentation. In transcripts, g- names are lab names, pong: replies come from the stand-in (it answers &#8220;pong:&#8221; plus what it received), and udpprobe.py is the probe script printed under &#8220;When the game stays silent&#8221;. 198.51.100.20 is the VPS and 192.0.2.50 a player, so swap in your addresses.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"font-size:14px\"><strong>Before you change any rule<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Test from a second VPS or from a laptop on a phone hotspot. A probe from the VPS to its own public IP travels over the loopback interface, which UFW accepts, so in the lab that self-test got a reply while the provider-edge rule dropped every player datagram.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check that your provider&#8217;s console works before you begin (the Hostry panel has a VNC console); it keeps working when a UFW change cuts SSH. ufw ships with Ubuntu; install the rest on both machines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt install nmap socat tcpdump netcat-openbsd python3<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Ports for Minecraft, Geyser, Palworld and Hytale<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open each port for the protocol the game uses. The sources below were read on 2026-11-16.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Server<\/th><th>Default port<\/th><th>Source<\/th><th>Note<\/th><\/tr><\/thead><tbody><tr><td>Minecraft Java Edition<\/td><td>25565\/TCP<\/td><td>server-port default in server.properties; also in GeyserMC&#8217;s port-forwarding example<\/td><td>TCP tests give clear answers<\/td><\/tr><tr><td>Geyser for Bedrock clients (NetherNet)<\/td><td>19132\/TCP for signaling and 19132\/UDP for gameplay<\/td><td><strong><a href=\"https:\/\/geysermc.org\/blog\/preparing-for-nethernet\" target=\"_blank\" rel=\"noopener\">GeyserMC NetherNet post<\/a><\/strong> (2026-10-08) and GeyserMC port-forwarding page (undated)<\/td><td>With RakNet also enabled, the <code>webrtc-port<\/code> needs UDP too<\/td><\/tr><tr><td>Palworld dedicated server<\/td><td>8211\/UDP<\/td><td><strong><a href=\"https:\/\/docs.palworldgame.com\/settings-and-operation\/arguments\/\" target=\"_blank\" rel=\"noopener\">Pocketpair&#8217;s server arguments<\/a><\/strong> (v1.0.4) give <code>-port=8211<\/code> but no protocol; UDP per hosting guides<\/td><td>RCON 25575\/TCP and REST API 8212\/TCP only if you enable them (hosting guides); <code>-publicport<\/code> does not change the listening port<\/td><\/tr><tr><td>Hytale<\/td><td>5520\/UDP (QUIC)<\/td><td><strong><a href=\"https:\/\/support.hytale.com\/hc\/en-us\/articles\/45326769420827\" target=\"_blank\" rel=\"noopener\">Hytale dedicated server manual<\/a><\/strong><\/td><td>Default bind 0.0.0.0:5520, changed with <code>--bind<\/code>; TCP forwarding not required<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Palworld needs <code>sudo ufw allow 8211\/udp<\/code>. Hytale needs <code>sudo ufw allow 5520\/udp<\/code>, the command its manual gives. An extra TCP rule opens nothing for a UDP-only game: with <code>ufw allow 8211<\/code>, nmap&#8217;s 8211\/tcp only moved from filtered to closed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Rust, ARK and Counter-Strike, also on <strong><a href=\"https:\/\/hostry.com\/solutions\/games\/\">Hostry&#8217;s game server page<\/a><\/strong>, go through the same checks with their own ports, as does a vanilla Bedrock Dedicated Server with the ports in its version notes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"font-size:14px\"><strong>Minecraft Java on TCP 25565<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When Minecraft port 25565 is not working on a VPS, trust the TCP test. Against a TCP stand-in on 25565, <code>nc -vz -w3<\/code> gave three distinct results:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>== ufw allow 25565\/tcp\n$ nc -vz -w3 198.51.100.20 25565\nConnection to 198.51.100.20 25565 port [tcp\/*] succeeded!\n[time 0.002s]\n[...]\n== ufw reject 25565\/tcp\n$ nc -vz -w3 198.51.100.20 25565\nnc: connect to 198.51.100.20 port 25565 (tcp) failed: Connection refused\n[time 0.002s]\n[...]\n== ufw deny 25565\/tcp\n$ nc -vz -w3 198.51.100.20 25565\nnc: connect to 198.51.100.20 port 25565 (tcp) timed out: Operation now in progress\n[time 3.006s]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A timeout points at a firewall dropping the SYN. Connection refused means the packet arrived and nothing took it, either a REJECT rule or no listener on that address, which <code>ss -ltnp \"sport = :25565\"<\/code> settles.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Provider firewall: zero packets on the VPS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A provider-side drop happens before your server. tcpdump on the VPS captures 0 packets, while <code>ss<\/code> lists the listener and a self-test to the public IP still gets its reply. <strong><a href=\"https:\/\/hostry.com\/products\/vps\/\">Hostry VPS<\/a><\/strong> plans have a firewall in the control panel, a second layer in front of the server&#8217;s own, so a game server UDP port has to get through both.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip -br addr                                  # find the interface with the public IP\nsudo tcpdump -n -i ens3 'udp port 8211'      # use that interface; press Ctrl-C after the player's attempts to see the count<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With a DROP rule on the router namespace, everything on the VPS side looked healthy:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>=================== upstream DROP udp\/8211 ===================\n-A FORWARD -p udp -m udp --dport 8211 -m comment --comment g-lab -j DROP\n--- g-srv (VPS): ss -ulpn 'sport = :8211'\nUNCONN 0      0            0.0.0.0:8211      0.0.0.0:*    users:((\"python3\",pid=21773,fd=3))\n--- g-srv (VPS): local test to its own public IP: udpprobe.py 198.51.100.20 8211\nREPLY b'pong:g-lab-probe' in 0.000s\n--- g-cli (player): udpprobe.py 198.51.100.20 8211 2\nTIMEOUT after 2.002s (no reply, no ICMP)\n--- g-cli (player): nmap -n -sU -Pn -p 8211 --reason 198.51.100.20\n8211\/udp open|filtered unknown no-response\n--- tcpdump on the VPS interface g-s0:\n0 packets captured\n--- tcpdump on the provider edge, player side g-rc:\n10:52:27.395631 IP 192.0.2.50.40062 &gt; 198.51.100.20.8211: UDP, length 11\n[...]\n3 packets captured<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A UFW deny on the VPS looks the same to the player, but the capture shows the datagrams, because tcpdump reads them before netfilter&#8217;s INPUT hook:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>=================== host DROP (ufw deny 8211\/udp) ===================\n--- g-srv (VPS): local test: REPLY b'pong:g-lab-probe' in 0.000s\n--- g-cli (player): TIMEOUT after 2.002s (no reply, no ICMP)\n--- tcpdump on the VPS interface g-s0:\n10:52:38.668677 IP 192.0.2.50.49022 &gt; 198.51.100.20.8211: UDP, length 11\n[...]\n3 packets captured<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Packets captured with no reply point past the provider, at UFW, Docker, the bind address or a silent program. A provider firewall that rejects names its router in nmap (<code>admin-prohibited from 192.0.2.1<\/code>) while nc -zu still reports success. Open the game&#8217;s port and protocol in the provider firewall, then capture again.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">UFW: allow the UDP port with its protocol<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>ufw allow 8211\/udp<\/code> creates one UDP rule, while <code>ufw allow 19132<\/code> with no protocol creates a TCP rule and a UDP rule. <code>ufw deny<\/code> is a silent DROP and <code>ufw reject<\/code> on UDP answers with ICMP port unreachable. Either one on a port that has an allow rule replaces it (&#8220;Rule updated&#8221;), so a deny with a mistyped port closes a working game port. Read this lab transcript; it mixes allow, deny and reject, so do not paste it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ufw allow 8211\/udp; ufw deny 5520\/udp; ufw reject 25565\/tcp; ufw allow 19132\nRule added\nRule added\nRule added\nRule added\n$ ufw status verbose\n[...]\n8211\/udp                   ALLOW IN    Anywhere\n5520\/udp                   DENY IN     Anywhere\n25565\/tcp                  REJECT IN   Anywhere\n19132                      ALLOW IN    Anywhere\n[...]\n$ iptables -S ufw-user-input\n[...]\n-A ufw-user-input -p udp -m udp --dport 8211 -j ACCEPT\n-A ufw-user-input -p udp -m udp --dport 5520 -j DROP\n-A ufw-user-input -p tcp -m tcp --dport 25565 -j REJECT --reject-with tcp-reset\n-A ufw-user-input -p tcp -m tcp --dport 19132 -j ACCEPT\n-A ufw-user-input -p udp -m udp --dport 19132 -j ACCEPT<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When the capture shows datagrams arriving and the player still times out, read the counters:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ (server) iptables -L ufw-user-input -v -n -x\nChain ufw-user-input (1 references)\n    pkts      bytes target     prot opt in     out     source               destination\n       0        0 ACCEPT     17   --  *      *       0.0.0.0\/0            0.0.0.0\/0            udp dpt:8211\n       3      117 DROP       17   --  *      *       0.0.0.0\/0            0.0.0.0\/0            udp dpt:5520\n[...]\n$ (server) ss -ulpn \"sport = :5520\"   (Recv-Q 0: nothing reached the socket)\nState  Recv-Q Send-Q Local Address:Port Peer Address:PortProcess\nUNCONN 0      0            0.0.0.0:5520      0.0.0.0:*    users:((\"python3\",pid=18892,fd=3))\n$ (server) cat stand-in log\nstandin udp echo listening on 0.0.0.0:5520<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A port with no rule at all falls through to <code>default deny incoming<\/code> and gave the same results as an explicit deny.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add game ports through ufw, which reloads <span class=\"highlighted\">\/etc\/ufw\/user.rules<\/span> at boot. A rule added with <code>iptables -I<\/code> lives only in the kernel and was gone after an emulated reboot; <code>iptables-save<\/code> only prints.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keep <code>IPV6=yes<\/code> in <span class=\"highlighted\">\/etc\/default\/ufw<\/span>: <code>IPV6=no<\/code> sets all ip6tables policies to DROP except loopback (ufw-init-functions), though IPv6 traffic was not tested.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Minecraft Bedrock port 19132 in UFW: Geyser needs TCP and UDP<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For Geyser with NetherNet, allow 19132 without a protocol. A UDP-only rule leaves the TCP half filtered, and per GeyserMC that half is how players find the server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>== B) replace with \"ufw allow 19132\/udp\" only (UDP-only rule) ==\n19132\/udp                  ALLOW       Anywhere\n$ nmap -n -Pn -sU -sS -p 19132 --reason 198.51.100.20\n19132\/tcp filtered unknown no-response\n19132\/udp open     unknown udp-response ttl 63\n[...]\n$ nc -vz -w2 198.51.100.20 19132\nnc: connect to 198.51.100.20 port 19132 (tcp) timed out: Operation now in progress<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo ufw allow 19132\nsudo ufw status | grep 19132<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With the no-protocol rule, nmap read both stand-ins as open.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bedrock 26.60 was released on October 27, 2026; GeyserMC&#8217;s post says its clients stop connecting over RakNet, and the Dedicated Server notes in <strong><a href=\"https:\/\/www.minecraft.net\/en-us\/article\/minecraft--bedrock-edition-26-60-changelog\" target=\"_blank\" rel=\"noopener\">Mojang&#8217;s 26.60 changelog<\/a><\/strong> turn the NetherNet warning into an error &#8220;as RakNet is deprecated&#8221;. At the time of the post, NetherNet still had to be switched on in Geyser&#8217;s config.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GeyserMC&#8217;s pages disagree on the protocol. <strong><a href=\"https:\/\/geysermc.org\/wiki\/geyser\/fixing-unable-to-connect-to-world\/\" target=\"_blank\" rel=\"noopener\">Fixing Unable to Connect to World<\/a><\/strong> still says Bedrock &#8220;uses UDP&#8221; and that a TCP-only forward &#8220;will not work&#8221;, with no word on NetherNet. The post and the port-forwarding page ask for TCP and UDP on 19132, so go by those two; with external signaling such as Warden, GeyserMC says only UDP is needed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Docker and UFW with a UDP port: bypassed or blocked, by backend<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Whether Docker bypasses UFW depends on its firewall backend. With the default iptables backend, a port published as <code>-p 19132:19132\/udp<\/code> reaches the container whatever UFW says; with the nftables backend in Docker 29, UFW&#8217;s routed policy blocks it. Both runs started UFW before dockerd; UFW enabled after Docker, and <code>ufw reload<\/code> with containers running, were not tested. Check which backend runs:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ docker info --format '{{.FirewallBackend.Driver}}'\niptables<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"font-size:14px\"><strong>iptables backend: the INPUT rule never sees the packet<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Docker rewrites the destination in nat PREROUTING and the packet goes through FORWARD, so UFW&#8217;s INPUT rules do not apply. This lab transcript uses the echo image as the game, with <code>ufw deny 19132\/udp<\/code> set before dockerd started:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>19132\/udp                  DENY IN     Anywhere\n$ docker run -d --name g-echo1 --network g-net -p 19132:19132\/udp g-udpecho:1\ng-echo1   g-udpecho:1   0.0.0.0:19132-&gt;19132\/udp\nUNCONN 0      0            0.0.0.0:19132      0.0.0.0:*    users:((\"docker-proxy\",pid=24806,fd=9))\n$ (player) udpprobe.py 198.51.100.20 19132 2\nREPLY b'pong:g-lab-probe' in 0.000s\n19132\/udp open  unknown udp-response ttl 62\n$ iptables -L ufw-user-input -v -n | grep 19132   (the DENY rule was never hit)\n    0     0 DROP       17   --  *      *       0.0.0.0\/0            0.0.0.0\/0            udp dpt:19132\n$ iptables -S FORWARD\n-P FORWARD DROP\n-A FORWARD -j DOCKER-USER\n-A FORWARD -j DOCKER-FORWARD\n-A FORWARD -j ufw-before-logging-forward\n[...]\n-A DOCKER -d 172.18.0.2\/32 ! -i br-96b58afeb851 -o br-96b58afeb851 -p udp -m udp --dport 19132 -j ACCEPT\n$ iptables -t nat -S DOCKER\n-A DOCKER ! -i br-96b58afeb851 -p udp -m udp --dport 19132 -j DNAT --to-destination 172.18.0.2:19132\n$ docker logs g-echo1\ngot 11 bytes from 192.0.2.50:50309<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"800\" src=\"https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-docker-path.webp\" alt=\"Docker iptables backend path for a published UDP port: nat PREROUTING DNAT to the container, then FORWARD through DOCKER-USER and DOCKER to the container, while the INPUT chain with ufw deny 19132\/udp is never reached and ufw route deny comes after Docker's accept\" class=\"wp-image-3020\" srcset=\"https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-docker-path.webp 1200w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-docker-path-300x200.webp 300w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-docker-path-1024x683.webp 1024w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-docker-path-450x300.webp 450w, https:\/\/hostry.com\/blog\/wp-content\/uploads\/2026\/11\/game-server-udp-port-not-reachable-vps-docker-path-768x512.webp 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code>ufw route deny<\/code> does not help either, because Docker&#8217;s chains accept the packet earlier in FORWARD. Filter in DOCKER-USER, which FORWARD calls first, and match the original destination port with <code>-p udp<\/code>; the TCP form from Docker-and-UFW guides does nothing for UDP:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>== ufw route deny proto udp from any to any port 19132\n19132\/udp                  DENY FWD    Anywhere\nREPLY b'pong:g-lab-probe' in 0.000s          (still reachable; ufw-user-forward counter 0)\n== DOCKER-USER: -p tcp -m conntrack --ctorigdstport 19132 --ctdir ORIGINAL -j DROP   (copied TCP example)\nREPLY b'pong:g-lab-probe' in 0.000s          (still reachable)\n== DOCKER-USER: -p udp -m conntrack --ctorigdstport 19132 --ctdir ORIGINAL -j DROP\nTIMEOUT after 2.002s (no reply, no ICMP)\n19132\/udp open|filtered unknown no-response\n    3    95 DROP       17   --  *      *       0.0.0.0\/0            0.0.0.0\/0            ctorigdstport 19132 ctdir ORIGINAL \/* g-lab *\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Leaving out <code>-p<\/code> also worked. To admit only friends, drop every other source; with this rule 192.0.2.50 got its reply and 192.0.2.51 timed out:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo iptables -I DOCKER-USER ! -s 192.0.2.50\/32 -p udp -m conntrack --ctorigdstport 19132 --ctdir ORIGINAL -j DROP\nsudo iptables -L DOCKER-USER -v -n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Like any iptables rule added by hand, it is gone after a reboot.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two Docker mistakes look like firewall problems. With a remapped port, <code>-p 19232:19132\/udp<\/code>, a DOCKER-USER rule on <code>--dport 19232<\/code> never matched (counter 0), because FORWARD already sees 19132. <code>--ctorigdstport 19232<\/code> blocked that container alone; <code>--dport 19132<\/code> blocked every container using 19132 inside.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Without <code>\/udp<\/code>, <code>-p 19132:19132<\/code> publishes TCP only, while <code>docker ps<\/code> still prints <code>19132\/udp<\/code> from the image&#8217;s EXPOSE line. The REFUSED below needs <code>ufw allow 19132\/udp<\/code>; under the deny, a repeat run timed out:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>== D3: docker run -d --name g-echo3 --network g-net -p 19132:19132 g-udpecho:1   (no \/udp suffix)\nNAMES     PORTS\ng-echo3   19132\/udp, 0.0.0.0:19132-&gt;19132\/tcp\n$ docker port g-echo3\n19132\/tcp -&gt; 0.0.0.0:19132\n[...]\n$ (player) udpprobe.py 198.51.100.20 19132 2\nREFUSED (ICMP port unreachable) in 0.000s<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For Geyser, publish both (<code>-p 19132:19132 -p 19132:19132\/udp<\/code>, per GeyserMC) and confirm with <code>docker port<\/code>, which lists only published ports.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"font-size:14px\"><strong>nftables backend: UFW route rules decide<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Docker 29.9.2 with <code>\"firewall-backend\": \"nftables\"<\/code> in <span class=\"highlighted\">\/etc\/docker\/daemon.json<\/span>, a mode Docker calls experimental since it arrived in 29.0.0, flips the result. Docker&#8217;s own nft rule accepted the player&#8217;s packets, and UFW&#8217;s FORWARD policy dropped them:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> Firewall Backend: nftables\n$ docker run -d --name g-echo5 --network g-net -p 19132:19132\/udp g-udpecho:1\n$ iptables -S DOCKER-USER\niptables: Incompatible with this kernel.\n== ufw deny 19132\/udp, Default: deny (routed)\n$ (player) udpprobe.py 198.51.100.20 19132 2      TIMEOUT after 2.001s (no reply, no ICMP)\nChain FORWARD (policy DROP 3 packets, 95 bytes)\n== N1: ufw allow 19132\/udp instead of deny       TIMEOUT after 2.002s\n== N2: + ufw route allow proto udp from any to any port 19132\n19132\/udp                  ALLOW FWD   Anywhere\nREPLY b'pong:g-lab-probe' in 0.000s\n== N3: route allow kept, ufw deny 19132\/udp again   REPLY b'pong:g-lab-probe' in 0.004s\n== N4: route deny instead of route allow            TIMEOUT after 2.001s\n$ nft list table ip docker-bridges\n[...]\n\t\tip daddr 172.18.0.2 udp dport 19132 counter packets 7 bytes 251 accept<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here INPUT rules and DOCKER-USER do not apply, so open the published port with <code>sudo ufw route allow proto udp from any to any port 19132<\/code>. Docker&#8217;s documentation explains the drop:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>An iptables chain with FORWARD policy DROP will drop packets that have been accepted by Docker&#8217;s nftables rules.<\/p><cite><strong><a href=\"https:\/\/docs.docker.com\/engine\/network\/firewall-nftables\/\" target=\"_blank\" rel=\"noopener\">Docker docs: firewall with nftables<\/a><\/strong><\/cite><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">This backend does not switch on IPv4 forwarding. In a repeat run, <code>docker network create<\/code> failed with &#8220;IPv4 forwarding is disabled&#8221; until net.ipv4.ip_forward was 1. Make it permanent with <code>echo 'net.ipv4.ip_forward=1' | sudo tee \/etc\/sysctl.d\/60-ip-forward.conf<\/code>, load it with <code>sudo sysctl --system<\/code>, then restart Docker, which otherwise kept printing a stale forwarding warning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bind address: 0.0.0.0 or the public IP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A game server listening on 127.0.0.1 answers on the VPS itself and sends ICMP port unreachable to everyone else. For Minecraft Java, use the TCP <code>ss -ltnp<\/code> check from the 25565 section. Read the Local Address column with a port filter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>== listener A: 127.0.0.1:5520 (stand-in);  unrelated listener B: 0.0.0.0:55201\n$ ss -ulnp | grep 5520\nUNCONN 0      0          127.0.0.1:5520       0.0.0.0:*    users:((\"python3\",pid=22363,fd=3))\nUNCONN 0      0            0.0.0.0:55201      0.0.0.0:*    users:((\"python3\",pid=22364,fd=3))\n$ ss -ulnp \"sport = :5520\"\nUNCONN 0      0          127.0.0.1:5520      0.0.0.0:*    users:((\"python3\",pid=22363,fd=3))\n$ (on the VPS) udpprobe.py 127.0.0.1 5520         REPLY b'pong:g-lab-probe' in 0.000s\n$ (on the VPS) udpprobe.py 198.51.100.20 5520     REFUSED (ICMP port unreachable) in 0.000s\n$ (player) udpprobe.py 198.51.100.20 5520         REFUSED (ICMP port unreachable) in 0.000s\n== listener C: 0.0.0.0:5520\n$ (player) udpprobe.py 198.51.100.20 5520         REPLY b'pong:g-lab-probe' in 0.000s<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use the <code>sport<\/code> filter, since <code>grep 5520<\/code> also matches 55201. The users column names the process holding the port. Hytale binds 0.0.0.0:5520 unless <code>--bind<\/code> says otherwise, per its manual, and a stand-in bound to the VPS&#8217;s second address refused probes sent to the main one. In Docker, <code>-p 127.0.0.1:19132:19132\/udp<\/code> answered on the VPS and was refused from outside while UFW allowed 19132\/udp.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On a second IP, a 0.0.0.0 stand-in replying with plain <code>sendto()<\/code> answered from 198.51.100.20, so connected clients, <code>nc -u<\/code> included, saw nothing until it was bound to 198.51.100.21. Only the stand-in was run; tcpdump shows which source a game replies from:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10:53:51.779266 IP 192.0.2.50.54469 &gt; 198.51.100.21.5520: UDP, length 11\n10:53:51.779650 IP 198.51.100.20.5520 &gt; 192.0.2.50.54469: UDP, length 16<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How to test a UDP port from outside the VPS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Only a reply that reaches a machine outside the VPS proves a game server UDP port open. A probe TIMEOUT and nmap&#8217;s open|filtered are inconclusive, because a firewall drop and a game that ignores the probe produce both. nc -zu does not look for a reply at all. Games are not expected to echo test bytes, so prove the path with an echo stand-in. Against a UFW deny, the usual checks looked like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>8211\/udp                   DENY        Anywhere\n$ nc -zu 198.51.100.20 8211\nConnection to 198.51.100.20 8211 port [udp\/*] succeeded!\n[exit=0 time=3.01s]\n$ nmap -n -sU -Pn -p 8211 --reason 198.51.100.20\n8211\/udp open|filtered unknown no-response\nNmap done: 1 IP address (1 host up) scanned in 2.16 seconds\n$ udpprobe.py 198.51.100.20 8211 2\nTIMEOUT after 2.002s (no reply, no ICMP)\n$ echo ping | nc -u -w2 198.51.100.20 8211\n(nc rc=0)            [time=2.03s]\n$ echo ping | socat -t2 - UDP:198.51.100.20:8211\n(socat rc=0)         [time=2.02s]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Across ten cases, each tool reported this:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Case (8211\/udp)<\/th><th>nc -zu: exit, text, time<\/th><th>nmap -sU &#8211;reason<\/th><th>udpprobe.py<\/th><th>tcpdump on the VPS<\/th><\/tr><\/thead><tbody><tr><td>Open, echo stand-in<\/td><td>0, succeeded, 3.01 s<\/td><td>open, udp-response<\/td><td>REPLY<\/td><td>in and reply<\/td><\/tr><tr><td><code>ufw reject<\/code><\/td><td>1, no text, 0.01 s<\/td><td>closed, port-unreach<\/td><td>REFUSED<\/td><td>in and ICMP<\/td><\/tr><tr><td><code>ufw deny<\/code><\/td><td>0, succeeded, 3.01 s<\/td><td>open|filtered, no-response<\/td><td>TIMEOUT<\/td><td>in only<\/td><\/tr><tr><td>No rule (default deny)<\/td><td>0, succeeded, 3.03 s<\/td><td>open|filtered, no-response<\/td><td>TIMEOUT<\/td><td>in only<\/td><\/tr><tr><td>Listening on 127.0.0.1<\/td><td>1, no text, 0.03 s<\/td><td>closed, port-unreach<\/td><td>REFUSED<\/td><td>in and ICMP<\/td><\/tr><tr><td>Bound to the second IP<\/td><td>1, no text, 0.01 s<\/td><td>closed, port-unreach<\/td><td>REFUSED<\/td><td>in and ICMP<\/td><\/tr><tr><td>Silent listener<\/td><td>0, succeeded, 3.02 s<\/td><td>open|filtered, no-response<\/td><td>TIMEOUT<\/td><td>in only<\/td><\/tr><tr><td>Nothing listening<\/td><td>1, no text, 0.01 s<\/td><td>closed, port-unreach<\/td><td>REFUSED<\/td><td>in and ICMP<\/td><\/tr><tr><td>Provider DROP<\/td><td>0, succeeded, 3.00 s<\/td><td>open|filtered, no-response<\/td><td>TIMEOUT<\/td><td>nothing<\/td><\/tr><tr><td>Provider reject<\/td><td>0, succeeded, 3.00 s<\/td><td>filtered, admin-prohibited from 192.0.2.1<\/td><td>ICMP ERROR, errno 113<\/td><td>nothing<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">OpenBSD netcat 1.226 sent five 1-byte datagrams over 3 s (2 s with <code>-w2<\/code>) and reported success unless ICMP port unreachable came back; then it exited 1 within 0.03 s and printed nothing, even with <code>-v<\/code>. <code>echo ping | nc -u -w2<\/code> exited 0 in all nine rows where it was run (all but the provider reject), so <strong>only a printed reply means anything<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">socat makes a better client. <code>echo ping | socat -t2 - UDP:198.51.100.20:8211<\/code> printed Connection refused with exit 1 for the reject, wrong-bind and no-listener rows, No route to host for the provider reject, and nothing with exit 0 for every drop.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">From the outside machine, point nmap at your own VPS only and add <code>-n<\/code>: <code>sudo nmap -n -sU -Pn -p 8211 --reason 198.51.100.20<\/code>. Without <code>-n<\/code>, reverse DNS to an unreachable resolver took 13.0 s of a 13.16 s scan. This build sent empty UDP probes, so a game that ignores them shows open|filtered. <code>nc -vz<\/code> without <code>-u<\/code> tests only TCP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Leave a few seconds between probes. Linux rate-limits ICMP port unreachable replies, and in a repeat run, back-to-back probes against a refused port sometimes came back as TIMEOUT.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"font-size:14px\"><strong>When the game stays silent<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This test takes the game offline for a minute or two. The games were not run in the lab and are not expected to answer arbitrary bytes, so the probe proves the path only with an echo stand-in. Save it as <span class=\"highlighted\">udpprobe.py<\/span> on the outside machine, with a copy on the VPS for the self-test:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/env python3\n\"\"\"Real UDP request\/reply test. Usage: udpprobe.py &lt;host&gt; &lt;port&gt; [timeout_s]\nSends one datagram on a connected UDP socket and waits for a reply.\nPrints one of: REPLY (bytes), REFUSED (ICMP port unreachable came back), TIMEOUT (nothing came back).\nExit code: 0 = reply, 1 = refused, 2 = timeout, 3 = other ICMP error.\n\"\"\"\nimport socket, sys, time\n\nhost, port = sys.argv[1], int(sys.argv[2])\ntimeout = float(sys.argv[3]) if len(sys.argv) &gt; 3 else 2.0\ns = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\ns.settimeout(timeout)\ns.connect((host, port))  # connected socket: ICMP errors are reported to us\nt0 = time.monotonic()\ntry:\n    s.send(b\"g-lab-probe\")\n    data = s.recv(2048)\n    print(f\"REPLY {data!r} in {time.monotonic()-t0:.3f}s\")\n    sys.exit(0)\nexcept ConnectionRefusedError:\n    print(f\"REFUSED (ICMP port unreachable) in {time.monotonic()-t0:.3f}s\")\n    sys.exit(1)\nexcept socket.timeout:\n    print(f\"TIMEOUT after {time.monotonic()-t0:.3f}s (no reply, no ICMP)\")\n    sys.exit(2)\nexcept OSError as e:  # other ICMP errors, e.g. host\/admin prohibited -&gt; EHOSTUNREACH\n    print(f\"ICMP ERROR errno={e.errno} ({e.strerror}) in {time.monotonic()-t0:.3f}s\")\n    sys.exit(3)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run it as <code>python3 udpprobe.py 198.51.100.20 8211 2<\/code>, with the seconds to wait last. With the game stopped, put an echo on its port and test from outside:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ (VPS) socat UDP4-LISTEN:8211,fork,reuseaddr EXEC:cat &amp;\n$ (player) echo hello-8211 | nc -u -w2 198.51.100.20 8211\nhello-8211\nrc=0           [time 2.011s]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the text comes back, the network path is fine and the cause sits in the game&#8217;s config or version. Stop the game first, or socat fails with &#8220;Address already in use&#8221;, or, if the game set SO_REUSEADDR, binds beside it and takes its traffic:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>== holder SO_REUSEADDR=1 ; socat UDP4-LISTEN:8211,fork EXEC:cat      (no reuseaddr option given)\nUNCONN 0 0 0.0.0.0:8211 0.0.0.0:* users:((\"socat\",pid=26725,fd=5))\nUNCONN 0 0 0.0.0.0:8211 0.0.0.0:* users:((\"python3\",pid=26702,fd=3))\n$ (player) echo probe | nc -u -w1 198.51.100.20 8211\nprobe\nholder log: (nothing)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then stop the echo with every child it forked, check that the port is free, start the game again and retry with a real client. <code>kill %1<\/code> stops only the parent; the children keep the port and the game fails with &#8220;Address already in use&#8221;. <code>ss -ulnp<\/code> misses the children&#8217;s connected sockets, so check with <code>-a<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pkill -f 'UDP4-LISTEN:8211'\nss -uanp 'sport = :8211'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A repeat run printed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ pkill -f 'UDP4-LISTEN:8211'\n2026\/11\/16 11:56:44 socat[27844] W exiting on signal 15\n2026\/11\/16 11:56:44 socat[27853] W exiting on signal 15\npkill rc=0\n--- processes after pkill:\n--- ss after pkill:\nState Recv-Q Send-Q Local Address:Port Peer Address:PortProcess<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For a game in Docker, an echo on the host receives through INPUT, a path the container&#8217;s packets never take. Publish a UDP echo container with the game&#8217;s <code>-p<\/code> mapping instead.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Locked out after a firewall change<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Use the panel&#8217;s VNC console. Find the rule that blocks SSH in <code>sudo ufw status numbered<\/code> and delete it with <code>sudo ufw delete<\/code> and its number; delete asks for y. With IPv6 on, list the rules again and delete its (v6) copy too, since the numbers shift after each delete. If no SSH allow rule is left, add <code>sudo ufw allow OpenSSH<\/code> (22\/tcp only; allow your own port if SSH listens elsewhere), or run <code>sudo ufw disable<\/code> while you sort it out. A self-reverting timer like <strong><a href=\"https:\/\/hostry.com\/blog\/ssh-over-wireguard-ubuntu-24-04\/\">the ten-minute rollback in the SSH over WireGuard guide<\/a><\/strong> saves that trip next time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the control-panel firewall of a <strong><a href=\"https:\/\/hostry.com\/products\/vps\/\">Hostry VPS<\/a><\/strong> before you change UFW. The plans come with full root for UFW and Docker and start at $6.00\/mo with 1 vCPU and 1 GB of RAM on NVMe storage, up to 32 GB RAM.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>nc -zu reported success for UDP ports that UFW or the provider edge was dropping. Six checks in the order a datagram travels, DOCKER-USER rules that m&#8230;<\/p>\n","protected":false},"author":6,"featured_media":3026,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,15,127],"tags":[],"class_list":["post-3028","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-virtual-private-server","category-linux-server","category-security"],"read_time":14,"_links":{"self":[{"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/posts\/3028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/comments?post=3028"}],"version-history":[{"count":1,"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/posts\/3028\/revisions"}],"predecessor-version":[{"id":3039,"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/posts\/3028\/revisions\/3039"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/media\/3026"}],"wp:attachment":[{"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/media?parent=3028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/categories?post=3028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostry.com\/blog\/wp-json\/wp\/v2\/tags?post=3028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}