OpenSolaris  
 Open Source Software for Solaris
An OpenSolaris Community Site
 Current Software Packages
Open Bug Tracking
   

         : Action to Take : Please read everything below this picture.


image 130


    I wanted to verify that my network was up and working.  What you see above is how I did two things:

  1. I tried to ping a nearby neighbor machine on the same subnet,
  2. then changed the ip address of the machine to 192.168.35.44 and,
  3. finally realized that my ethernet cable was not plugged in.
    Yes, it has been a long day. :-)

    So this is actually a good practical example of how to modify the network ip address of your Solaris server as well as check the network route table and test for connectivity.  I hope that you managed to get the correct address from your network admin or that maybe you are the network admin.  In either case I want to show you what I did and how I did it.

    First I issued a simple ping command.  Ping is the all time great network tester and I don't really know what it stands for.  I do know that you should be able to ping something nearby on the same network segment in order to verify that packets are flowing.

    I tried and failed.

    Before bothering to look at the back of the machine I issued the command netstat -rn which dumps out the network routing table in simple numerical format.  There I see that yes indeed my default route was set to 192.168.35.1 exactly as expected.  Then I thought to myself “gee, am I even in the correct ip range or do I have an ip address conflict with some other device somewhere?”  For the sake of further embarassment I did not get out of my chair and actually check for the bloody ethernet cable.  Instead I changed the ip address on the fly via the dreaded ifconfig command.  I say dreaded because it has more options than you can shake a stick at.  It's powerful and it can do great and amazing things in Solaris like assign an interface to a Zone or make fail-over network devices or setup dedicated point to point ethernet links.  At the very least it can change my machines ip address right now.

    Here is how you change a network interface network address :
  1. Take the interface down or off-line thus :
    ifconfig pcn0 down

  2. Set a new address and the same netmask thus :
    ifconfig pcn0 192.168.35.44 netmask 255.255.255.0

  3. Bring the interface back on-line :
    ifconfig pcn0 up

    Here is how you flush the network routing table and then apply the exact same default route again.  I want to point out that this is completely unrequired but educational :
  1. Flush out the network route table :
    route -f

  2. Add a new ( same old thing actually ) default network route :
    route add default 192.168.35.1

    When I tried my little ping test again and saw no response there was a little bird in the window that said, with the clearest New York Jewish Mother accent, “check tha network cable ya schmuck!”



<< previous     next >>


  ©2002-2007 blastwave.org.    OpenSolaris and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.     UNIX is a registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd.      All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the United States and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc.      All other logos and trademarks are registered through their respective owners.      ©2002-2007 blastwave.org™      See “Terms of Use”      Sun™ Logo and OpenSolaris™ Published with Permission from Sun Microsystems, Inc. Valid HTML 4.01!
Valid CSS