-
-
Save ursuad/33f719eb171bce0a973e4fe6111b7f8c to your computer and use it in GitHub Desktop.
Revisions
-
mowings revised this gist
Jan 4, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ #!/bin/bash interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) ) rulefile="rules.tmp" echo "" > $rulefile sudo pfctl -a com.apple/tun -F nat -
mowings created this gist
Jan 4, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ #!/bin/bash interfaces=( $(ifconfig | grep 'utun.*mtu 1500' | cut -d ':' -f 1)) rulefile="rules.tmp" echo "" > $rulefile sudo pfctl -a com.apple/tun -F nat for i in "${interfaces[@]}" do RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}" echo $RULE >> $rulefile done sudo pfctl -a com.apple/tun -f $rulefile