Open
Conversation
Fedora 42 now features new iptables, reflect this in the script. Also fix few minor issues: move out sysctl bit to make it independent, and correct getopts syntax to not require a value for -i/-f/-o.
Molter73
reviewed
Jun 26, 2025
scripts/network/prepare-tap.sh
Outdated
| iptables -t nat -A POSTROUTING -s "${ADDRESS}" -j MASQUERADE | ||
| iptables -A FORWARD -i "${NAME}" -s "${ADDRESS}" -j ACCEPT | ||
| iptables -A FORWARD -o "${NAME}" -d "${ADDRESS}" -j ACCEPT | ||
| iptables-nft -t nat -A POSTROUTING -s "${ADDRESS}" -j MASQUERADE |
Contributor
There was a problem hiding this comment.
Would it be worth it to make some checks instead of hardcoding the iptables command to be used? Something like:
IPTABLES=iptables
if command -v iptables-nft &> /dev/null; then
IPTABLES=iptables-nft
fiThen you can use it like this:
Suggested change
| iptables-nft -t nat -A POSTROUTING -s "${ADDRESS}" -j MASQUERADE | |
| "${IPTABLES}" -t nat -A POSTROUTING -s "${ADDRESS}" -j MASQUERADE |
Collaborator
Author
There was a problem hiding this comment.
I was thinking about this, but eventually decided that this script is purely a development help for us, and since we have more or less uniform dev environment it makes little sense. But if you insist I can add this.
Molter73
reviewed
Jul 1, 2025
Co-authored-by: Mauro Ezequiel Moltrasio <moltrasiom@hotmail.com>
Co-authored-by: Mauro Ezequiel Moltrasio <moltrasiom@hotmail.com>
Co-authored-by: Mauro Ezequiel Moltrasio <moltrasiom@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fedora 42 now features new iptables, reflect this in the script. Also fix few minor issues: move out sysctl bit to make it independent, and correct getopts syntax to not require a value for -i/-f/-o.