Bypass Proxy Settings

msample
Contributor II

Have there been any other attempts to automate adding: swcdn.apple.com, swdownload.apple.com, swquery.apple.com,swscan.apple.com, to the "Bypass Proxy Settings" field?

1742b891e91643eba404dd9c0480b459

13 REPLIES 13

davidacland
Honored Contributor II

Have you checked out this

msample
Contributor II

@ davidacland Yes, great post, and thanks for sharing. I've referenced this for auto-populating the URL proxy fields (i.e., http and https). But I'm working with the task of auto populating the huge field beneath. Researching which plist sees this field and how to write to it via script. This is an interesting alternative with not being having APNS in place. Any ideas?

Josh_Smith
Contributor III

I use the networksetup command for this.

networksetup -setproxybypassdomains $networkservice "$EXCEPTION1" "$EXCEPTION2" "$EXCEPTION3" "$EXCEPTION4" "$EXCEPTION5" "$EXCEPTION6" "$EXCEPTION7" "$EXCEPTION8"

msample
Contributor II

@Josh.Smith Josh can I auto populate this into the ByPass field? (ex: networksetup -setproxybypassdomains $networkservice "swscan.apple.com" "swquery.apple.com" "swcdn.apple.com" "swdownload.apple.com" ?)

Josh_Smith
Contributor III

Yes you can hardcode the values in like in your example. You can also hardcode the networkservice name (example: "Thunderbolt Ethernet") if appropriate.

msample
Contributor II

@Josh.Smith I thought to first test populating the field just through terminal, but I ran into this error:f978618a91744c288b69058f405e7620

Josh_Smith
Contributor III

@msample Try this (you'll need to enter your network service name, it may not be "Display Ethernet")

sudo networksetup -setproxybypassdomains "Display Ethernet" "swscan.apple.com" "swquery.apple.com" "swcdn.apple.com" "swdownload.apple.com"

Before:
282df6f1a3034b11acd8facc4784a88c

After:
f8bde21ba3dc41328c6794cd431d400e

msample
Contributor II

@Josh.Smith Dropped in the Network Service name (i.e., sudo networksetup -setproxybypassdomains "Thunderbolt-Ethernet" "swscan.apple.com" "swquery.apple.com" "swcdn.apple.com" "swdownload.apple.com"). but the error is the same...

884290647b934f9fbc1f93ec5d442330

I'm wondering if I add more specific direction with the proxies tab... (i.e., sudo networksetup -setproxybypassdomains "Thunderbolt-Ethernet" "Proxies" "swscan.apple.com" "swquery.apple.com" "swcdn.apple.com" "swdownload.apple.com") ???

msample
Contributor II

Just ran another test directed through the "Proxies" tab...no success populating the BP field....

2d43f3f5bc004ed1b89dd9dc7267349c

So targeting the network database is the key component

Josh_Smith
Contributor III

The issue is likely the hyphen in

Thunderbolt-Ethernet

To get the list of valid options on your system for that value run this:

networksetup -listallnetworkservices

My MBP connected to an Apple display gives these networkservices:

*Bluetooth DUN 5
Thunderbolt Ethernet
Display Ethernet
Display FireWire
*Wi-Fi
*Bluetooth PAN
Thunderbolt Bridge

So I could run any of these (or ideally use a script that pulls the names in dynamically and configures them as desired):

networksetup -setproxybypassdomains "Display Ethernet" "swscan.apple.com" "swquery.apple.com" "swcdn.apple.com" "swdownload.apple.com"
networksetup -setproxybypassdomains "Thunderbolt Ethernet" "swscan.apple.com" "swquery.apple.com" "swcdn.apple.com" "swdownload.apple.com"
networksetup -setproxybypassdomains "Wi-Fi" "swscan.apple.com" "swquery.apple.com" "swcdn.apple.com" "swdownload.apple.com"

msample
Contributor II

@Josh.Smith Works beautifully from the command line, Josh. Building a script to auto-populate the field and will test further.

msample
Contributor II

Figured out how to make it populate.

Created a policy, checked the "Custom" button...
- Custom Event jamf policy -trigger thenameofyourpolicy
- Execution Frequency once per user
- Recurring Check-in

Create a script to attach to the policy (#!/bin/sh not #!bin/bash), and add the Files and Processes payload.

In the File and Processes payload, configure the "Execute Command" field with:
networksetup -setproxybypassdomains "Thunderbolt Ethernet" .local 169.254/16 swscan.apple.com swquery.apple.com swdownload.apple.com swcdn.apple.com*

Tested not attaching a script to this, but the configuration never populated the bypass proxy field.

michaelmcgaw
New Contributor III

Is there anyway to set the proxy bypass domains on a global system level rather than network service by network service?