Solved

Need a IP-block/unblock Function for Windows2003

Posted on 2006-07-10
5
564 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:Bing CISM / CISSP
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:
Bing CISM / CISSP 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:Bing CISM / CISSP
ID: 17120988
simple does not mean weak. right? :) thanks for you grade. enjoy, bbao
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 …
Resolve DNS query failed errors for Exchange
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now