↑ ↓ select, Enter open, Esc close

Open a port with nftables

Caution: This command changes the system. Understand what it does before you run it.

Adjust the values, the command updates live
root@server
nft insert rule inet filter input tcp dport 443 accept

Inserts the rule at the top of the input chain in the inet filter table, which is defined in the Debian template /etc/nftables.conf. Using insert instead of add places the rule before any drop rules. The rule applies immediately, but only until a reboot or until nftables.service is reloaded.

Note: The rule only becomes permanent with an entry in /etc/nftables.conf. If the table does not exist, nft reports No such file or directory.

Open question before approval: Prüfen, ob auf Plesk-Servern mit Firewall-Erweiterung die Tabelle inet filter existiert oder die Plesk-Regeln nur in ip filter liegen.

Also searched as

  • nftables open port
  • nft allow tcp port
  • nft insert rule accept

Related one-liners

All in Firewall

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.