Forrest logo
back to context overview

nft

List of commands for nft:

  • nft:tldr:0349f nft: View current configuration.
    $ sudo nft list ruleset
    try on your machine
    explain this command
  • nft:tldr:10d3f nft: Add a NAT rule to translate all traffic from the `192.168.0.0/24` subnet to the host's public IP.
    $ sudo nft add rule ${nat} ${postrouting} ip saddr ${192-168-0-0-24} ${masquerade}
    try on your machine
    explain this command
  • nft:tldr:13287 nft: Add a new chain to accept all inbound traffic.
    $ sudo nft add chain ${inet} ${filter} ${input} \{ type ${filter} hook ${input} priority ${0} \; policy ${accept} \}
    try on your machine
    explain this command
  • nft:tldr:3fff1 nft: Show rule handles.
    $ sudo nft --handle --numeric list chain ${family} ${table} ${chain}
    try on your machine
    explain this command
  • nft:tldr:57b69 nft: Delete a rule.
    $ sudo nft delete rule ${inet} ${filter} ${input} handle ${3}
    try on your machine
    explain this command
  • nft:tldr:75ade nft: Save current configuration.
    $ sudo nft list ruleset > ${-etc-nftables-conf}
    try on your machine
    explain this command
  • nft:tldr:79a99 nft: Add a new rule to accept several TCP ports.
    $ sudo nft add rule ${inet} ${filter} ${input} ${tcp} ${dport \{ telnet, ssh, http, https \} accept}
    try on your machine
    explain this command
  • nft:tldr:fb70a nft: Add a new table with family "inet" and table "filter".
    $ sudo nft add table ${inet} ${filter}
    try on your machine
    explain this command
back to context overview