Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start writing a firewall for linux? [closed]

I want to develope a firewall for Linux. I prefer C/C++ language.

Is there any simple sample code for writing a firewall?

Which libraries should I use?

Update: There are some firewalls for Linux, but I want develope a simple firewall for learning.

like image 852
Amir Saniyan Avatar asked Oct 13 '25 06:10

Amir Saniyan


1 Answers

You can start by using the Netfilters API (http://www.netfilter.org/). I think it is a good starting point for packet filtering. I've worked a lot with this API in kernel space. I'm not sure if there is a library for user land, but I must tell you that it's pretty easy to develop something with netfilters in the kernel.

As an example, iptables use the netfilters API.

like image 65
Fred Avatar answered Oct 14 '25 22:10

Fred