Disable port (external) - IpTables/firewall issue

0

I am having a Docker container with SOLR (0.0.0.0:8984->8983/tcp) and would like to deny the "8984" Port for external request.

The Server is a Plesk Onyx 17.8.11 Update #35 with Ubuntu 16.04. The Domain: HOSTNAME.net:8984 returns results even while setting the firewall against this.

# iptables -L:

Chain INPUT (policy DROP)
DROP       tcp  --  anywhere             anywhere             tcp dpt:8984

Chain FORWARD (policy DROP)
DROP       tcp  --  anywhere             anywhere             tcp dpt:8984
DROP       tcp  --  0.0.0.0              anywhere             tcp dpt:8984
DROP       tcp  --  anywhere             0.0.0.0              tcp dpt:8984
DROP       all  --  anywhere             anywhere

Any Idea how to check if the rule is active or what is wrong with the setting. My goal is to deny the port 8984 for external request but leave it active for localhost (127.0.0.1). Firewall is active.

Francis

Posted 2019-01-18T07:55:25.767

Reputation: 101

Answers

0

I would not bother with iptables in this case; when specifying the forwarding of the port, don't use 0.0.0.0 as the IP address; instead use 127.0.0.1:8984 -> 8983/tcp. Now only localhost access will work.

wurtel

Posted 2019-01-18T07:55:25.767

Reputation: 1 359