Skip to content

This python program analyzes every packet that arrives at FW servers and processes it according to defined rules.

License

Notifications You must be signed in to change notification settings

wgdcm/python_firewall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Firewall

This python program analyzes each and every packet which comes into the FW Servers and forward, drop according to the defined rules.

Requirements

-Linux operating system with 2 network interfaces.

-Install Python3.

sudo apt-get update
sudo apt-get install python3.6

Setup

Create 2 network interfaces. Assign any IP address for the interfaces. All firewall rules can define in the rules.conf file. When you run the program, the rules.conf file must be in the same directory. The contents of the rules.conf file includes how to use it.

How to run

Run this command in a Linux environment.

sudo python3 firewall.py

You will be asked what are two interfaces you need to run the program.

Provide the correct interface names for the program.

Note

The firewall program reads these rules from top to bottom.
You can define ACL rules based on priority.
In the first field, you can define "ALLOW" or "DENY". Other words are not allowed.
In the second field, you can define the protocol. Permitted protocols are "TCP", "UDP" and "ICMP".
In the third field, you can define the source IP or type "any" to accept all IP addresses.
In the fourth field, you can define the destination IP or type "any" to accept all IP addresses.
Separate each field with a comma.

ex: allow, icmp, any, any

About

This python program analyzes every packet that arrives at FW servers and processes it according to defined rules.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages