Showing posts with label Solaris 10. Show all posts
Showing posts with label Solaris 10. Show all posts

Wednesday 2 May 2018

How to Create a Link Aggregation – Bonding on Solaris

A link aggregation consists of several interfaces on a system that are configured together as a single, logical unit. Link aggregation, also referred to as trunking

Basically link aggregation is like a bonding on server. Its work in active and passive mode. At a time one network device are up and other bonding device are in stand by mode.

Requirements for Link Aggregations:-

1. Your link aggregation configuration is bound by the following requirements:

2. You must use the dladm command to configure aggregations.

3. An interface that has been plumbed cannot become a member of an aggregation.

4. Interfaces must be of the GLDv3 type: xge, e1000g, and bge.

5. All interfaces in the aggregation must run at the same speed and in full-duplex mode.

If the solaris box matches these above requirement, after that we can only able to create a link aggregation.

How to create a link aggregation in Solaris operating system:-

1. As a root user please login on the solaris operating system so you have full administrative role to perform the action.

2. Determine which interfaces are currently installed on your system.

For this work you need to run the below command.

#dladm show-link

The above command show you the which interfaces are currently installed on your system.

#dladm show-link
ce0             type: legacy    mtu: 1500       device: ce0
ce1             type: legacy    mtu: 1500       device: ce1
bge0            type: non-vlan  mtu: 1500       device: bge0
bge1            type: non-vlan  mtu: 1500       device: bge1

As per link aggregation requirement, we can only use the interface which start from bge etc. here the device bge0, bge1 are currently installed on the server.

3. In this step now determine which interfaces have been plumbed. for this please run the below command.

#ifconfig -a

lo0: flags=2001000322 <UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000 
ce0: flags=1000420 <UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 192.168.1.43 netmask ffffff00 broadcast 192.168.1.255
        ether 0:4:7c:8:92:7d 

4. Now create a link aggregation using below command

#dladm create-aggr -d bge0 -d bge1 1

here 1 is the key number which identify the link aggreation , and it is lowest number.


5. now configure & plumb the newly created aggregation. Please use the below command to do this.

#ifconfig aggr1 plumb 192.168.1.56 up

6. To check the status of the aggregation you just created, please run the below command.

#dladm show-aggr

key: 1 (0x0001) policy: L4      address: 0:4:7c:8:92:7d (auto)
device   address           speed         duplex  link    state
bge0     0:4:7c:9:87:4e    1000  Mbps    full    up      attached
bge1     0:4:7c:9:32:9e    0     Mbps    unknown down    standby

7. For link aggregations with IPv4 addresses, create an /etc/hostname.aggrkey file.

#vi /etc/hostname.aggr1
92.168.1.56

8. perform a reboot.

#reboot -- -r

Friday 20 October 2017

How to configure NTP server and client on Solaris 10 and Solaris 11

As you know NTP ( Network time Protocol) is one of the oldest internet protocol still in use and it allows the synchronization of computer clocks distributing UTC (Coordinated Universal Time) over the network.

NTP Service on Solaris 10 and Solaris 11:

Solaris 10 used the SMF utility (Service Management Facility) and the NTP service is now managed by SMF (Service Management Facility). NTP daemon configured using Service management facility (svc:/network/ntp:default) and a bunch of sample ntp.conf files to quickly configure a machine as a client or as a server. On Solaris 11 only ships with NTP v. 4, the NTP v. 4 service is identified by the name ntp4. You can check the ntp status using below command.

!-[solaris]# svcs status ntp

STATE  STIME   FMRI
online 10:14:23 svc:/network/ntp:default

If you see the above command output it is shown that network time protocol services is enable and online on the server.

Steps for Configuring a NTP client:

Suppose your machine is just a client machine, then you can just take the /etc/inet/ntp.client file and copy it to /etc/inet/ntp.conf.

multicastclient 127.0.0.1

If you see the configuration it's a passive configuration for a Server host which listens for NTP server putting packets on the NTP multicast network, 127.0.0.1. If your machine is on LAN without NTP server then in that case we are not recveied any packet and for this we need to use Public NTP server for host.

