LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-16-2007, 11:20 PM   #1
ygramesh
LQ Newbie
 
Registered: Jan 2007
Posts: 1

Rep: Reputation: 0
Source code to block Specific Network protocols/ports


Hello,

I require C Language Source Code to block Specific Network protocols and ports which can be used on LINUX with some documentation

Regards,
Ramesh
 
Old 01-17-2007, 12:22 AM   #2
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware64, LFS
Posts: 312

Rep: Reputation: 53
Lightbulb

The C Programming Language (2nd Edition)





Or, you may want to utilize Netfilter.org's work and use the Iptables framework for building firewalls, which is already in place in the Linux kernel and various related user-land tools, instead of writing your own.
 
Old 01-17-2007, 01:27 AM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
Linux contains a mechanism for doing this and a lot more called netfilter. When building the kernel, it can be excluded, but it is present is kernels which ship with most mainstrean distros.

iptables is a tool used to configure netfilter. There are other tools to do the same thing, which may be more user-friendly. You don't need to write a C program to configure netfilter - just to use one of these tools.

If you're looking for a nice GUI which provides basic personal firewall type configuration options, take a look at firestarter. There are plenty of others too - you're sure to find something which fits your needs.
 
Old 01-17-2007, 07:43 PM   #4
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Just thought I should mention that best practice is to block all ports/protocols/traffic with a firewall, and then open up only that which you need to.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why we can't change the block size in ext2 filesystem in source code nagesh20k Linux - General 3 08-23-2006 04:47 PM
How to block specific IPs? cranium2004 Linux - Networking 3 04-01-2005 09:02 AM
Compiling source code for a network card module WindowsBurner Linux - General 12 02-16-2005 04:22 PM
Compile a source code for FastEthernet Network Card-Please assist badger311 Linux - Networking 4 07-17-2004 02:17 PM
specific source code and RPM for distro bshelton Linux - General 2 09-15-2003 08:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration