Opening/closing ports in Windows

5 pts.
Tags:
Windows Commands
Windows Server 2003
Windows Server 2003 administration
is there a command to open or close ports in windows and if so what is it?
ASKED: August 11, 2010  5:44 PM
UPDATED: August 12, 2010  4:39 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

When no firewall is involved, a port is open when a service/program is listening on that port. If you want to open a port then you need to start the program/service that listens on that port.

Once a program/service is listening on a port, you can close the port with the help of a firewall.

The Windows’ firewall closes ports by default, but you can add the appropriate exceptions to open them. These exceptions can be added in the GUI, or using the <a href=”http://msdn.microsoft.com/en-us/library/aa364679(VS.85).aspx”>Windows Firewall API</a> from a program or script.

—————————

While I agree that it takes a program to open a “listening” port, a firewall does not necessarily “close” a port. A firewall <b>filters</b> traffic to/from a particular port to ensure it meets the defined rules for that application/service/user, etc.

Ports are typically opened on a machine when an application is started that sends traffic to a destination host/service – this creates a SOURCE port. When an application is started on a machine that provides services to other systems – that creates a DESTINATION port. The directions will be changed when traffic goes between the client and the server. In some cases the source port becomes the destination port when traffic is returned from the hosting system/service.

Can you tell us more about what you are wanting to do to open/close ports on a Windows system?

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    I absolutely agree that a firewall doesn't "close" ports. I just thought, based on the question wording, that a more detailed explanation could not be (completely) understood by the OP.
    65,110 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following