Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Need a IP-block/unblock Function for Windows2003

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

We recently endured a series of broadcast storms that caused our ISP to shut us down for brief periods of time. After going through a multitude of tests, we determined that the issue was related to Intel NIC drivers on some new HP desktop computers …
This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

670 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