Skip to content

Instantly share code, notes, and snippets.

@douglas
Created June 18, 2015 19:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save douglas/5ce4625801e4c72ad1d3 to your computer and use it in GitHub Desktop.
Save douglas/5ce4625801e4c72ad1d3 to your computer and use it in GitHub Desktop.
PF rules sshuttle
table <exclude_subnets> {200.152.40.0/24,127.0.0.0/8,10.0.0.0/8}
table <allowed_subnets> {!200.152.40.0/24,!127.0.0.0/8,!10.0.0.0/8}
table <include_subnets> { 0.0.0.0/0}
rdr pass on lo0 proto tcp to <include_subnets> -> 127.0.0.1 port 12300
pass out route-to lo0 inet proto tcp to <include_subnets> keep state
pass out route-to lo0 inet proto tcp to <exclude_subnets> keep state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment