Skip to content

Instantly share code, notes, and snippets.

@tomkimberlin
Created April 27, 2022 23:32
Show Gist options
  • Save tomkimberlin/c7e4f1b60428967238ff8f2903367204 to your computer and use it in GitHub Desktop.
Save tomkimberlin/c7e4f1b60428967238ff8f2903367204 to your computer and use it in GitHub Desktop.
Simple batch script to block an IP address in Windows Firewall
set ip=%1
netsh advfirewall firewall add rule name="BLOCK IP ADDRESS - %ip%" dir=in action=block remoteip=%ip%
netsh advfirewall firewall add rule name="BLOCK IP ADDRESS - %ip%" dir=out action=block remoteip=%ip%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment