how can I deny access to an ipaddress in windows?

mcveigh

Diamond Member
Dec 20, 2000
6,457
6
81
I thought I could do it in my router (wrt54g) but it seems to only want domain names.
say I want to block all traffic to 192.168.1.2...any ideas?
 

Cheetah8799

Diamond Member
Apr 12, 2001
4,508
0
76
If you want to do it on just one computer, you edit the HOSTS file located at c:\windows\system32\drivers\etc and set 192.168.1.2 to point back to itself.

add a line like this:

192.168.1.2 localhost
 

mcveigh

Diamond Member
Dec 20, 2000
6,457
6
81
cool! I was trying that but doing

192.168.1.2 127.0.0.1...it was still going out
 

mcveigh

Diamond Member
Dec 20, 2000
6,457
6
81
no luck..i may be wrong but if it's an ip address I am trying to block wont it go directly to the address b/c it has no need of the hosts file or DNS?
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Do you want to block all traffic TO the internet FROM 192.168.1.2? Or TO 192.168.1.2 FROM the internet? Or TO 192.168.1.2 FROM the rest of the netblock? :p

Try putting in an IP address where it asks for a domain. It might work. :)
 

Cheetah8799

Diamond Member
Apr 12, 2001
4,508
0
76
Do you want to block all traffic TO the internet FROM 192.168.1.2? Or TO 192.168.1.2 FROM the internet? Or TO 192.168.1.2 FROM the rest of the netblock?

I suppose I should have asked that as well. If you want to block both ways, you'll probably have to do it at the router. At least that would be the logical and easiest place. Unless if the router isn't going to cooperate...
 

mcveigh

Diamond Member
Dec 20, 2000
6,457
6
81
I want the computer to have no outgoing access to specified addresses
 

Torghn

Platinum Member
Mar 21, 2001
2,171
0
76
I would think most entry level routers will only block specific domains for the entire network, not just one IP. Unless you want to install software on that comp this would defiantly need to be set in the router.
 

Garion

Platinum Member
Apr 23, 2001
2,331
7
81
The best way to do this is to add static routes to your machine. Let's say you want to block access to 100.10.20.30 from your PC.

First, get your local IP address with "ipconfig" from the command line. Let's say it.s 192.168.0.100. You need to pick, at random, another IP address on this network that's not in use. In this case, pick 192.168.0.222.

And the command line, enter:

"ROUTE -P ADD 100.10.20.30 MASK 255.255.255.255 192.168.0.222"

Here's how this decomposes.

ROUTE - The command to view or edit your static routing table
-P - Make it a persistent route that re-loads on reboot
100.10.20.30 - The IP address being blocked
MASK - Says the next number coming is the subnet mask
255.255.255.255 - Subnet mask for an individual IP address instead of a network
192.168.0.222 - The place the traffic for this IP should be sent (called the gateway). In this case, we use a bogus IP address on your local network so that the traffic just dies.

Should do exactly what you want. If you want to remove it, do a "ROUTE DELETE 100.10.20.30"

- G