0

In my office I have 2 ethernets to work with... 1 is kinda closed, primarily for development purpose... with it I have access to important stuff that i use very oftenly, such as web-services and dev/staging servers... the other is a FFA ethernet, which is very good because i can access blogs, youtube, and AskDifferent.com...

My problem here is that one uses a proxy server for HTTP/S, the other doesn't... So at least 5 times every hour I, not only have to switch the ethernet cable, have to open network preferences and switch on/off the proxy configurations, which leads to my question: Is there a way to automate this? like, if Ethernet A, use proxy, if B don't use or something like that?

  • what, whos proxy ? is it limiting your usage on it. – Ruskes Sep 17 '14 at 1:17
  • @Buscar웃 yes... the proxy is necessary on the intranet network and it blocks almost everything... basically allows only 10.0.0.0 and 192.168.0.0 – Leonardo Sep 17 '14 at 1:22
1

You can't do this automatically, that I'm aware of, but you can make it simpler:

Setup each ethernet as it's own location in the Network preferences pane, then use the Apple Menu -> Locations menu to chose the location when you switch.

Turns it into changing the network cable, and a single click.

http://osxdaily.com/2013/07/01/change-network-location-quickly-mac-os-x/

OR:

If the internal dev ethernet is only internal (no external access), just have it bypass the proxy for those hosts and domains, and leave the proxy settings in all the time. That way they'll only use the proxy when on the open network going externally, or vice versa.

OR:

Get another ethernet interface, keep both open all the time, and configure each appropriately. USB->Ethernet converters are available cheaply.

1

use command in Terminal:

sudo networksetup -setwebproxystate 'Wi-Fi' on:open http proxy

sudo networksetup -setsecurewebproxystate 'Wi-Fi' on:open https proxy

Wi-Fi is the network your mac connect to.

furthere more: set alias in you bash or zsh...

alias pon="sudo networksetup -setwebproxystate 'Wi-Fi' on"

alias spon="sudo networksetup -setsecurewebproxystate 'Wi-Fi' on"

then just type pon or spon in your terminal.

ps:set off to close proxy

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .