Skip to content

Instantly share code, notes, and snippets.

@n1mh
Created January 13, 2017 13:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n1mh/0f3aa2b3cbec03f788755aa3714bad43 to your computer and use it in GitHub Desktop.
Save n1mh/0f3aa2b3cbec03f788755aa3714bad43 to your computer and use it in GitHub Desktop.
ufw deny outgoing connections
#!/bin/bash
UFW="sudo ufw"
$UFW --force reset
$UFW default allow incoming
$UFW default deny outgoing
$UFW deny out on eth0
$UFW allow from 192.168.1.0/24
$UFW allow ssh
$UFW allow http
$UFW allow https
$UFW --force enable
$UFW logging off
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment