Solaris > How to configure LAN Card (NIC)

Posted on in Categories News last updated January 28, 2005

Following are generic steps

1) UNZIP or untar the driver

# gunzip -cd driver-x.y.z.tar.gz | tar xf –

2) Install the driver by running special install script, for e.g.

# sh install


# chmod +x install; ./install

3) Or you can also try out as follows to install driver:

# /usr/ccs/bin/make install

4) Or if driver in package format then install it using pkgadd command:

# buzip2 driver.bz2
# pkgadd -d driver

5) Open /etc/hostname.driver0 i.e. if your lan card driver name it tu or rtls then you can set up the ip address as follows:

# vi /etc/hostname.tu0


# vi /etc/hostname.rtls0

6) Then restart Solaris computer/server by typing following command:

# init 6

Complete example to install tu lan card driver (DAVICOM DM9102A or ADMtek AN983B chipset )
1) Download the file from authors web site.

2) Untar driver files using following commands:

# gunzip -cd tu-0.9.10.tar.gz | tar xf –
# cd tu-0.9.10

3) Install the driver as follows:

# /usr/ccs/bin/make install

4) Assign IP address to LAN card:

# cat > /etc/hostname.tu0

Save file (by pressing CTRL+D).

5) Assign Hostname, if its not assign, open file /etc/hosts using text editor:

# vi /etc/hosts

Add/modify following text:

# Internet host table
# localhost loghost sol9 sol9 loghost

Save file (by pressing ESC + : + x!) exit to shell prompt.

6) Setup network ID and netmask as follows:

# vi /etc/netmask

Add the following line (your network ID):

7) In above example, is network ID and is netmask.
Now reboot your Solaris system as by typing following command:

# init 6

8) When system comes up type commands to verify NIC driver is working properly:

# dmesg|more
# ifconfig -a

(Check out all of our posts on Solaris)

Solaris: How do I setup a default static route / static router IP address?

Posted on in Categories Solaris, Sys admin, Tip of the day, Tips, UNIX last updated May 31, 2007

/etc/defaultrouter is the configuration file for default router under Solaris os. The /etc/defaultrouter file can contain the IP addresses or hostnames of one or more default routers, with each entry on its own line. If you use hostnames, each hostname must also be listed in the local /etc/hosts file, because no name services are running at the time that defaultrouter is read.

The default routes listed in this file replace those added by the kernel during diskless booting. An empty /etc/defaultrouter file will cause the default route added by the kernel to be deleted.

(1) First login to Solaris box as a root user:
# su
The /etc/defaultrouter is configuration file for default router under Sun Solaris. Open the file /etc/defaultrouter and add the router IP address:
# vi /etc/defaultrouter
Append IP address:
Restart the Solaris network with following command:
# /etc/init.d/network restart
(3) Or you can add the router IP to default route table as follows:
# route add default

add net default: gateway

Finally use nslookup and ping command to check network settings:
$ ping
$ nslookup

Solaris UNIX: How to Setup DNS Client configuration / name server

Posted on in Categories Solaris, Sys admin, Troubleshooting, UNIX last updated October 8, 2007

So how do you set DNS namserver under Sun Solaris UNIX system? The resolver is a set of routines in the C library that provide access to the Internet Domain Name System (DNS). The resolver configuration file contains information that is read by the resolver routines the first time they are invoked by a process. The file is designed to be human readable and contains a list of keywords with values that provide various types of resolver information.

Internet address (in dot notation) of a name server that the resolver should query. Up to MAXNS (currently 3, see ) name servers may be listed, one per keyword. If there are multiple servers, the resolver library queries them in the order listed. To configure Solaris nameserver edit or modify /etc/resolv.conf file.

DNS Client Setup

First Create the file called /etc/resolv.conf – which includes the primary and secondary DNS server IP address for Solaris system, it can be your own DNS server or your ISPs DNS server:
# touch /etc/resolv.conf

Open /etc/resolv.conf using vi text editor:
# vi /etc/resolv.conf
Add the following lines to it:



  • nameserver IP : It is IP of first DNS server
  • search : Default domain name to search. For example, if you type command nslookup www, it will search it as

2) Enable the name resolving using DNS as follows:
# cp /etc/nsswitch.dns /etc/nsswitch.conf
3) Test new name server by running the nslookup command as follows:
# nslookup
# /usr/sfw/sbin/nslookup


Non-authoritative answer:

Solaris > Gathered System Information or How to print system configuration

Posted on in Categories News last updated January 28, 2005

The prtconf command prints the system configuration information. The output includes the total amount of memory, and the configuration of system peripherals formatted as a device tree.

1) Use prtconf command:

# prtconf | more


# prtconf –D | more


# prtconf | grep “Memory”

Memory size: 512 Megabytes

2) Use modinfo command:
It display information about loaded kernel modules

# modinfo | more

Update: See all shell Solaris Commands

(Check out all of our posts on Solaris)

Solaris > Format floppy, UFS file system, fix bad blocks

Posted on in Categories News last updated January 28, 2005

The rmformat utility is used to format, label, partition, and perform other miscellaneous functions on removable, rewritable media that include floppy drives, IOMEGA Zip/Jaz products, USB mass strorage and the PCMCIA memory and ata cards.

The mkfs utility constructs a file system on the device (format i.e. create file system).

Format floppy:
1) Use the command rmformat to format the floppy disk:

rmformat –F quick /dev/rdiskette


rmformat –F quick /vol/dev/diskette0


rmformat –F long /dev/rdiskette


rmformat –F long /vol/dev/diskette0


  • -F long : Formatting with media verification
  • -F quick : Formatting w/o media verification

Solaris >Create the UFS file system on floppy
1) Use the command rmformat to format the floppy disk:

# newfs /dev/rdiskette

Solaris > How to check the floppy disk (scan disk i.e. just like scandisk in windows)
1) Use the command fsck:

# fsck –F ufs /dev/rdiskette

Solaris > Create the PCFS (FAT) file system on floppy:
1) Use the command mkfs command to format the floppy disk using FAT file system:

# mkfs –F pcfs /dev/rdiskette

Solaris > How to fix bad blocks on floppy
1) Use the command rmformat to with –c {block number} switch to fix bad block:

# rmformat -c 32 /dev/rdiskette

2) Then verify that it was fixed as follows:

# rmformat –V read /dev/rdiskette

(Check out all of our posts on Solaris)

Solaris > Forcefully unmount the cdrom/floppy disk

Posted on in Categories News last updated January 28, 2005

fuser command displays the PIDs of processes using the specified files or file systems. You can use fuser command to specifies a file on a mounted file system or a block device that is mounted. All processes accessing files on that file system are listed using -k option you can forcefully kill mounted file system. It sends the SIGKILL signal to each process. Since this option spawns kills for each process, the kill messages may not show up immediately. No signals will be sent to kernel file consumers.

1) Use the fuser command to see who is accessing your device:
(For example if someone opened file on CDROM)

# vi /cdrom/cdrom0/somefile.txt

(Press CTRL + Z)

# eject cd
# fuser –u /cdrom/cdrom0

2) Kill the process-accessing device:

# cd /
# fuser –k /cdrom/cdrom0
# eject cd

(Check out all of our posts on Solaris)

Solaris > Safely remove / unmount the floppy disk or cdrom

Posted on in Categories News last updated January 26, 2005

First use sync command update the super block. Then use the eject utility. It is used for those removable media devices that do not have a manual eject button, or for those that do, but are managed by Volume Management.

1) Type command sync to write superblock or data to device (for floppy disk):

# sync;sync

2) Use eject command to eject (or unmount it) floppy:

# eject fd

3) To Remove / unmount the CDROM disk
Use eject command as follows:

# eject cd

(Check out all of our posts on Solaris)