You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The nftables CLI supports JSON input and JSON output, for example:
# Check JSON file
nft --check --json --file /tmp/nft.json
# List curent rules as JSON
nft --json --stateless list ruleset | jq
# Import JSON rules, first flushing existing rules
nft flush ruleset && \
nft --json --file /tmp/nft.json
However as far as I can see there is no way to take a non-JSON nftables file and render it as JSON or the reverse -- you can only read and write JSON to the kernel directly.
Of course the reverse would also be nice but that would be beyond the scope of jc!
I haven't been able to find an existing way to do this, I'm not a programmer so I don't know how hard this would be to implement but this tutorial and these presentation slides have some useful background on nftables and Python / JSON support.
The text was updated successfully, but these errors were encountered:
The nftables CLI supports JSON input and JSON output, for example:
However as far as I can see there is no way to take a non-JSON
nftables
file and render it as JSON or the reverse -- you can only read and write JSON to the kernel directly.It would be nice to be able to do this:
Of course the reverse would also be nice but that would be beyond the scope of
jc
!I haven't been able to find an existing way to do this, I'm not a programmer so I don't know how hard this would be to implement but this tutorial and these presentation slides have some useful background on
nftables
and Python / JSON support.The text was updated successfully, but these errors were encountered: