linux-kernel-labs / linux

Linux kernel source tree
Other
362 stars 265 forks source link

Added FirewallD support to scripts #388

Closed freysteinn closed 6 months ago

freysteinn commented 6 months ago

The default action on Fedora and RHEL-based distributions that use FirewallD is to ban DHCP requests. Instead of telling people to turn off their firewall, I recommend adding the tap interfaces to the FirewallD trusted zone.

This commit adds automatic support to the create_net.sh and cleanup-net.sh scripts that set up the tap interfaces. Due to many distributions using FirewallD these days, I opted for using the following command to check if FirewallD is available:

if [ -e $(which firewall-cmd) ]; then
    sudo firewall-cmd --zone=trusted --change-interface=$device
fi

However, we will have to create a better solution for this in the future.

freysteinn commented 6 months ago

This fixes #387.

freysteinn commented 6 months ago

The cleanup-net.sh script uses a different device variable name than the create_net.sh script. Cleanup uses $i, but create uses $device. To prevent us from having to do the pull-request walk of shame in case it goes past us, I decided to make both scripts follow the same convention for the future.

TL;DR cleanup-net.sh uses $i to refer to the devices while create_net.sh uses $device. This commit updates cleanup-net.sh to use $device to make it easier for the future.

freysteinn commented 6 months ago

This should fix #241 as well.

freysteinn commented 6 months ago

Apart from waiting, is there anything else I need to do?

lkt-bot commented 6 months ago

Published at http://linux-kernel-labs.github.io/refs/pull/388/merge