A new feature in OpenSolaris is NWAM, the NetWork Auto Magic, um, thingy. It’s a handy tool that automatically configures your network connection. Unfortunately it unhandily has no GUI at the moment, though one is in the works, so if it doesn’t work right first time you can quickly get lost in text files and Google searches. In my case I wanted it to do its normal magic, but to use a static IP address at all times. Here’s how I did it:
svcs svc:/network/physical
This should show that ‘nwam’ is online and ‘default’ is disabled. If it doesn’t, off to Google with you!
Edit the file /etc/nwam/llp
so that it says something like yukonx0 static 192.168.1.50/24
– yukonx0
is the name of your network adapter (mine is for a Mac Mini ethernet port), 192.168.1.50
is the IP you want to assign, and /24
shows that your subnet mask is 255.255.255.0. Your values will vary.
Edit the file /etc/nsswitch.conf
and add dns to the hosts line, to give hosts: files dns
.
Now delete the default route entry (this may well not exist, but it’s safest to remove and recreate): route delete default 192.168.1.1
(your default route may be different). Then add the entry back in permanently: route -p add default 192.168.1.1
.
Finally restart nwam with svcadm restart svc:/network/physical:nwam
and wait for a moment. It should tell you that it’s connected with IP 192.168.1.50 (or whatever you selected). Once that’s done you should be able to connect to the Internet, and more importantly be able to reboot and have it still work. Though it shouldn’t be necessary, if it’s not working immediately try rebooting.