Skip to content

Instantly share code, notes, and snippets.

@otuva
Created August 22, 2025 16:09
Show Gist options
  • Select an option

  • Save otuva/1a63a1b9c678f9770e7df7d905718613 to your computer and use it in GitHub Desktop.

Select an option

Save otuva/1a63a1b9c678f9770e7df7d905718613 to your computer and use it in GitHub Desktop.

Revisions

  1. otuva created this gist Aug 22, 2025.
    3 changes: 3 additions & 0 deletions iptables.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    sudo iptables -I DOCKER ! -s ipyouwanttoallow -j DROP
    sudo iptables -I DOCKER -s localipofyourcontainer -d 0.0.0.0/0 -j ACCEPT
    sudo iptables -I DOCKER -m state --state ESTABLISHED,RELATED -j ACCEPT