Solved

Need a IP-block/unblock Function for Windows2003

Posted on 2006-07-10
5
691 Views
Last Modified: 2013-12-23
Hello Experts,

i have a Windows2003 Server, i need to block and unblock a specific IP by my program. (Simply to block all connection attempts from one IP).

What api's are recommended, what SDK do i need?
A brief description and a example of a function call would be appreciated.

When using a ISA firewall, does a commandlinke tool exist like ip-chains ip-tables on linux?


thanks
Alex P.

0
Comment
Question by:AlexPiko
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:bbao
ID: 17088322
hi Alex,

you can certainly do that with any program called Firewall, either ISA or other 3rd-parties, either free or commercial. but it sounds not necessary to use them only for such a blocking function you need, except you dont care your money or computer performance.

ok. actually, you can block ONE IP with the following single command:

ROUTE ADD 1.2.3.4 mask 255.255.255.255 192.168.0.253

where 1.2.3.4 is the IP you want to block, 192.168.0.253 is a non-existing IP on your local subnet assuming it is 192.168.0.x.

this command will cause you system to reply any request from the specific IP to a null address, which is actually blocking the communication between your host and that IP, beause the remote IP to be blocked will never receive the returning packet.

hope it helps,
bbao
0
 
LVL 1

Author Comment

by:AlexPiko
ID: 17098021
Thankfs for your comment bbao,
very Interesting thing. I didnt thought about routing.
How could this be done? -> BLOCK ALL IP's initially, unblock a few IP's on demand.

0
 
LVL 37

Accepted Solution

by:
bbao earned 250 total points
ID: 17098071
> BLOCK ALL IP's initially (DO THIS FIRST)

redirect all outgoing traffic to an non-existing IP assuming 192.168.0.253:
ROUTE ADD 0.0.0.0 MASK 0.0.0.0 192.168.0.253

or

delete current default gateway to disable all outgoing traffic to other net at all:
ROUTE DELETE 0.0.0.0 MASK 0.0.0.0

> unblock a few IP's on demand. (DO THIS SECOND)

enable a group of IPs (1.2.3.0~1.2.3.15) to access the local host via 192.168.0.1 (the default gateway):
ROUTE ADD 1.2.3.0 MASK 255.255.255.240 192.168.0.1

hope it helps,
bbao
0
 
LVL 1

Author Comment

by:AlexPiko
ID: 17119864
this is a very simple solution.
A good point to start.
thanks
Alex
0
 
LVL 37

Expert Comment

by:bbao
ID: 17120988
simple does not mean weak. right? :) thanks for you grade. enjoy, bbao
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question