Skip to content

Conversation

@erthalion
Copy link
Collaborator

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.

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.
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
Copy link
Contributor

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
fi

Then 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

Copy link
Collaborator Author

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.

erthalion and others added 3 commits July 1, 2025 14:18
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
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.

2 participants