iptables-converter(8)

πŸ“¦
version 0.9.11 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

iptables-converter β€” the little program that takes your iptables commands from a file and turns them into iptables-restore format πŸ’– (it's giving translator, but for firewalls)


🌸 SYNOPSIS 🌸

iptables-converter [options]

πŸŽ€ DESCRIPTION πŸŽ€

Okay bestie, so here's the tea β˜• β€” iptables-converter grabs a regular file that's full of a whole series of iptables invocations, and it converts that sequence into a format that's compatible with the iptables-restore command. Glow up for your ruleset, no cap ✨

And listen, it does not try to reorder the sequence of your commands. Like, at all. Nothing in the input gets interpreted in any way, shape or form. It's just vibing and converting πŸ¦‹

  • Any input line that does not start with iptables or /sbin/iptables? Ignored. Bye πŸ‘‹
  • Any input line that starts with #? That's a comment, so it gets ignored too πŸ’…

If you run iptables-converter with no arguments at all, it tries to read a file named rules in the workdir. Output goes to stdout. That's the tribute to my way of doing, fr fr 😌

Something needs to be mentioned, and I'm gonna be real with you: iptables -E is intellectually still an unsolved problem and is not implemented for now. Sorry 😭 Thank you for any hints of how to do it β€” I literally can't imagine, because of some lacks in my brain πŸ™ˆ

πŸ’€ EXIT STATUS πŸ’€

Normally iptables-converter returns a value of 0. In the accidental case of errors, exit status 1 is returned. For example, if there are shell variables or shell functions in the input file, those are treated as an error, and it gets reported πŸ“£

To avoid that whole situation, execute your scripts and feed their output as a file to iptables-converter. Main character move, honestly πŸ‘‘


🌈 VERSIONS 🌈

iptables-converter should be compatible to any iptables implementations out in the wild. If it's not, keep me informed, thanks. I'll do my very best 🫢


πŸ’… OPTIONS πŸ’…

  • -d filename, --dest-file=Destinationfile β€” this option's argument defines the destination filename, where the output gets written to. If you omit it, output is written to stdout for your convenience and nowhere else. So you can inspect it, then write to a file for later feeding the iptables-restore command πŸ‘€
  • -s filename, --source-file=Sourcefile β€” this option's argument names the source file, where input is read from. If you omit it, the default filename is rules πŸ“„
  • --sloppy β€” this indicates that -N UserChain is not required prior to mentioning any UserChain input or append. The chain is built on the fly 🧚 It was built in for a special user request, iykyk.

⭐ AUTHOR ⭐

Johannes Hubertz <johannes@hubertz.de> wrote this from 2013 to 2018. Any comments welcome anytime πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

iptables(8) iptables-save(8) iptables-restore(8)


And that's the whole page, bestie β€” written by Johannes Hubertz, August 2018, for iptables-converter(8). Stay firewalled and stay fabulous πŸ’–βœ¨πŸŽ€