LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Source code to block Specific Network protocols/ports (https://www.linuxquestions.org/questions/programming-9/source-code-to-block-specific-network-protocols-ports-520025/)

ygramesh 01-16-2007 11:20 PM

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

jayjwa 01-17-2007 12:22 AM

The C Programming Language (2nd Edition)

:study:



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.

matthewg42 01-17-2007 01:27 AM

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.

Proud 01-17-2007 07:43 PM

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.


All times are GMT -5. The time now is 03:52 PM.