Skip to content

Instantly share code, notes, and snippets.

@Martin91
Created July 22, 2018 07:46
Show Gist options
  • Save Martin91/c59ce0019703f9f076cfd70185f63ac5 to your computer and use it in GitHub Desktop.
Save Martin91/c59ce0019703f9f076cfd70185f63ac5 to your computer and use it in GitHub Desktop.

Revisions

  1. Martin91 created this gist Jul 22, 2018.
    3 changes: 3 additions & 0 deletions iptables_allow_only_localhost.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    # Allow access only localhost by port 1991
    sudo iptables -A INPUT -i lo -p tcp --dport 1991 -j ACCEPT
    sudo iptables -A INPUT -p tcp --dport 1991 -j DROP