Skip to main content
Question

Bypass Proxy Settings

  • Jul 24, 2015 7:54 PM UTC
  • 13 replies
  • 290 views

msample
Forum|alt.badge.img+9

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?

13 replies

davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • Jul 24, 2015 8:10 PM UTC

Have you checked out this


msample
Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • Jul 24, 2015 8:22 PM UTC

@ 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?


Forum|alt.badge.img+14
  • Contributor
  • Jul 27, 2015 1:33 PM UTC

I use the networksetup command for this.

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

msample
Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • Aug 12, 2015 6:06 PM UTC

@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" ?)


Forum|alt.badge.img+14
  • Contributor
  • Aug 12, 2015 6:51 PM UTC

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


msample
Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • Aug 12, 2015 8:20 PM UTC

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


Forum|alt.badge.img+14
  • Contributor
  • Aug 12, 2015 8:51 PM UTC

@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:

After:


msample
Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • Aug 13, 2015 12:51 AM UTC

@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...

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
Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • Aug 13, 2015 1:07 AM UTC

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

So targeting the network database is the key component


Forum|alt.badge.img+14
  • Contributor
  • Aug 13, 2015 12:34 PM UTC

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
Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • Aug 14, 2015 7:09 AM UTC

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


msample
Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • Aug 21, 2015 12:33 AM UTC

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.


Forum|alt.badge.img+5
  • Contributor
  • Aug 28, 2019 6:30 PM UTC

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