Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added FirewallD support to scripts #388

Merged

Conversation

freysteinn
Copy link

@freysteinn freysteinn commented Apr 4, 2024

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
Copy link
Author

This fixes #387.

@freysteinn
Copy link
Author

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
Copy link
Author

This should fix #241 as well.

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 --skip-alias 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.

Signed-off-by: Frey Alfredsson <[email protected]>
@freysteinn
Copy link
Author

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

@dbaluta dbaluta merged commit d0f4e88 into linux-kernel-labs:master Apr 11, 2024
1 check passed
@lkt-bot
Copy link
Collaborator

lkt-bot commented Apr 11, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants