countdrachma Posted February 2, 2013 Share Posted February 2, 2013 I was wondering if someone was able to help me in developing a workflow that will set the static IP address of my ethernet port (en0) via a workflow? Ideally, I'd like to be able to set the IP address, subnet mask and default gateway variables for this interface via a workflow. Although it doesn't sound that hard / complex, I don't even know where to start as I have no idea on scripting. Any help would be much appreciated. Cheers Link to comment
jdfwarrior Posted February 2, 2013 Share Posted February 2, 2013 I'd be happy to assist you. I'd have to look up and see how to set that programmatically but, how often do you actually statically set the ip address? Link to comment
countdrachma Posted February 2, 2013 Author Share Posted February 2, 2013 Thanks for the offer David! I admit, it sounds like a pretty infrequent requirement but in my role as a network engineer, I move from network to network frequently. Particularly if I'm staging a new network (which predates having DHCP address infrastructure), I can swap subnets 8-10 times a testing session and having a way to do this via an Alfred workflow would be much more efficient than doing this through the traditional system preferences / network settings. Cheers (and thanks again) Link to comment
jdfwarrior Posted February 2, 2013 Share Posted February 2, 2013 Ah gotcha. Ill look into it for ya then and see how easily it can be done Link to comment
countdrachma Posted February 2, 2013 Author Share Posted February 2, 2013 Thanks heaps. If you can pull it off, I'll owe you some virtual beers somehow! Link to comment
CarlosNZ Posted February 2, 2013 Share Posted February 2, 2013 (edited) Ignore. Replied to wrong post. Edited February 2, 2013 by CarlosNZ Link to comment
jdfwarrior Posted February 3, 2013 Share Posted February 3, 2013 Ok, so, I was being lazy and didn't really try this. According to the command documentation it SHOULD work, but try this out and let me know if it works for you. Example: setip 192.168.1.100 255.255.255.0 192.168.1.1 It will give you options of which interface to set it on. The list of interfaces aren't actionable until all 3 ips are entered and valid. Download countdrachma 1 Link to comment
countdrachma Posted February 3, 2013 Author Share Posted February 3, 2013 That's brilliant thanks David. Works perfectly thanks. It does actually require you to authenticate to apply the changes as part of the networksetup (ie. networksetup is trying to modify the system network configuration. Type your password ....). Not a big deal to overcome this though and presumably, there wouldn't be a way around that anyway from the script perspective, so I'm more than happy this workflow is as optimal as it can be and will help me out heaps. Once again, I really appreciate your effort David. I tip my hat to you sir. Cheers Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now