1

I'm writing a Python script that changes network settings with commands like networksetup -setv4off 'PANTECH UML295' and networksetup -setdhcp 'PANTECH UML295'. When I enter these in Terminal, I enter my root password, and then nothing changes in Network settings. Enabling/disabling WiFi using networksetup setairportpower en1 off seems to work fine, however. Any idea on what might be the problem? Can't seem to find anything through search. Thanks.

  • You won't see anything change in the network settings, you have go to the advanced setting, to see those. Also I assume you skipped clientid argument in the -setdhcp here. Do networksetup -getinfo PANTECH\ UML295 to see the changes. – user14492 May 5 '15 at 19:32
  • @user14492 All I want to do is change the Configure IPv4 under Network settings between Using DHCP and Off, which I had been able to do before. I'm on a fresh install of OS X so I don't know what could be the problem. – EricY May 6 '15 at 17:13
  • It seems to work for me, to set it to off I just did networksetup -setv4off Thunderbolt\ Ethernet and to set it back to Using DHCP, networksetup -setdhcp Thunderbolt\ Ethernet. Make sure you're writing the name correctly, and for both the commands it needs the network service name. Which you can get by networksetup -listallnetworkservices. Try those commands in the Terminal and see if they produce any errors. – user14492 May 6 '15 at 19:13
  • @user14492 That is strange. That is exactly what I've been doing and still nothing changes after entering root password. – EricY May 7 '15 at 17:13

You must log in to answer this question.

Browse other questions tagged .