Skip to content

Instantly share code, notes, and snippets.

@tlwr
Created January 27, 2021 14:56
Show Gist options
  • Select an option

  • Save tlwr/7e27440e3e88b372a8f8e2611d6fb0f9 to your computer and use it in GitHub Desktop.

Select an option

Save tlwr/7e27440e3e88b372a8f8e2611d6fb0f9 to your computer and use it in GitHub Desktop.

Revisions

  1. tlwr created this gist Jan 27, 2021.
    6 changes: 6 additions & 0 deletions minimal.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    iptables -A INPUT -i lo -j ACCEPT # Loopback
    iptables -A INPUT -p icmp -j ACCEPT # ICMP
    iptables -A INPUT -p tcp -m tcp --dport 2222 -m state --state NEW,ESTABLISHED -j ACCEPT # SSH port 2222
    iptables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT # DNS response
    iptables -A INPUT -p tcp -m tcp -m state --state ESTABLISHED -j ACCEPT # Established TCP conns
    iptables -A INPUT -j DROP # Drop remaining traffic