How to Block Ports on a Computer
A TCP or UDP port is the way that specific information gets passed into and out of a computer. For example, port 80 is used for HTTP traffic. Port numbers range from 0 to 65535 with ports 0 to 1024 reserved for specific types of traffic. When ports are not in use, they are a security risk. Traffic can get in and out without your knowledge. Blocking ports keeps unwanted traffic from passing through.
Things You'll Need
- Windows XP with Service Pack 2, Windows Server 2003 or a Linux operating system
Windows XP or Windows Server 2003
Download the \"Netdiag.exe\" utility from the Microsoft website.
Install the utility.
Open a Command Prompt window which will be found under the \"Accessories\" submenu of the \"Start\" menu.
Type the command \"cd C:\\Program Files\\System Tools\" folder.
Type the command \"netdiag /test:ipsec\" to check that there are no policies already in place.
Type the command \"IPSeccmd.exe -w REG -p \"Block
Type the command \"netdiag /test:ipsec /debug\" to verify that the filter has been created.
Open a terminal window. This is where you will type the following commands.
Type the command \"su\" to switch to the root user.
Type the command \"iptables -A INPUT -p tcp --destination-port
Type the command \"exit\" to close the root session.