gamemann / XDP-Firewall

A firewall that utilizes the Linux kernel's XDP hook. The XDP hook allows for very fast network processing on Linux systems. This is great for dropping malicious traffic from a (D)DoS attack. IPv6 is supported with this firewall! I hope this helps network engineers/programmers interested in utilizing XDP!
https://deaconn.net/
MIT License
492 stars 87 forks source link

Daemon mode doesn't unload xdp when service stopped #15

Closed omicronn88 closed 2 years ago

omicronn88 commented 2 years ago

Hi, really nice work you did. I find this tool very useful. However, I noticed that when I start it via systemd service the xdp program doesn't get unloaded from an interface after I stopped it, hence the firewall continues working. I fixed it by adding this line in the systemd unit but I don't know if it's the best solution ExecStopPost=/bin/bash -c "/bin/ip link set dev $(grep -E ^interface /etc/xdpfw/xdpfw.conf | sed -En 's/^.+=|[\"; ]//gp') xdp off"

gamemann commented 2 years ago

Hey and thank you!

Would you be able to make a pull request for this? I don't want to make a commit for it because I'd prefer if you got the credit for that :)

omicronn88 commented 2 years ago

Sure, done :)