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

OR

# 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
192.168.1.1

OR

# vi /etc/hostname.rtls0
192.168.1.1

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
192.168.1.1

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
#
127.0.0.1 localhost loghost sol9
192.168.1.1 sol9 sol9.nixcraft.com 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):

192.168.1.0 255.255.255.0

7) In above example, 192.168.1.0 is network ID and 255.255.255.0 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 January 28, 2005

/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:
192.168.1.254
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 192.168.1.254
Output:

add net default: gateway 192.168.1.254

Finally use nslookup and ping command to check network settings:
$ ping 192.168.1.254
$ nslookup nixcraft.com

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

Posted on in Categories Solaris, Sys admin, Troubleshooting, UNIX last updated January 28, 2005

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:

search nixcraft.in
nameserver 202.54.1.30
nameserver 202.54.1.18

Where,

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

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 nixcraft.in
OR
# /usr/sfw/sbin/nslookup nixcraft.in
Output:

Server:  gwbsd2vsnl.nixcraft.in
Address:  192.168.1.202

Non-authoritative answer:
Name:    nixcraft.in
Address:  202.71.128.225

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

OR

# prtconf –D | more

OR

# 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

OR

rmformat –F quick /vol/dev/diskette0

OR

rmformat –F long /dev/rdiskette

OR

rmformat –F long /vol/dev/diskette0

Where,

  • -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)

Solaris > Access the CDROM/DVD (mount CDROM/DVD media)

Posted on in Categories News last updated January 26, 2005

The Volume Management daemon, vold, creates and maintains a file system image rooted at root-dir that contains symbolic names for CD-ROM and floppy, ZIP/JAZ, and DVD-ROM devices and other removable devices. Use volcheck command to checks for media in a drive and by default checks all floppy media.

1) First put CDROM/DVD into drive

2) For CDROM: After few second change directory /cdrom/cdrom0 or /cdrom/VOL_NAME

# cd /cdrom/cdrom0

3) For DVDROM: After few second change directory /dvd/VOL_NAMRE

If this does not works make sure volmgt daemon is running:

# /etc/init.d/volmgt start

Scan for devices both cd or floopy using:

#volcheck

(Check out all of our posts on Solaris)

Solaris > Access the zip / jaz drive (mount zip disk)

Posted on in Categories News last updated January 26, 2005

The Volume Management daemon, vold, creates and maintains a file system image rooted at root-dir that contains symbolic names for CD-ROM and floppy, ZIP/JAZ, and DVD-ROM devices and other removable devices. Use volcheck command to checks for media in a drive and by default checks all floppy media.

1) Put zip/jaz disk into drive

2) Type command:

# volcheck

3) Change directory to /rmdisk/zip0

cd /rmdisk/zip0

(Check out all of our posts on Solaris)

Solaris > Access the floppy disk (mount floppy disk)

Posted on in Categories News last updated January 26, 2005

The Volume Management daemon, vold, creates and maintains a file system image rooted at root-dir that contains symbolic names for CD-ROM and floppy, ZIP/JAZ, and DVD-ROM devices and other removable devices. Use volcheck command to checks for media in a drive and by default checks all floppy media.

1) Put floppy into drive (yes you have to 😉

2) Type command:

# volcheck

3) Change directory to /floppy or /floppy/floppy0 or /floppy/VOL_NAME

# cd /floppy/floppy0

(Check out all of our posts on Solaris)