-2

In my machine there are 2 ws (web services) which can be accessed from any PC connected to in the same network (wifi for example) .. so i have to install iptables on the machine to prevent any call web services from outside my station.

what are the rules should i configure iptables with ? How can i protect a port which is always open ?

  • Please don't ask the same question on multiple StackExchange sites. If you pick the wrong site, you can ask for it to be migrated or it can be done so by the users of the site. – Ladadadada Mar 04 '13 at 17:26

1 Answers1

1

You don't need iptables to achieve this. Since you don't want any outsider to access the ports on which your web services are listening, apart from your local machine, the best way to go is to have the web service listen on the loopback interface i.e. 127.0.0.1 - I would recommend you follow the documentation of the web service you are running, on how to bind it to the loopback interface.

To confirm that the service is listening on the loopback interface, run netstat -an and look for the port numbers on which the service is listening. Make sure it is not 0.0.0.0 or your local machine's IP address.

Daniel t.
  • 9,291
  • 1
  • 33
  • 36