Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need a IP-block/unblock Function for Windows2003

Posted on 2006-07-10
5
Medium Priority
?
746 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
  • 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 1000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Nslookup is a command line driven utility supplied as part of most Windows operating systems that can reveal information related to domain names and the Internet Protocol (IP) addresses associated with them. In simple terms, it is a tool that can …
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

886 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