Skip to content

Instantly share code, notes, and snippets.

@loskiq
Last active August 28, 2024 10:38
Show Gist options
  • Select an option

  • Save loskiq/49a5dbecbf3b5d5aa7e24d31391b8c54 to your computer and use it in GitHub Desktop.

Select an option

Save loskiq/49a5dbecbf3b5d5aa7e24d31391b8c54 to your computer and use it in GitHub Desktop.

Revisions

  1. loskiq revised this gist Aug 28, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nftables.conf
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ table ip filter {
    set allow-ssh {
    type ipv4_addr
    flags interval
    elements = { 7.9.8.0/24 }
    elements = { 7.9.8.0/24, 1.2.3.4 }
    }

    chain input {
  2. loskiq created this gist Aug 28, 2024.
    12 changes: 12 additions & 0 deletions nftables.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    table ip filter {
    set allow-ssh {
    type ipv4_addr
    flags interval
    elements = { 7.9.8.0/24 }
    }

    chain input {
    type filter hook input priority filter; policy accept;
    ip saddr != @allow-ssh tcp dport 22 ct state new reject with tcp reset
    }
    }