-
Notifications
You must be signed in to change notification settings - Fork 0
Fix prepare-tap script #46
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
base: main
Are you sure you want to change the base?
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.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
| iptables-nft -t nat -A POSTROUTING -s "${ADDRESS}" -j MASQUERADE | |
| "${IPTABLES}" -t nat -A POSTROUTING -s "${ADDRESS}" -j MASQUERADE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
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.