Setting up a static ip address on OpenSolaris 2008

Posted on December 4, 2008. Filed under: Mac OS |

Yesterday, I found out that my OpenSolaris installation keeps renewing it’s IP address. It should, because by default, it’s configured to be using DHCP. While more of my machines do that, this is the only one which gets a new IP address. A bit annoying, but, since I was already planning on using a static IP address, this was a nice excuse to start on it.

So, with a bit of help (thank Cesar!), I found this page: http://blogs.sun.com/observatory/entry/beyond_dhcp_with_dns_and , which explains clearly on how to setup static ip addresses on OpenSolaris. In short, you need to do the following:

(optional: create a snapshot: zfs snapshot rpool/ROOT/opensolaris@before_static_ip)

Change /etc/nwam/llp to include your new static ip, so it looks like this:
iprb0 static 192.168.1.170

Then, restart the NWAM daemon:
svcadm restart nwam

After that, your DNS and routing doesn’t work anymore. This is fixed by doing a:
cp /etc/nsswitch.dns /etc/nsswitch.conf

Check that the nameserver is here:
/etc/resolv.conf

And create a file /etc/defaultrouter, with the following content:
192.168.1.1

Then, restart the routing:
svcadm restart network/routing-setup

And you have a static ip address. Now, isn’t that much easier that using the X configuration panel……

Advertisements

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: