Skip to main content
Question

Bypass Proxy Settings

  • July 24, 2015
  • 13 replies
  • 77 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
  • July 24, 2015

Have you checked out this


msample
Forum|alt.badge.img+9
  • Author
  • Valued Contributor
  • July 24, 2015

@ 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
  • July 27, 2015

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
  • August 12, 2015

@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
  • August 12, 2015

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
  • August 12, 2015

@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
  • August 12, 2015

@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
  • August 13, 2015

@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
  • August 13, 2015

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
  • August 13, 2015

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
  • August 14, 2015

@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
  • August 21, 2015

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
  • August 28, 2019

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