In my case, I'm using the Indian pool in.pool.ntp.org and my configuration file contains:

server 2.in.pool.ntp.org
server 1.asia.pool.ntp.org
server 3.asia.pool.ntp.org

Normally NTP requires a poll period to elapse before starting synchronizing your clock. If you want NTP to start immediately, which you most probably will if you're configuring a desktop environment, you can take advantage of iburst keyword, introduced in NTP v. 4: it instructs NTP to start the synchronization almost right away.

server 2.in.pool.ntp.org ibrust
server 1.asia.pool.ntp.org ibrust
server 3.asia.pool.ntp.org ibrust

You must make sure you're configuring NTP implementation corresponding to the syntax you're using.

Setting up the drift file:

The last thing which is remaining for NTP server setup in the client machine is to set up  drift file location. On my machine it is 

driftfile /var/ntp/ntp.drift

After setup the drift file configuration we will start the NTP servivce again 

!-[solaris]# svcadm restart svc:/network/ntp:default
!-[solaris]# svcs status svc:/network/ntp:default
STATE  STIME   FMRI
online 12:20:12 svc:/network/ntp:default 

Once the service is running, you can check which server you're using with ntpq, Please run the below command to check the ntpq.

!-[solaris]# ntpq -p

Setting up an NTP server:

Now in above step you see the NTP service has been started successfully, so now, you'll probably want to setup all of your machines.

If you're in a LAN, you can setup an internal NTP server which will provide data to other clients on your LAN. As before, you can take inspiration from the server configuration file shipped with Solaris 10 or Solaris 11, /etc/inet/ntp.server.

After setting up the drift file and the clients you're going to use, you can examine the other options and fine-tune them at your taste. Let's give a quick look at it.

server 127.127.XType.0

Now you have configured the NTP server properly. Please comment on the post if you have any suggestion.

Tuesday 18 July 2017

Solaris Package administration in Solaris 10 Operating System

In this article, we will provide all the commands with an example which describe as below.

pkginfo- It displays all software package information.
pkgadd- It installs all software packages to the system.
pkgrm- It removes a package from the system.
pkgchk- It checks package installation state.
pkgtrans- It translates packages from one server format to another.

Commands & Syntax for checking a package information:

For checking a packages information on Solaris 10 operating system we will used the "pkginfo" command. You can find the all command and syntax related to "pkginfo" is listed below.

Please use the below command to display information about installed software packages.

!-[solaris]# pkginfo | more

Please use the below command to view additional information.

!-[solaris]# pkginfo -l | more

Please use the below command to view information of a specific package.

!-[solaris]# pkginfo -l SUNWman

Please use the below command to find how many packages are currently installed.

!-[solaris]# pkginfo | wc -l

To list all installed software packages, please use the below command.

!-[solaris]# more /var/sadm/install/contents

These above commands with their syntax are daily used on Solaris 10 platform.

Commands & Syntax for checking a package installation:

For checking an information about packages are installed or not on the server , we need to use "pkgchk"  command. Please find the below example as describe below.

Please use the below command to check the contents & attributes of a currently installed package.

!-[solaris]# pkgchk SUNWpkgs

Please use the below command to list the all files contained in a software package.

!-[solaris]# pkgchk -v SUNWpkgs

Please use the below commands to find if the contents & attributes of a file have changed since it was installed with its software package.

!-[solaris]# pkgchk -p /etc/shadow 

Please use the below commands to list information about selected files that make up a package.

!-[solaris]# pkgchk -l -p /usr/bin/showrev

If the packages is installed already then in that case "pkgchk" command don't show any output that clear meaning is that packages is already installed on the server.

Commands & Syntax for adding a package software:

For adding a packages on the server, we will used the "pkgadd" command. Please find the below commands and their syntax which is daily used on Solaris operating system.

Please use the below command to add a software packages from DVD. For this you need to move on dvd directory where all the packages are listed.

!-[solaris]# pkgadd -d . SUNWpkgs

Using above command you can add the packages from DVD.

