Solved

Need a IP-block/unblock Function for Windows2003

Posted on 2006-07-10
5
648 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

A common practice in small networks is making file sharing easy which works extremely well when intra-network security is not an issue. In essence, everyone, that is "Everyone", is given access to all of the shared files - often the entire C: drive …
Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 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