Static IP on opensolaris / illumos


Until recently I had totally forgotten about this post but today I had to setup a static IP on my build machine (illumos) , that’s whey I realized that there were a lot of folks who had asked me about this information…
So for all of us ,here it goes..

Execute all these steps as root.

  1.  svcadm disable svc:/network/physical:nwam
  2. vim /etc/hostname.<you’re interface name> ;;  (create if the file does not exist). Here “hostname” is a literal string not the hostname of you’re machine and finally make sure the file reads like this in the first line..
    <Desired IP> netmask <you’re netmask> broadcast + up
    [Save and exit]
  3. vim /etc/defaultrouter ;; (Create if it does not exist) and add you’re router’s IP address in the first line of the file.
    [Save and exit]
  4. Take a look at /etc/hosts file and you should see a line like this…
    <Specified IP> <hostname of machine> <hostname of machine>.local localhost loghost
    [ If you don’t see this then you must add the above line to /etc/hosts file.
    TIP :: You will always have the loopback address (127.0.0.1) specified in that file, just copy paste that line and change the loopback address to you’re static IP ]
  5. svcadm enable svc:/network/physical:default

    Thats about it.. You can use the ifconfig cmd to setup a static IP on the fly like this..
    ifconfig <iface name> netmask <mask address> broadcast + up

    In case you don’t know you’re interface name then just execute “dladm show-phys and what you find under the “LINK” tab would be you’re interface name.
    Once set these changes are persistent .

    PS:: give it a try in Vbox or vmware and let me know if you find any issues in setting it up .. I would be glad to help.

 

Advertisements

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