Firewall – UFW: How to block http requests on another port than 80

firewallhttpufw

I am running an application on port 7000 which is part of a network. So it has to communicate over port 7000 with all other servers of the network (not LAN, dynamic IPs). It has also a web frontend you can access at http://my.ser.ver.ip:7000 but I want to block the access to the webfront end. How is this possible without block my application at all?

Best Answer

If i understood your question correctly, you have multiple ways to block access to your application from outside the server.

  1. You can set your application to work only with a 127.0.0.1/8 IP address.
  2. You can block it via iptables.

My best practice is the first option.