C++ – How do I start writing a firewall for Linux?

How do I start writing a firewall for Linux?… here is a solution to the problem.

How do I start writing a firewall for Linux?

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

Is there any simple sample code to write a firewall?

Which libraries should I use?

Update: There are some Linux firewalls, but I would like to develop a simple firewall to learn.

Related Problems and Solutions