Saturday, September 30, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1247  / 11 Months ago, fri, december 9, 2022, 8:16:31

As far as i understood with the following rule:

ACCEPT     tcp  --  anywhere              tcp dpt:25565

ubuntu allows connection via port 25565 but only to, but i want it to be reachable from anywhere.
Ive tried something like

sudo iptables -A INPUT -p tcp --dport 25565 -j ACCEPT -d anywhere

but that doesn't work. Am I missing something? Maybe im totally wrong i don't know much about networking. My server i want to reach runs in a docker container if that makes any differences.

More From » networking


You can omit the "-d ...", but INPUT is just to your local device.

When your destination is in another network (even if it is a virtual network) you need forwarding:

echo 1 > /proc/sys/net/ipv4/ip_forward

And the FORWARD chain is the right place to put your rules (but "ACCEPT" should already be the default)

Hint: iptables -S outputs the rules in the command-format

[#1473] Sunday, December 11, 2022, 10 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 422
Total Questions: 94
Total Answers: 120

Location: Bonaire
Member since Sat, Sep 24, 2022
1 Year ago