Just a simple Firewall on BPF :)
Linux:
- libbpf
- glibc
git clone https://github.com/m-shiroi/Heimdallr-project .
make
sudo su
- create new virtualenv
virtualenv .venv
- activate virtualenv
source .venv/bin/activate
- load dependencies
pip install -r requirements.txt
python3 hmdl.py -s 2
python3 hmdl.py -A
python3 hmdl.py -d 8.8.8.8
ping 8.8.8.8
python3 hmdl.py --help
...
python3 hmdl.py -D
{
"old_name": "former", #name for file to store firewall former rules in
"rules": [10, 100, 1000, 10000], #number of rules to test
"ping_ip": "www.facebook.com", #address fro latency test
"ping_interval": 0.001, #ping -i flag
"device": 2, #networking device
"ping_rate": 10, #ping -c flag
"iterations": 10, #number of iterations
"mask_distribution": "20:0.001,22:0.001,24:0.02,27:0.05,29:0.1,30:0.3,31:0.4", #distribution of randomly generated ips
"first_octet": "200", #firs harcoded octet of randomly generated ips
"test_dir": "other", #name for directory to save benchmarking data in
"other_name": "other.dat"
}
python3 bench.py
python3 bench.py -B
- Open other terminal window and run:
python3 iperf.py <your IPv4 address>