Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > The Linux Kernel > Port Blocking

Forgot Password?
 The Linux Kernel   Compiling, theory, programming or other discussion about the linux kernel

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 11-08-2004   #1 (permalink)
Just Joined!
 
Join Date: Nov 2004
Posts: 5
Port Blocking

Need a point in the right direction. I have been given a project for school to modify the linux kernel to block IP ports. I am suppose to create whatever system calls or kernel modules I need and, modify whatever system calls or kernel modules I need to modify to do this task. I am suppose to have a text file that will have the port number and IN/OUT/BOTH as to what to block. All ports are blocked unless specified in the text file. I am new to the linux operating system, so far the only thing in Linux that I know how to do is create a system call, and rebuild the kernel, and thats about it. I am not looking for an answer to this problem, just a point in the right direction. I know a little bit about networking, but not from a Linux perspective. Can anyone please help!

I am running redhat 8 kernel 2.4.21
rjston is offline  


Reply With Quote
Old 11-09-2004   #2 (permalink)
Content Team
 
sarumont's Avatar
 
Join Date: Apr 2003
Location: /dev/urandom
Posts: 3,682
First off, IP blocking has been in the kernel for ages. Check out netfilter.org. Secondly, your question is muddled and poorly phrased. If you want help, please be rephrase your question.
__________________
"Time is an illusion. Lunchtime, doubly so."
~Douglas Adams, The Hitchhiker's Guide to the Galaxy
sarumont is offline   Reply With Quote
Old 11-15-2004   #3 (permalink)
Just Joined!
 
Join Date: Nov 2004
Posts: 5
You can allow and deny in /etc/hosts.allow and /etc/hosts.deny files.

cheers
naveen
naveen.yadav is offline   Reply With Quote
Old 11-16-2004   #4 (permalink)
Just Joined!
 
Join Date: Aug 2003
Location: Sydney, Australia
Posts: 52
Hi rjston,


Sounds like a job for an "iptables" script to me.
The link to "netfilter.org" above should cover all that.

"iptables" exists as a separate package to the
kernel and will be available either pre-compiled or
as source. The kernel only provides a set of "hooks"
that allows for it's use. It is an excellent kernel
level, extensible, firewalling facility.

It is so good, you can even block your self out
of your own machine. Nothing that "single" user mode can't fix though .

It will try to install a boot script in your
"init.d" directory, ok if your into stuff like that.
I prefer to start it manually, when needed though.
But each to their own i guess .

A visit to http://projectfiles.com/firewall/
may be useful. They have an script available for
down load, which can act as a template for
personal modifications.

iptables is a very straight forward blocking system,
quite easy to understand and configure.
After the initial exposure period.

You may find it worth while to look into some packages
like "guardog", for a qt/kde gui front end, to
automate the configuration process. Not sure on it's
site at the moment. It'll be on google somewhere
though

After all that, check out //grc.com to test your
system.


jm
jjmac is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 10:24 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2