command not working to get netsh to block a single IP

B

Bennett Haselton

I have XP Pro SP3. The Windows Firewall is enabled.

I am trying to block a single IP from the command line for testing
purposes. The command "netsh firewall set portopening" outputs a
reference explaining the different options:

set portopening
[ protocol = ] TCP|UDP|ALL
[ port = ] 1-65535
[ [ name = ] name
[ mode = ] ENABLE|DISABLE
[ scope = ] ALL|SUBNET|CUSTOM
[ addresses = ] addresses
[ profile = ] CURRENT|DOMAIN|STANDARD|ALL
[ interface = ] name ]

(followed by lines explaning the options in more detail)

So I took that to mean that the following command would block local
programs from connecting to 96.6.58.135 (www.whitehouse.gov) port 80:

netsh firewall set portopening protocol=ALL profile=ALL port=80
mode=DISABLE scope=CUSTOM addresses=96.6.58.135

When I run that command it outputs simply "Ok." But my browser can
still connect to 96.6.58.135 port 80 (even after restarting the
browser), I can still telnet to 96.6.58.135 port 80 on the command
line, etc. Did I do something wrong? What's the command to block
outgoing connections to a given IP and a given port?

Also I'm not sure how to get netsh to show me a list of IPs that are
blocked. The command "netsh firewall show portopening" shows only the
following:

Port configuration for Standard profile:
Port Protocol Mode Name
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top