Commands & Syntax for removing a package software:

For removing the packages from the server, we will used "pkgrm" command. Please find the below commands and their syntax as listed below.

Please use the below command to remove the software packages.

!-[solaris]# pkgrm SUNWpkgs

Please use the below command to remove a package from the spool directory.

!-[solaris]# pkgrm -s /export/pkg SUNWldam

Commands & Syntax for translating a packages format:

For translating a packages format from one format to another , we will used the "pkgtrans" command for the same.

Please use the below command to translate a package from file system format in /var/tmp to data stream format.

!-[solaris]# pkgtrans /var/tmp /tmp/SUNWpkgs.pkg SUNWpkgs

Please use the below command to create a data streamed package.

!-[solaris]# pkgtrans -s Product /var/tmp/stream.pkg SUNWpkgg SUNWpkgs

Saturday 24 June 2017

Sun Solaris zonecfg commands with an example

"zonecfg" command is very useful command which is mostly used during configuration of new zone or installed zone as well as for removal of any zone configuration files.

This command are valid for Sun Solaris 10.x,11.x,12.x version.

➤ Command for creating a Solaris zone:

Please find the below commands to creating a zone on Sun Solaris server. The command must be run on Global zone with root user.

!-[solaris]# zonecfg -z <zone>

Example: !-[solaris]# zonecfg -z sunz01

Once you run the above command, you can enter in the configuration file, where you can add or edit the configuration for the zone.

Command for deleting a Solaris zone:

Please find the below command to deleting a Solaris zone from Global zone.

!-[solaris]# zonecfg -z <zone> delete -F

Example: !-[solaris]# zonecfg -z sunz01 delete -F

using above command you can delete or remove the configuration file of solaris local zone.

Note: You need to shutdown and uninstall the local zone before deleting the configuration files of Sun Solaris local zone.

Command for display zone current configuration:

Please find the below command to display the current configuration of local Solaris zones.

!-[solaris]# zonecfg -z <zone> info

Example: !-[solaris]#zonecfg -z sunz01 info

This command output show you the zonename, zonepath, autoboot etc attributes information of the solaris zone.

Command for zone creation file:

Please find the below command to create a solaris zone creation file.

!-[solaris]#zonecfg -z <zone> export

Example: !-[solaris]#zonecfg -z sun01 export

Once the creation file has been export you can use this file to another zone creation as well as for restoration of this local zone if any problem occur on this zone.

Thursday 25 May 2017

How to increase the file system size in Solaris 10/11 operating system

When you file system get full on Sun Solaris operating system , you need to increase it but on Solaris platform it is quite different from other unix operating version.

The below method are used for both type of Sun Solaris version 10/11. You can used the same command on different version platform.

➤ Mostly on Solaris 10/11 machine we have only use default storage pool. if you server is not connected to any SAN, then zpool name should be "rpool".

If you want to check which zpool are present on the Solaris box, you can run the below command for this work.

!-[solaris]# zpool status

Using the above command you can check which zpool storage are present on the solaris server. In my case my Solaris box is connected to SAN storage, so it is display both system default "rpool" & "san" storage system.

➤ Let's suppose you want to increase the size of root file system on server, then first you need to check the current disk space on the filesystem.

To check the current file size of filesystem you can use "df -h" command. This command will show you the filesystem size in correct manner.

On my Solaris box the root filesystem was created with rpool storage, so if I need to increase or extend the size of root filesystem I need to take space from this zpool.

For example, If you want to 5 Gb more space on root filesystem then please use the below command to extend the root filesystem size more 5 Gb. In my case my current root filesystem size is 12Gb so I will extend it to 17 Gb.

!-[solaris]# zfs set quota=17G rpool/ROOT/solaris-1

You can add the 5 Gb space in your current size (12Gb).

!-[solaris]# zfs set reservation=17G rpool/ROOT/solaris-1

In above command you can reserve the 17G space to root filesystem. You can check the new filesystem space using "zfs get quota" command.

Please comment on the post if you are facing any issue regarding the filesystem.