1
1
I use my macbook at home and at work. At work I need to use a static IP, gateway, DNS and net mask. At home I use it in DHCP mode.
Manually setting them every day really sucks.
How can I set them on terminal / applescript?
And how can I get back to DHCP via terminal / applescript?
I have no OS X to check it with, but `ifconfig en0 mystatic_IP mask m.m.m.m' for the IP (set m.m.m.m to the actual desired mask, e.g. 255.255.255.0). DNS: Has OS X an /etc/resolv.conf? Gateway: see route (route add default gw ....) – Hennes – 2013-04-10T11:22:29.837
1Have you looked into using the locations option in Network Preferences? – Bert – 2013-04-10T12:23:05.733