Last active
July 31, 2019 18:55
-
-
Save stefanlasiewski/4c6eb05d5737a3f1dbe98ba8e234531c to your computer and use it in GitHub Desktop.
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 characters
# List all network interfaces on my Mac | |
``` | |
$ networksetup -listallnetworkservices | |
An asterisk (*) denotes that a network service is disabled. | |
Display Ethernet | |
Thunderbolt Ethernet | |
Wi-Fi | |
Display FireWire | |
Bluetooth PAN | |
Thunderbolt Bridge | |
``` | |
# View state of SOCKS proxy for an interface | |
``` | |
$ networksetup -getsocksfirewallproxy "Display Ethernet" | |
Enabled: No | |
Server: | |
Port: 0 | |
Authenticated Proxy Enabled: 0 | |
$ | |
``` | |
# Enable the SOCKS proxy for an interface | |
``` | |
$ networksetup -setsocksfirewallproxystate "Display Ethernet" on | |
$ networksetup -getsocksfirewallproxy "Display Ethernet" | |
Enabled: Yes | |
Server: on | |
Port: 0 | |
Authenticated Proxy Enabled: 0 | |
$ | |
``` | |
# When testing a SOCKS proxy on a Mac, do this to unload/reload the .pac file. | |
# Unloading and reloading the .pac file through the Mac GUI can be a pain. | |
``` | |
$ networksetup -setsocksfirewallproxystate "Display Ethernet" off | |
$ networksetup -getsocksfirewallproxy "Display Ethernet" | |
Enabled: No | |
Server: on | |
Port: 0 | |
Authenticated Proxy Enabled: 0 | |
$ networksetup -setsocksfirewallproxystate "Display Ethernet" on | |
$ networksetup -getsocksfirewallproxy "Display Ethernet" | |
Enabled: Yes | |
Server: on | |
Port: 0 | |
Authenticated Proxy Enabled: 0 | |
$ | |
``` | |
# List the status of all services | |
``` | |
$ networksetup -listallnetworkservices | grep -v 'denotes that a network service is disabled.' | while read SERVICE | |
do | |
echo "### $SERVICE" | |
networksetup -getsocksfirewallproxy "$SERVICE" | |
done | |
### Display Ethernet | |
Enabled: Yes | |
Server: on | |
Port: 0 | |
Authenticated Proxy Enabled: 0 | |
### Thunderbolt Ethernet | |
Enabled: Yes | |
Server: on | |
Port: 0 | |
... | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment