Click here to Skip to main content
Click here to Skip to main content

An Easy Firewall Application

By , 9 Oct 2003
 

Sample Image - firewallpapi.jpg

Introduction

When I published my articles about firewall development, I received some e-mails about how to develop a complete firewall solution using the methods described. With this tool I want to give these users an easy example of packet filtering utility.

In this solution I have used Packet Filtering API for Microsoft Windows 2000 and above. I have developed a MFC class wrapper for this API. With this class, I make a simple MFC application that allows a user to set filter rules in local interfaces.

If you want to know more about Packet Filtering API, you can read my article Packet Filtering in .NET. Feel free to e-mail me if you want to know more about this application.

Update history

  • October 6, 2003.- Initial release. Version 1.0.
  • October 9, 2003.- Added support for "default action". Version 1.1.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Jesus Oliva
Chief Technology Officer
Spain Spain
Member
To summarize: learn, learn, learn... and then try to remember something I.... I don't Know what i have to remember...
 
http://www.olivacorner.com

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
Questioncan this app works in bluetooth connection?memberHuGo101121 Mar '05 - 4:27 
hi,
 
may i know whether this application can use in bluetooth connection? anyone can answer me this q? if can not, how or where can i get an example for bluetooth packet filtering app?
 
thanks.
AnswerRe: can this app works in bluetooth connection?memberManir31 Jan '06 - 20:54 
The application does not depend on physical media. It should work for any network - whatever the physical connection is.
 
Please let me know if I provided wrong information
Tomorrow is a blank page

GeneralAbout permitting some packetmemberroversbig13 Jan '05 - 23:38 
your program is very good working.Now, I'm making my final project(for graduate) and choose Firewall application. I use your source code to be a blue print of my project. I have some question to ask you.
If I want to permit packets that come from ip x.x.x.x at port 80 how can I do ?! Cry | :((
 
Thank you so much Smile | :)
Mr.BiG
GeneralRe: About permitting some packetmemberAmit45123 Jul '07 - 23:54 
Please tell me .
Generalpacket apimemberIrish_GUI31 Mar '04 - 8:26 
hi jesus,
i find ur article excellent help,
 
however i am having trouble with one particular fuction in the packet ati
 
PfGetInterfaceStatistics()
 
have u ever used it.
 
and if u have, have u got it to update statistics correctly ?
 
would u be willing to try and help me with this?
it might be an easy problem for you,
but i am baffled Smile | :)
 
Thanks.
Dermot

QuestionHow do I restore my setting after using this?memberbiny2 Jan '04 - 19:06 
Hi,
 
I have tested this program on XP.
Program works fine.
but only when I filter the Internet, problem is occured.
If I stop this filtering or I destroy this app,
I can't use my Internet.
 
My setting is
Source IP -> All
Source Mask -> 0.0.0.0
Source Port -> 80
Dest IP -> All
Dest Mask -> 0.0.0.0
Dest Port -> All
Protocol -> TCP
Action -> Drop
 
Why I can't use the Internet after the filtering
is stopped or this app is destroyed?
Is there any setting that is not removed?
Please help me.
thanks.
AnswerRe: How do I restore my setting after using this?memberJesús O.5 Jan '04 - 9:00 
What do you mean with "filter the internet"?
 
¿Filter web traffic?
 

I test this application a "long time ago" and works fine. Anyway, I will test again in order to check this error. Thanks for your help.
GeneralRe: How do I restore my setting after using this?memberbiny5 Jan '04 - 21:45 
Yes, only web traffic. The others works fine.
Of course, this web traffic(especially HTTP, 80 port) filtering also works fine.
While I push the stop button or destroy this application,
web traffic filtering is not stopped. So, I can't use web(HTTP).
In order to use the web, I should reboot my pc. --;
 
thanks.
GeneralA Firewall in C#memberpalamr1 Jan '04 - 1:58 
Hi,
I am Palaniappan doing my final year engineering(Information technology) in Annamalai University.I have chosen My project as Implementation of Firewalls Using c#.Is this possible?and if so is it really difficult.I have really got little idea abt this.Please help me out in this.Actually i need a lot of help.Thank you.
 
palaniappan
GeneralRe: A Firewall in C#memberJesús O.1 Jan '04 - 5:15 
You only can make a ip filter application using Packet Filtering API with C#. If you want to make more complex firewalls you must learn to develop drivers for windows(C language).

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130523.1 | Last Updated 10 Oct 2003
Article Copyright 2003 by Jesus Oliva
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid